diff options
| author | Garrett D'Amore <garrett@damore.org> | 2025-04-26 18:25:48 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2025-04-27 10:53:52 -0700 |
| commit | e7977ae777ac62928041e2a07f6eddc69eb4fc40 (patch) | |
| tree | 823feb4f4661f98d3dab082961e305c3b9f9206e /src/platform | |
| parent | 527a07c6b632f6991102d4fd08ac1f5f962ddfdf (diff) | |
| download | nng-e7977ae777ac62928041e2a07f6eddc69eb4fc40.tar.gz nng-e7977ae777ac62928041e2a07f6eddc69eb4fc40.tar.bz2 nng-e7977ae777ac62928041e2a07f6eddc69eb4fc40.zip | |
TLS: break up the TLS layer a bit to refactor for DTLS.
This allows us to break the assumption that the bottom half is
TCP, or even an nng_stream, since the DTLS layer will use a totally
different layer. Only nng_stream neeeds to support dial and listen.
Also: UDP: Make the sockaddr arguments to open const.
Also: Align the IPv6 address in the sockaddr (this allows for
efficient 64-bit or even 128-bit operations on these values.)
Diffstat (limited to 'src/platform')
| -rw-r--r-- | src/platform/posix/posix_udp.c | 2 | ||||
| -rw-r--r-- | src/platform/windows/win_udp.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/platform/posix/posix_udp.c b/src/platform/posix/posix_udp.c index a1601874..14bb6c22 100644 --- a/src/platform/posix/posix_udp.c +++ b/src/platform/posix/posix_udp.c @@ -308,7 +308,7 @@ nni_posix_udp_cb(void *arg, unsigned events) } int -nni_plat_udp_open(nni_plat_udp **upp, nni_sockaddr *bindaddr) +nni_plat_udp_open(nni_plat_udp **upp, const nni_sockaddr *bindaddr) { nni_plat_udp *udp; int salen; diff --git a/src/platform/windows/win_udp.c b/src/platform/windows/win_udp.c index a280e116..0ff3ca1c 100644 --- a/src/platform/windows/win_udp.c +++ b/src/platform/windows/win_udp.c @@ -1,5 +1,5 @@ // -// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2025 Staysail Systems, Inc. <info@staysail.tech> // Copyright 2018 Capitar IT Group BV <info@capitar.com> // // This software is supplied under the terms of the MIT License, a @@ -36,7 +36,7 @@ static void udp_recv_start(nni_plat_udp *); // nni_plat_udp_open initializes a UDP socket, binding to the local // address specified specified. int -nni_plat_udp_open(nni_plat_udp **udpp, nni_sockaddr *sa) +nni_plat_udp_open(nni_plat_udp **udpp, const nni_sockaddr *sa) { nni_plat_udp *u; SOCKADDR_STORAGE ss; |
