Sock DNS over DTLS client.  
More...
Sock DNS over DTLS client. 
- See also
 - RFC 8094
 
- Warning
 - This feature is experimental!
 This implementation is in an experimental state. RFC 8094 requires DNS over TLS (DoT) as a fall-back for the PMTU issues). This fallback is not in place in this implementation. Consequently, EDNS(0) to negotiate maximum response size is also not in place.  
 | 
| file   | dodtls.h | 
|   | DNS over DTLS sock definitions. 
  | 
|   | 
◆ sock_dodtls_get_dtls_sock()
Return the sock used by the DNS over DTLS client. 
- Returns
 - The sock used by the DNS over DTLS client 
 
 
 
◆ sock_dodtls_get_server()
Get currently configured DNS over DTLS server endpoint. 
- Parameters
 - 
  
    | [out] | server | The currently configured DNS over DTLS server endpoint. May not be NULL on input. | 
  
   
- Returns
 - 0 if 
server was set.  
- 
-ENOTCONN, when currently no server is configured. 
 
 
 
◆ sock_dodtls_get_server_session()
Return the DTLS ssession used by the DNS over DTLS client. 
- Returns
 - The DTLS session used by the DNS over DTLS client 
 
 
 
◆ sock_dodtls_query()
      
        
          | int sock_dodtls_query  | 
          ( | 
          const char *  | 
          domain_name,  | 
        
        
           | 
           | 
          void *  | 
          addr_out,  | 
        
        
           | 
           | 
          int  | 
          family  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Get IP address for DNS name. 
This function will synchronously try to resolve a DNS A or AAAA record by contacting the DNS server specified in the global variable sock_dns_server.
By supplying AF_INET, AF_INET6 or AF_UNSPEC in family requesting of A records (IPv4), AAAA records (IPv6) or both can be selected.
This function will return the first DNS record it receives. IF both A and AAAA are requested, AAAA will be preferred.
- Note
 addr_out needs to provide space for any possible result! (4byte when family==AF_INET, 16byte otherwise)
- Parameters
 - 
  
    | [in] | domain_name | DNS name to resolve into address  | 
    | [out] | addr_out | buffer to write result into  | 
    | [in] | family | Either AF_INET, AF_INET6 or AF_UNSPEC | 
  
   
- Returns
 - the size of the resolved address on success 
 
- 
-ECONNREFUSED, when a DNS over DTLS server is not configured. 
 
- 
-ENOSPC, when the length of 
domain_name is greater than SOCK_DODTLS_MAX_NAME_LEN.  
- 
-EBADSG, when the DNS reply is not parseable. 
 
 
 
◆ sock_dodtls_set_server()