Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > d5e62c01ae8d1e579463c6a871dd44bf > files > 2052

qtbase5-doc-5.12.6-2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qdtls.cpp -->
  <title>QDtlsClientVerifier Class | Qt Network 5.12.6</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.12</td><td ><a href="qtnetwork-index.html">Qt Network</a></td><td ><a href="qtnetwork-module.html">C++ Classes</a></td><td >QDtlsClientVerifier</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtnetwork-index.html">Qt 5.12.6 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QDtlsClientVerifier Class</h1>
<!-- $$$QDtlsClientVerifier-brief -->
<p>This class implements server-side DTLS cookie generation and verification. <a href="#details">More...</a></p>
<!-- @@@QDtlsClientVerifier -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QDtlsClientVerifier&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += network</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign">  Qt 5.12</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="../qtcore/qobject.html">QObject</a></td></tr></table></div><ul>
<li><a href="qdtlsclientverifier-members.html">List of all members, including inherited members</a></li>
<li><a href="qdtlsclientverifier-obsolete.html">Obsolete members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> class </td><td class="memItemRight bottomAlign"><b><a href="qdtlsclientverifier-generatorparameters.html">GeneratorParameters</a></b></td></tr>
</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdtlsclientverifier.html#QDtlsClientVerifier">QDtlsClientVerifier</a></b>(QObject *<i>parent</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qdtlsclientverifier.html#dtor.QDtlsClientVerifier">~QDtlsClientVerifier</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDtlsClientVerifier::GeneratorParameters </td><td class="memItemRight bottomAlign"><b><a href="qdtlsclientverifier.html#cookieGeneratorParameters">cookieGeneratorParameters</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDtlsError </td><td class="memItemRight bottomAlign"><b><a href="qdtlsclientverifier.html#dtlsError">dtlsError</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qdtlsclientverifier.html#dtlsErrorString">dtlsErrorString</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdtlsclientverifier.html#setCookieGeneratorParameters">setCookieGeneratorParameters</a></b>(const QDtlsClientVerifier::GeneratorParameters &amp;<i>params</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qdtlsclientverifier.html#verifiedHello">verifiedHello</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdtlsclientverifier.html#verifyClient">verifyClient</a></b>(QUdpSocket *<i>socket</i>, const QByteArray &amp;<i>dgram</i>, const QHostAddress &amp;<i>address</i>, quint16 <i>port</i>)</td></tr>
</table></div>
<ul>
<li class="fn">31 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li>
</ul>
<a name="static-public-members"></a>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> const QMetaObject </td><td class="memItemRight bottomAlign"><b><a href="qdtlsclientverifier.html#staticMetaObject-var">staticMetaObject</a></b></td></tr>
</table></div>
<ul>
<li class="fn">9 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 property inherited from <a href="../qtcore/qobject.html#properties">QObject</a></li>
<li class="fn">1 public slot inherited from <a href="../qtcore/qobject.html#public-slots">QObject</a></li>
<li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QDtlsClientVerifier-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>This class implements server-side DTLS cookie generation and verification.</p>
<p>The <a href="qdtlsclientverifier.html">QDtlsClientVerifier</a> class implements server-side DTLS cookie generation and verification. Datagram security protocols are highly susceptible to a variety of Denial-of-Service attacks. According to <a href="https://tools.ietf.org/html/rfc6347#section-4.2.1">RFC 6347, section 4.2&#x2e;1</a>, these are two of the more common types of attack:</p>
<ul>
<li>An attacker transmits a series of handshake initiation requests, causing a server to allocate excessive resources and potentially perform expensive cryptographic operations.</li>
<li>An attacker transmits a series of handshake initiation requests with a forged source of the victim, making the server act as an amplifier. Normally, the server would reply to the victim machine with a Certificate message, which can be quite large, thus flooding the victim machine with datagrams.</li>
</ul>
<p>As a countermeasure to these attacks, <a href="https://tools.ietf.org/html/rfc6347#section-4.2.1">RFC 6347, section 4.2&#x2e;1</a> proposes a stateless cookie technique that a server may deploy:</p>
<ul>
<li>In response to the initial ClientHello message, the server sends a HelloVerifyRequest, which contains a cookie. This cookie is a cryptographic hash and is generated using the client's address, port number, and the server's secret (which is a cryptographically strong pseudo-random sequence of bytes).</li>
<li>A reachable DTLS client is expected to reply with a new ClientHello message containing this cookie.</li>
<li>When the server receives the ClientHello message with a cookie, it generates a new cookie as described above. This new cookie is compared to the one found in the ClientHello message.</li>
<li>In the cookies are equal, the client is considered to be real, and the server can continue with a TLS handshake procedure.</li>
</ul>
<p><b>Note: </b>A DTLS server is not required to use DTLS cookies.</p><p><a href="qdtlsclientverifier.html">QDtlsClientVerifier</a> is designed to work in pair with <a href="qudpsocket.html">QUdpSocket</a>, as shown in the following code-excerpt:</p>
<pre class="cpp">

  <span class="keyword">class</span> DtlsServer : <span class="keyword">public</span> <span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span>
  {
  <span class="keyword">public</span>:
      bool listen(<span class="keyword">const</span> <span class="type"><a href="qhostaddress.html">QHostAddress</a></span> <span class="operator">&amp;</span>address<span class="operator">,</span> <span class="type"><a href="../qtcore/qtglobal.html#quint16-typedef">quint16</a></span> port);
      <span class="comment">// ...</span>

  <span class="keyword">private</span>:
      <span class="type">void</span> readyRead();
      <span class="comment">// ...</span>

      <span class="type"><a href="qudpsocket.html">QUdpSocket</a></span> serverSocket;
      <span class="type"><a href="qdtlsclientverifier.html#QDtlsClientVerifier">QDtlsClientVerifier</a></span> verifier;
      <span class="comment">// ...</span>
  };

  bool DtlsServer<span class="operator">::</span>listen(<span class="keyword">const</span> <span class="type"><a href="qhostaddress.html">QHostAddress</a></span> <span class="operator">&amp;</span>serverAddress<span class="operator">,</span> <span class="type"><a href="../qtcore/qtglobal.html#quint16-typedef">quint16</a></span> serverPort)
  {
      <span class="keyword">if</span> (serverSocket<span class="operator">.</span>bind(serverAddress<span class="operator">,</span> serverPort))
          connect(<span class="operator">&amp;</span>serverSocket<span class="operator">,</span> <span class="operator">&amp;</span><span class="type"><a href="qudpsocket.html">QUdpSocket</a></span><span class="operator">::</span>readyRead<span class="operator">,</span> <span class="keyword">this</span><span class="operator">,</span> <span class="operator">&amp;</span>DtlsServer<span class="operator">::</span>readyRead);
      <span class="keyword">return</span> serverSocket<span class="operator">.</span>state() <span class="operator">=</span><span class="operator">=</span> <span class="type"><a href="qabstractsocket.html">QAbstractSocket</a></span><span class="operator">::</span>BoundState;
  }

  <span class="type">void</span> DtlsServer<span class="operator">::</span>readyRead()
  {
      <span class="type"><a href="../qtcore/qbytearray.html">QByteArray</a></span> dgram(serverSocket<span class="operator">.</span>pendingDatagramSize()<span class="operator">,</span> <span class="type">Qt</span><span class="operator">::</span>Uninitialized);
      <span class="type"><a href="qhostaddress.html">QHostAddress</a></span> address;
      <span class="type"><a href="../qtcore/qtglobal.html#quint16-typedef">quint16</a></span> port <span class="operator">=</span> {};
      serverSocket<span class="operator">.</span>readDatagram(dgram<span class="operator">.</span>data()<span class="operator">,</span> dgram<span class="operator">.</span>size()<span class="operator">,</span> <span class="operator">&amp;</span>address<span class="operator">,</span> <span class="operator">&amp;</span>port);
      <span class="keyword">if</span> (verifiedClients<span class="operator">.</span>contains({address<span class="operator">,</span> port}) {
          <span class="comment">// This client was verified previously, we either continue the</span>
          <span class="comment">// handshake or decrypt the incoming message.</span>
      } <span class="keyword">else</span> <span class="keyword">if</span> (verifier<span class="operator">.</span>verifyClient(<span class="operator">&amp;</span>serverSocket<span class="operator">,</span> dgram<span class="operator">,</span> address<span class="operator">,</span> port)) {
          <span class="comment">// Apparently we have a real DTLS client who wants to send us</span>
          <span class="comment">// encrypted datagrams. Remember this client as verified</span>
          <span class="comment">// and proceed with a handshake.</span>
      } <span class="keyword">else</span> {
          <span class="comment">// No matching cookie was found in the incoming datagram,</span>
          <span class="comment">// verifyClient() has sent a ClientVerify message.</span>
          <span class="comment">// We'll hear from the client again soon, if they're real.</span>
      }
  }

</pre>
<p><a href="qdtlsclientverifier.html">QDtlsClientVerifier</a> does not impose any restrictions on how the application uses <a href="qudpsocket.html">QUdpSocket</a>. For example, it is possible to have a server with a single <a href="qudpsocket.html">QUdpSocket</a> in state <a href="qabstractsocket.html#SocketState-enum">QAbstractSocket::BoundState</a>, handling multiple DTLS clients simultaneously:</p>
<ul>
<li>Testing if new clients are real DTLS-capable clients.</li>
<li>Completing TLS handshakes with the verified clients (see <a href="qdtls.html">QDtls</a>).</li>
<li>Decrypting datagrams coming from the connected clients (see <a href="qdtls.html">QDtls</a>).</li>
<li>Sending encrypted datagrams to the connected clients (see <a href="qdtls.html">QDtls</a>).</li>
</ul>
<p>This implies that <a href="qdtlsclientverifier.html">QDtlsClientVerifier</a> does not read directly from a socket, instead it expects the application to read an incoming datagram, extract the sender's address, and port, and then pass this data to <a href="qdtlsclientverifier.html#verifyClient">verifyClient</a>(). To send a HelloVerifyRequest message, <a href="qdtlsclientverifier.html#verifyClient">verifyClient</a>() can write to the <a href="qudpsocket.html">QUdpSocket</a>.</p>
<p><b>Note: </b><a href="qdtlsclientverifier.html">QDtlsClientVerifier</a> does not take ownership of the <a href="qudpsocket.html">QUdpSocket</a> object.</p><p>By default <a href="qdtlsclientverifier.html">QDtlsClientVerifier</a> obtains its secret from a cryptographically strong pseudorandom number generator.</p>
<p><b>Note: </b>The default secret is shared by all objects of the classes <a href="qdtlsclientverifier.html">QDtlsClientVerifier</a> and <a href="qdtls.html">QDtls</a>. Since this can impose security risks, RFC 6347 recommends to change the server's secret frequently. Please see <a href="https://tools.ietf.org/html/rfc6347">RFC 6347, section 4.2&#x2e;1</a> for hints about possible server implementations. Cookie generator parameters can be set using the class <a href="qdtlsclientverifier-generatorparameters.html">QDtlsClientVerifier::GeneratorParameters</a> and <a href="qdtlsclientverifier.html#setCookieGeneratorParameters">setCookieGeneratorParameters</a>():</p><pre class="cpp">

  <span class="type">void</span> DtlsServer<span class="operator">::</span>updateServerSecret()
  {
      <span class="keyword">const</span> <span class="type"><a href="../qtcore/qbytearray.html">QByteArray</a></span> newSecret(generateCryptoStrongSecret());
      <span class="keyword">if</span> (newSecret<span class="operator">.</span>size()) {
          usedCookies<span class="operator">.</span>append(newSecret);
          verifier<span class="operator">.</span>setCookieGeneratorParameters({<span class="type"><a href="../qtcore/qcryptographichash.html">QCryptographicHash</a></span><span class="operator">::</span>Sha1<span class="operator">,</span> newSecret});
      }
  }

</pre>
<p>The <a href="qtnetwork-secureudpserver-example.html">DTLS server</a> example illustrates how to use <a href="qdtlsclientverifier.html">QDtlsClientVerifier</a> in a server application.</p>
</div>
<p><b>See also </b><a href="qudpsocket.html">QUdpSocket</a>, <a href="qabstractsocket.html#SocketState-enum">QAbstractSocket::BoundState</a>, <a href="qdtls.html">QDtls</a>, <a href="qdtlsclientverifier.html#verifyClient">verifyClient</a>(), <a href="qdtlsclientverifier-generatorparameters.html">GeneratorParameters</a>, <a href="qdtlsclientverifier.html#setCookieGeneratorParameters">setCookieGeneratorParameters</a>(), <a href="qdtlsclientverifier.html#cookieGeneratorParameters">cookieGeneratorParameters</a>(), <a href="qdtls.html#setCookieGeneratorParameters">QDtls::setCookieGeneratorParameters</a>(), <a href="qdtls.html#cookieGeneratorParameters">QDtls::cookieGeneratorParameters</a>(), <a href="../qtcore/qcryptographichash.html#Algorithm-enum">QCryptographicHash::Algorithm</a>, <a href="qdtls.html#QDtlsError-enum">QDtlsError</a>, <a href="qdtlsclientverifier.html#dtlsError">dtlsError</a>(), and <a href="qdtlsclientverifier.html#dtlsErrorString">dtlsErrorString</a>().</p>
<!-- @@@QDtlsClientVerifier -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QDtlsClientVerifier[overload1]$$$QDtlsClientVerifierQObject* -->
<h3 class="fn" id="QDtlsClientVerifier"><a name="QDtlsClientVerifier"></a>QDtlsClientVerifier::<span class="name">QDtlsClientVerifier</span>(<span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i>parent</i> = nullptr)</h3>
<p>Constructs a <a href="qdtlsclientverifier.html">QDtlsClientVerifier</a> object, <i>parent</i> is passed to <a href="../qtcore/qobject.html">QObject</a>'s constructor.</p>
<!-- @@@QDtlsClientVerifier -->
<!-- $$$~QDtlsClientVerifier[overload1]$$$~QDtlsClientVerifier -->
<h3 class="fn" id="dtor.QDtlsClientVerifier"><a name="dtor.QDtlsClientVerifier"></a><code>[virtual] </code>QDtlsClientVerifier::<span class="name">~QDtlsClientVerifier</span>()</h3>
<p>Destroys the <a href="qdtlsclientverifier.html">QDtlsClientVerifier</a> object.</p>
<!-- @@@~QDtlsClientVerifier -->
<!-- $$$cookieGeneratorParameters[overload1]$$$cookieGeneratorParameters -->
<h3 class="fn" id="cookieGeneratorParameters"><a name="cookieGeneratorParameters"></a><span class="type"><a href="qdtlsclientverifier-generatorparameters.html">QDtlsClientVerifier::GeneratorParameters</a></span> QDtlsClientVerifier::<span class="name">cookieGeneratorParameters</span>() const</h3>
<p>Returns the current secret and hash algorithm used to generate cookies. The default hash algorithm is <a href="../qtcore/qcryptographichash.html#Algorithm-enum">QCryptographicHash::Sha256</a> if Qt was configured to support it, <a href="../qtcore/qcryptographichash.html#Algorithm-enum">QCryptographicHash::Sha1</a> otherwise. The default secret is obtained from the backend-specific cryptographically strong pseudorandom number generator.</p>
<p><b>See also </b><a href="../qtcore/qcryptographichash.html#Algorithm-enum">QCryptographicHash::Algorithm</a>, <a href="qdtlsclientverifier-generatorparameters.html">QDtlsClientVerifier::GeneratorParameters</a>, and <a href="qdtlsclientverifier.html#setCookieGeneratorParameters">setCookieGeneratorParameters</a>().</p>
<!-- @@@cookieGeneratorParameters -->
<!-- $$$dtlsError[overload1]$$$dtlsError -->
<h3 class="fn" id="dtlsError"><a name="dtlsError"></a><span class="type"><a href="qdtls.html#QDtlsError-enum">QDtlsError</a></span> QDtlsClientVerifier::<span class="name">dtlsError</span>() const</h3>
<p>Returns the last error that occurred or QDtlsError::NoError.</p>
<p><b>See also </b><a href="qdtls.html#QDtlsError-enum">QDtlsError</a> and <a href="qdtlsclientverifier.html#dtlsErrorString">dtlsErrorString</a>().</p>
<!-- @@@dtlsError -->
<!-- $$$dtlsErrorString[overload1]$$$dtlsErrorString -->
<h3 class="fn" id="dtlsErrorString"><a name="dtlsErrorString"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QDtlsClientVerifier::<span class="name">dtlsErrorString</span>() const</h3>
<p>Returns a textual description of the last error, or an empty string.</p>
<p><b>See also </b><a href="qdtlsclientverifier.html#dtlsError">dtlsError</a>().</p>
<!-- @@@dtlsErrorString -->
<!-- $$$setCookieGeneratorParameters[overload1]$$$setCookieGeneratorParametersconstQDtlsClientVerifier::GeneratorParameters& -->
<h3 class="fn" id="setCookieGeneratorParameters"><a name="setCookieGeneratorParameters"></a><span class="type">bool</span> QDtlsClientVerifier::<span class="name">setCookieGeneratorParameters</span>(const <span class="type"><a href="qdtlsclientverifier-generatorparameters.html">QDtlsClientVerifier::GeneratorParameters</a></span> &amp;<i>params</i>)</h3>
<p>Sets the secret and the cryptographic hash algorithm from <i>params</i>. This <a href="qdtlsclientverifier.html">QDtlsClientVerifier</a> will use these to generate cookies. If the new secret has size zero, this function returns <code>false</code> and does not change the cookie generator parameters.</p>
<p><b>Note: </b>The secret is supposed to be a cryptographically secure sequence of bytes.</p><p><b>See also </b><a href="qdtlsclientverifier-generatorparameters.html">QDtlsClientVerifier::GeneratorParameters</a>, <a href="qdtlsclientverifier.html#cookieGeneratorParameters">cookieGeneratorParameters</a>(), and <a href="../qtcore/qcryptographichash.html#Algorithm-enum">QCryptographicHash::Algorithm</a>.</p>
<!-- @@@setCookieGeneratorParameters -->
<!-- $$$verifiedHello[overload1]$$$verifiedHello -->
<h3 class="fn" id="verifiedHello"><a name="verifiedHello"></a><span class="type"><a href="../qtcore/qbytearray.html">QByteArray</a></span> QDtlsClientVerifier::<span class="name">verifiedHello</span>() const</h3>
<p>Convenience function. Returns the last ClientHello message that was successfully verified, or an empty <a href="../qtcore/qbytearray.html">QByteArray</a> if no verification has completed.</p>
<p><b>See also </b><a href="qdtlsclientverifier.html#verifyClient">verifyClient</a>().</p>
<!-- @@@verifiedHello -->
<!-- $$$verifyClient[overload1]$$$verifyClientQUdpSocket*constQByteArray&constQHostAddress&quint16 -->
<h3 class="fn" id="verifyClient"><a name="verifyClient"></a><span class="type">bool</span> QDtlsClientVerifier::<span class="name">verifyClient</span>(<span class="type"><a href="qudpsocket.html">QUdpSocket</a></span> *<i>socket</i>, const <span class="type"><a href="../qtcore/qbytearray.html">QByteArray</a></span> &amp;<i>dgram</i>, const <span class="type"><a href="qhostaddress.html">QHostAddress</a></span> &amp;<i>address</i>, <span class="type"><a href="../qtcore/qtglobal.html#quint16-typedef">quint16</a></span> <i>port</i>)</h3>
<p><i>socket</i> must be a valid pointer, <i>dgram</i> must be a non-empty datagram, <i>address</i> cannot be null, broadcast, or multicast. <i>port</i> is the remote peer's port. This function returns <code>true</code> if <i>dgram</i> contains a ClientHello message with a valid cookie. If no matching cookie is found, verifyClient() will send a HelloVerifyRequest message using <i>socket</i> and return <code>false</code>.</p>
<p>The following snippet shows how a server application may check for errors:</p>
<pre class="cpp">

  <span class="keyword">if</span> (<span class="operator">!</span>verifier<span class="operator">.</span>verifyClient(<span class="operator">&amp;</span>socket<span class="operator">,</span> message<span class="operator">,</span> address<span class="operator">,</span> port)) {
      <span class="keyword">switch</span> (verifyClient<span class="operator">.</span>dtlsError()) {
      <span class="keyword">case</span> <span class="type"><a href="qdtls.html#QDtlsError-enum">QDtlsError</a></span><span class="operator">::</span>NoError:
          <span class="comment">// Not verified yet, but no errors found and we have to wait for the next</span>
          <span class="comment">// message from this client.</span>
          <span class="keyword">return</span>;
      <span class="keyword">case</span> <span class="type"><a href="qdtls.html#QDtlsError-enum">QDtlsError</a></span><span class="operator">::</span>TlsInitializationError:
          <span class="comment">// This error is fatal, nothing we can do about it.</span>
          <span class="comment">// Probably, quit the server after reporting the error.</span>
          <span class="keyword">return</span>;
      <span class="keyword">case</span> <span class="type"><a href="qdtls.html#QDtlsError-enum">QDtlsError</a></span><span class="operator">::</span>UnderlyingSocketError:
          <span class="comment">// There is some problem in QUdpSocket, handle it (see QUdpSocket::error())</span>
          <span class="keyword">return</span>;
      <span class="keyword">case</span> <span class="type"><a href="qdtls.html#QDtlsError-enum">QDtlsError</a></span><span class="operator">::</span>InvalidInputParameters:
      <span class="keyword">default</span>:
          Q_UNREACHABLE();
      }
  }

</pre>
<p><b>See also </b><a href="qhostaddress.html#isNull">QHostAddress::isNull</a>(), <a href="qhostaddress.html#isBroadcast">QHostAddress::isBroadcast</a>(), <a href="qhostaddress.html#isMulticast">QHostAddress::isMulticast</a>(), <a href="qdtlsclientverifier.html#setCookieGeneratorParameters">setCookieGeneratorParameters</a>(), and <a href="qdtlsclientverifier.html#cookieGeneratorParameters">cookieGeneratorParameters</a>().</p>
<!-- @@@verifyClient -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>