From 8bcb82d245a5fce1bd519e2f99250dedf11e763d Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 27 Apr 2025 18:40:40 -0700 Subject: Introduce DTLS transport for NNG. This introduces a new experimental transport for DTLS, that provides encryption over UDP. It has a simpler protocol than the current UDP SP protocol (but we intend to fix that by making the UDP transport simpler in a follow up!) There are a few other fixes in the TLS layer itself, and in the build, that were needed to accomplish this work. Also there was an endianness bug in the UDP protocol handling, which is fixed here. --- src/sp/transport/socket/sockfd.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/sp/transport/socket/sockfd.c') diff --git a/src/sp/transport/socket/sockfd.c b/src/sp/transport/socket/sockfd.c index 37debc85..57693088 100644 --- a/src/sp/transport/socket/sockfd.c +++ b/src/sp/transport/socket/sockfd.c @@ -807,8 +807,14 @@ sfd_tran_ep_accept(void *arg, nni_aio *aio) nni_mtx_unlock(&ep->mtx); } +static size_t +sfd_tran_pipe_size(void) +{ + return (sizeof(sfd_tran_pipe)); +} + static nni_sp_pipe_ops sfd_tran_pipe_ops = { - .p_size = sizeof(sfd_tran_pipe), + .p_size = sfd_tran_pipe_size, .p_init = sfd_tran_pipe_init, .p_fini = sfd_tran_pipe_fini, .p_stop = sfd_tran_pipe_stop, -- cgit v1.2.3-70-g09d2