diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-02-25 17:13:38 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-02-25 18:39:56 -0800 |
| commit | 53a9740d1dcbad6be4b4c1a10a5f3fcbb97a5be9 (patch) | |
| tree | 00c49f3cd56f5797ec0d3f31dab689c6573fc6e6 /src/core/stream.c | |
| parent | 8e62028a0db24364ea218007811e58ea11d0b64f (diff) | |
| download | nng-53a9740d1dcbad6be4b4c1a10a5f3fcbb97a5be9.tar.gz nng-53a9740d1dcbad6be4b4c1a10a5f3fcbb97a5be9.tar.bz2 nng-53a9740d1dcbad6be4b4c1a10a5f3fcbb97a5be9.zip | |
fixes #1496 Provide NNG_ENABLE_IPV6 option (disabled by default)
This also checks if the build system has the definitions for AF_INET6, which might
help in some embedded IPv4 only settings.
The resolver test is enhanced to include a check for IPv6 enabled in the kernel.
IPv6 support is enabled by default, of course.
Diffstat (limited to 'src/core/stream.c')
| -rw-r--r-- | src/core/stream.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/core/stream.c b/src/core/stream.c index 99002fcd..95bc4123 100644 --- a/src/core/stream.c +++ b/src/core/stream.c @@ -1,5 +1,5 @@ // -// Copyright 2023 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech> // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -22,8 +22,8 @@ static struct { const char *scheme; - int (*dialer_alloc)(nng_stream_dialer **, const nng_url *); - int (*listener_alloc)(nng_stream_listener **, const nng_url *); + int (*dialer_alloc)(nng_stream_dialer **, const nng_url *); + int (*listener_alloc)(nng_stream_listener **, const nng_url *); } stream_drivers[] = { { @@ -55,11 +55,13 @@ static struct { .dialer_alloc = nni_tcp_dialer_alloc, .listener_alloc = nni_tcp_listener_alloc, }, +#ifdef NNG_ENABLE_IPV6 { .scheme = "tcp6", .dialer_alloc = nni_tcp_dialer_alloc, .listener_alloc = nni_tcp_listener_alloc, }, +#endif { .scheme = "tls+tcp", .dialer_alloc = nni_tls_dialer_alloc, @@ -70,11 +72,13 @@ static struct { .dialer_alloc = nni_tls_dialer_alloc, .listener_alloc = nni_tls_listener_alloc, }, +#ifdef NNG_ENABLE_IPV6 { .scheme = "tls+tcp6", .dialer_alloc = nni_tls_dialer_alloc, .listener_alloc = nni_tls_listener_alloc, }, +#endif { .scheme = "ws", .dialer_alloc = nni_ws_dialer_alloc, @@ -85,11 +89,13 @@ static struct { .dialer_alloc = nni_ws_dialer_alloc, .listener_alloc = nni_ws_listener_alloc, }, +#ifdef NNG_ENABLE_IPV6 { .scheme = "ws6", .dialer_alloc = nni_ws_dialer_alloc, .listener_alloc = nni_ws_listener_alloc, }, +#endif { .scheme = "wss", .dialer_alloc = nni_ws_dialer_alloc, |
