dodtls.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2021 Freie Universität Berlin
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
31 #include "net/sock/dtls.h"
32 #include "net/sock/udp.h"
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
42 #define SOCK_DODTLS_PORT (853)
49 #ifndef CONFIG_SOCK_DODTLS_RETRIES
50 #define CONFIG_SOCK_DODTLS_RETRIES (2)
51 #endif
52 
56 #ifndef CONFIG_SOCK_DODTLS_TIMEOUT_MS
57 #define CONFIG_SOCK_DODTLS_TIMEOUT_MS (1000U)
58 #endif
64 #define SOCK_DODTLS_MAX_NAME_LEN (CONFIG_DNS_MSG_LEN - sizeof(dns_hdr_t) - 4)
92 int sock_dodtls_query(const char *domain_name, void *addr_out, int family);
93 
104 
111 
118 
136  const credman_credential_t *creds);
137 
138 #ifdef __cplusplus
139 }
140 #endif
141 
int sock_dodtls_set_server(const sock_udp_ep_t *server, const credman_credential_t *creds)
Configure and establish session with DNS over DTLS server.
sock_dtls_session_t * sock_dodtls_get_server_session(void)
Return the DTLS ssession used by the DNS over DTLS client.
int sock_dodtls_query(const char *domain_name, void *addr_out, int family)
Get IP address for DNS name.
sock_dtls_t * sock_dodtls_get_dtls_sock(void)
Return the sock used by the DNS over DTLS client.
int sock_dodtls_get_server(sock_udp_ep_t *server)
Get currently configured DNS over DTLS server endpoint.
DTLS sock definitions.
UDP sock definitions.
Common IP-based transport layer end point.
Definition: sock.h:211
Credential information.
Definition: credman.h:116
Information about remote client connected to the server.
Information about DTLS sock.