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. --- include/nng/nng.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/nng/nng.h b/include/nng/nng.h index 32605e3c..b3f9e461 100644 --- a/include/nng/nng.h +++ b/include/nng/nng.h @@ -1241,7 +1241,14 @@ typedef struct nng_udp nng_udp; // to the specified address. NNG_DECL int nng_udp_open(nng_udp **udpp, nng_sockaddr *sa); -// nng_udp_close closes the underlying UDP socket. +// nng_udp_stop stops the UDP socket from transferring data, before closing it. +// This may be useful if data flows need to be stopped but freeing the +// structure must be done at a later time. Note that this may wait for I/O to +// be canceled. +NNG_DECL void nng_udp_stop(nng_udp *udp); + +// nng_udp_close closes the underlying UDP socket and frees the associated +// resources. Calls nng_udp_stop implicitly. NNG_DECL void nng_udp_close(nng_udp *udp); // nng_udp_sockname determines the locally bound address. -- cgit v1.2.3-70-g09d2