sock/dtls: remove sock_dtls_session_create
due to deprecation
This commit is contained in:
parent
c191f3b1a7
commit
126d363cea
@ -918,50 +918,6 @@ static inline ssize_t sock_dtls_send(sock_dtls_t *sock,
|
||||
*/
|
||||
void sock_dtls_close(sock_dtls_t *sock);
|
||||
|
||||
/**
|
||||
* @brief Creates a new DTLS session
|
||||
*
|
||||
* Initiates a handshake with a DTLS server at @p ep and wait until it
|
||||
* completes or timed out.
|
||||
*
|
||||
* @deprecated Will not be available after the 2020.10 release.
|
||||
* Please use @ref sock_dtls_session_init() and
|
||||
* @ref sock_dtls_recv() instead.
|
||||
*
|
||||
* @param[in] sock DLTS sock to use
|
||||
* @param[in] ep Remote endpoint of the session
|
||||
* @param[out] remote The created session, cannot be NULL
|
||||
* @param[in] timeout Timeout to wait for handshake to finish.
|
||||
* Returns immediately if 0.
|
||||
* May be SOCK_NO_TIMEOUT to wait indefinitely until
|
||||
* handshake complete.
|
||||
*
|
||||
* @return 0 on success
|
||||
* @return -ENOMEM, if no memory to allocate for new peer
|
||||
* @return -EADDRNOTAVAIL, if the local endpoint of @p sock is not set.
|
||||
* @return -EINVAL, if @p remote is invalid or @p sock is not properly
|
||||
* initialized (or closed while sock_udp_recv() blocks).
|
||||
*/
|
||||
static inline int sock_dtls_session_create(sock_dtls_t *sock,
|
||||
const sock_udp_ep_t *ep,
|
||||
sock_dtls_session_t *remote,
|
||||
unsigned timeout)
|
||||
{
|
||||
int res;
|
||||
uint8_t buf[DTLS_HANDSHAKE_BUFSIZE];
|
||||
|
||||
assert(sock);
|
||||
assert(remote);
|
||||
|
||||
res = sock_dtls_session_init(sock, ep, remote);
|
||||
if (res <= 0) {
|
||||
return res;
|
||||
}
|
||||
|
||||
res = sock_dtls_recv(sock, remote, buf, sizeof(buf), timeout);
|
||||
return res == -SOCK_DTLS_HANDSHAKE ? 0 : res;
|
||||
}
|
||||
|
||||
#include "sock_dtls_types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user