1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sock_dodtls: provide getters for sock and session

To be able to implement the DNS message exchange outside the module.
This commit is contained in:
Martine Lenders 2021-09-24 14:29:06 +02:00
parent 96b1d9c59e
commit 1b6c9a8334
No known key found for this signature in database
GPG Key ID: 2134D77A5336DD80
2 changed files with 25 additions and 0 deletions

View File

@ -32,6 +32,7 @@
#ifndef NET_SOCK_DODTLS_H
#define NET_SOCK_DODTLS_H
#include "net/sock/dtls.h"
#include "net/sock/udp.h"
#ifdef __cplusplus
@ -105,6 +106,20 @@ int sock_dodtls_query(const char *domain_name, void *addr_out, int family);
*/
int sock_dodtls_get_server(sock_udp_ep_t *server);
/**
* @brief Return the sock used by the DNS over DTLS client
*
* @return The sock used by the DNS over DTLS client
*/
sock_dtls_t *sock_dodtls_get_dtls_sock(void);
/**
* @brief Return the DTLS ssession used by the DNS over DTLS client
*
* @return The DTLS session used by the DNS over DTLS client
*/
sock_dtls_session_t *sock_dodtls_get_server_session(void);
/**
* @brief Configure and establish session with DNS over DTLS server
*

View File

@ -136,6 +136,16 @@ int sock_dodtls_get_server(sock_udp_ep_t *server)
return res;
}
sock_dtls_t *sock_dodtls_get_dtls_sock(void)
{
return &_dtls_sock;
}
sock_dtls_session_t *sock_dodtls_get_server_session(void)
{
return &_server_session;
}
int sock_dodtls_set_server(const sock_udp_ep_t *server,
const credman_credential_t *creds)
{