diff --git a/docs/man/nng_dialer_get.3.adoc b/docs/man/nng_dialer_get.3.adoc index e23ecd2c3..5084c1b34 100644 --- a/docs/man/nng_dialer_get.3.adoc +++ b/docs/man/nng_dialer_get.3.adoc @@ -75,7 +75,7 @@ It is acceptable to pass `NULL` for _val_ if the value in _valszp_ is zero. This can be used to determine the size of the buffer needed to receive the object. -TIP: It may be easier to use one of the typed forms of this function. +NOTE: This function is deprecated. Use one of the typed functions listed below instead. `nng_dialer_get_bool()`:: This function is for options which take a Boolean (`bool`). diff --git a/docs/man/nng_dialer_set.3.adoc b/docs/man/nng_dialer_set.3.adoc index 3363eae9a..1792db7ca 100644 --- a/docs/man/nng_dialer_set.3.adoc +++ b/docs/man/nng_dialer_set.3.adoc @@ -19,7 +19,7 @@ nng_dialer_set - set dialer option ---- #include -int nng_dialer_set(nng_dialer d, const char *opt, const void *val, +int nng_dialer_set(nng_dialer d, const char *opt, const void *val, size_t valsz); int nng_dialer_set_bool(nng_dialer d, const char *opt, bool bval); @@ -63,7 +63,7 @@ This function is untyped, and can be used to configure any arbitrary data. The _val_ pointer addresses the data to copy, and _valsz_ is the size of the objected located at _val_. -TIP: It may be easier to use one of the typed forms of this function. +NOTE: This function is deprecated. Use of the typed functions below instead. `nng_dialer_set_bool()`:: This function is for options which take a Boolean (`bool`). diff --git a/docs/man/nng_listener_set.3.adoc b/docs/man/nng_listener_set.3.adoc index 0cfd21121..9e95b1999 100644 --- a/docs/man/nng_listener_set.3.adoc +++ b/docs/man/nng_listener_set.3.adoc @@ -19,7 +19,7 @@ nng_listener_set - set listener option ---- #include -int nng_listener_set(nng_listener l, const char *opt, const void *val, +int nng_listener_set(nng_listener l, const char *opt, const void *val, size_t valsz); int nng_listener_set_bool(nng_listener l, const char *opt, bool bval); @@ -58,13 +58,13 @@ In all of these forms, the option _opt_ is configured on the listener _l_. The details of the type, size, and semantics of the option will depend on the actual option, and will be documented with the option itself. -TIP: It may be easier to use one of the typed forms of this function. - `nng_listener_set()`:: This function is untyped, and can be used to configure any arbitrary data. The _val_ pointer addresses the data to copy, and _valsz_ is the size of the objected located at _val_. +NOTE: This function is deprecated. Use one of the typed functions beelow instead. + `nng_listener_set_bool()`:: This function is for options which take a Boolean (`bool`). The _bval_ is passed to the option. diff --git a/docs/man/nng_socket_get.3.adoc b/docs/man/nng_socket_get.3.adoc index e304964ad..b59956d19 100644 --- a/docs/man/nng_socket_get.3.adoc +++ b/docs/man/nng_socket_get.3.adoc @@ -35,8 +35,6 @@ int nng_socket_get_ptr(nng_socket s, const char *opt, void **ptr); int nng_socket_get_ms(nng_socket s, const char *opt, nng_duration *durp); -int nng_socket_get_addr(nng_socket s, const char *opt, nng_sockaddr *addrp); - ---- == DESCRIPTION diff --git a/docs/man/nng_stream_dialer_get.3str.adoc b/docs/man/nng_stream_dialer_get.3str.adoc index 4023e56f4..03dbd534b 100644 --- a/docs/man/nng_stream_dialer_get.3str.adoc +++ b/docs/man/nng_stream_dialer_get.3str.adoc @@ -1,6 +1,6 @@ = nng_stream_dialer_get(3str) // -// Copyright 2020 Staysail Systems, Inc. +// Copyright 2024 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV // Copyright 2019 Devolutions // @@ -42,7 +42,7 @@ int nng_stream_dialer_get_uint64(nng_stream_dialer *d, const char *opt, uint64_t == DESCRIPTION -The `nng_stream_dialer_get()` functions are used to retrieve option values for the +The `nng_stream_dialer_get()` functions are used to retrieve option values for the xref:nng_stream_dialer.5.adoc[byte stream dialer] _d_. The actual options that may be retrieved in this way vary. @@ -76,7 +76,7 @@ It is acceptable to pass `NULL` for _val_ if the value in _sizep_ is zero. This can be used to determine the size of the buffer needed to receive the object. + -TIP: It may be easier to use one of the typed forms of this function. +NOTE: This function is deprecated. Use one of the typed functions instead. `nng_stream_dialer_get_bool()`:: This function is for options which take a Boolean (`bool`). diff --git a/docs/man/nng_stream_dialer_set.3str.adoc b/docs/man/nng_stream_dialer_set.3str.adoc index bd4ac478d..c72606d46 100644 --- a/docs/man/nng_stream_dialer_set.3str.adoc +++ b/docs/man/nng_stream_dialer_set.3str.adoc @@ -62,7 +62,8 @@ This function is untyped, and can be used to configure any arbitrary data. The _val_ pointer addresses the data to copy, and _size_ is the size of the objected located at _val_. + -TIP: It may be easier to use one of the typed forms of this function. +NOTE: This function is deprecated and will be removed in a future release. +Use one of the typed functions below instead. `nng_stream_dialer_set_bool()`:: This function is for options which take a Boolean (`bool`). @@ -130,4 +131,4 @@ xref:nng_options.5.adoc[nng_options(5)], xref:nng_ipc_options.5.adoc[nng_ipc_options(5)], xref:nng_tcp_options.5.adoc[nng_tcp_options(5)], xref:nng_tls_options.5.adoc[nng_tls_options(5)], -xref:nng_stream_dialer.5.adoc[nng_stream_dialer(5)] \ No newline at end of file +xref:nng_stream_dialer.5.adoc[nng_stream_dialer(5)] diff --git a/docs/man/nng_stream_listener_get.3str.adoc b/docs/man/nng_stream_listener_get.3str.adoc index 927e36a81..891e9f8ca 100644 --- a/docs/man/nng_stream_listener_get.3str.adoc +++ b/docs/man/nng_stream_listener_get.3str.adoc @@ -1,6 +1,6 @@ = nng_stream_listener_get(3str) // -// Copyright 2019 Staysail Systems, Inc. +// Copyright 2024 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV // Copyright 2019 Devolutions // @@ -43,7 +43,7 @@ int nng_stream_listener_get_uint64(nng_stream_listener *l, const char *opt, uint The `nng_stream_listener_get()` functions are used to retrieve option values -for the +for the xref:nng_stream_listener.5.adoc[byte stream listener] _l_. The actual options that may be retrieved in this way vary. @@ -77,7 +77,7 @@ It is acceptable to pass `NULL` for _val_ if the value in _sizep_ is zero. This can be used to determine the size of the buffer needed to receive the object. + -TIP: It may be easier to use one of the typed forms of this function. +NOTE: This function is deprecated. Use one of the typed functions below instead. `nng_stream_listener_get_bool()`:: This function is for options which take a Boolean (`bool`). diff --git a/docs/man/nng_stream_listener_set.3str.adoc b/docs/man/nng_stream_listener_set.3str.adoc index ccabe5cad..fb8708cd6 100644 --- a/docs/man/nng_stream_listener_set.3str.adoc +++ b/docs/man/nng_stream_listener_set.3str.adoc @@ -1,6 +1,6 @@ = nng_stream_listener_set(3str) // -// Copyright 2020 Staysail Systems, Inc. +// Copyright 2024 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV // Copyright 2019 Devolutions // @@ -62,7 +62,7 @@ This function is untyped, and can be used to configure any arbitrary data. The _val_ pointer addresses the data to copy, and _size_ is the size of the objected located at _val_. + -TIP: It may be easier to use one of the typed forms of this function. +NOTE: This function is deprecated. Use one of the typed forms instead. `nng_stream_listener_set_bool()`:: This function is for options which take a Boolean (`bool`). @@ -130,4 +130,4 @@ xref:nng_options.5.adoc[nng_options(5)], xref:nng_ipc_options.5.adoc[nng_ipc_options(5)], xref:nng_tcp_options.5.adoc[nng_tcp_options(5)], xref:nng_tls_options.5.adoc[nng_tls_options(5)], -xref:nng_stream_listener.5.adoc[nng_stream_listener(5)] \ No newline at end of file +xref:nng_stream_listener.5.adoc[nng_stream_listener(5)] diff --git a/docs/man/nng_stream_set.3str.adoc b/docs/man/nng_stream_set.3str.adoc index e4a82a1ac..646739569 100644 --- a/docs/man/nng_stream_set.3str.adoc +++ b/docs/man/nng_stream_set.3str.adoc @@ -1,6 +1,6 @@ = nng_stream_set(3str) // -// Copyright 2020 Staysail Systems, Inc. +// Copyright 2024 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV // Copyright 2019 Devolutions // @@ -62,7 +62,7 @@ This function is untyped, and can be used to configure any arbitrary data. The _val_ pointer addresses the data to copy, and _size_ is the size of the objected located at _val_. + -TIP: It may be easier to use one of the typed forms of this function. +NOTE: This function is deprecated. Callers should use one of the typed functions instead. `nng_stream_set_bool()`:: This function is for options which take a Boolean (`bool`). @@ -104,10 +104,8 @@ This is typically used for identifiers, network numbers, and similar options. `nng_stream_set_addr()`:: -This function is used to configure a -xref:nng_sockaddr.5.adoc[socket address]. -The value is copied, and thus the caller may discard the supplied -value immediately after this function returns. +This function performs no useful function, and will be removed in +in a future release. == RETURN VALUES @@ -130,4 +128,4 @@ xref:nng_options.5.adoc[nng_options(5)], xref:nng_ipc_options.5.adoc[nng_ipc_options(5)], xref:nng_tcp_options.5.adoc[nng_tcp_options(5)], xref:nng_tls_options.5.adoc[nng_tls_options(5)], -xref:nng_stream.5.adoc[nng_stream(5)] \ No newline at end of file +xref:nng_stream.5.adoc[nng_stream(5)] diff --git a/docs/man/nng_tls_options.5.adoc b/docs/man/nng_tls_options.5.adoc index a06a600fb..0b3463404 100644 --- a/docs/man/nng_tls_options.5.adoc +++ b/docs/man/nng_tls_options.5.adoc @@ -1,6 +1,6 @@ = nng_tls_options(5) // -// Copyright 2020 Staysail Systems, Inc. +// Copyright 2024 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV // Copyright 2019 Devolutions // @@ -47,6 +47,13 @@ description of the option. === TLS Options +NOTE: Options for configuring TLS are deprecated and may +not be present in a future release. These options are +`NNG_OPT_TLS_AUTH_MODE`, `NNG_OPT_TLS_CA_FILE`, `NNG_OPT_TLS_CERT_KEY_FILE`, +and `NNG_OPT_TLS_SERVER_NAME`. Applications should switch to using the +`NNG_OPT_TLS_CONFIG` option and working with `nng_tls_config` objects. + + [[NNG_OPT_TLS_AUTH_MODE]]((`NNG_OPT_TLS_AUTH_MODE`)):: (`int`) Write-only option used to configure the authentication mode used. @@ -76,8 +83,6 @@ configuration object before returning it. NOTE: The caller should release the hold with xref:nng_tls_config_free.3tls.adoc[`nng_tls_config_free()`] when it no longer needs the TLS configuration object. -+ -TIP: Use this option when more advanced TLS configuration is required. [[NNG_OPT_TLS_SERVER_NAME]]((`NNG_OPT_TLS_SERVER_NAME`)):: (string) diff --git a/include/nng/nng.h b/include/nng/nng.h index 0508a991b..0c3384fab 100644 --- a/include/nng/nng.h +++ b/include/nng/nng.h @@ -57,10 +57,10 @@ extern "C" { // We use SemVer, and these versions are about the API, and // may not necessarily match the ABI versions. #define NNG_MAJOR_VERSION 1 -#define NNG_MINOR_VERSION 8 -#define NNG_PATCH_VERSION 0 +#define NNG_MINOR_VERSION 9 +#define NNG_PATCH_VERSION 1 #define NNG_RELEASE_SUFFIX \ - "" // if non-empty (i.e. "pre"), this is a pre-release + "pre" // if non-empty (i.e. "pre"), this is a pre-release // Maximum length of a socket address. This includes the terminating NUL. // This limit is built into other implementations, so do not change it. @@ -468,7 +468,6 @@ NNG_DECL int nng_ctx_get_uint64(nng_ctx, const char *, uint64_t *); NNG_DECL int nng_ctx_get_string(nng_ctx, const char *, char **); NNG_DECL int nng_ctx_get_ptr(nng_ctx, const char *, void **); NNG_DECL int nng_ctx_get_ms(nng_ctx, const char *, nng_duration *); -NNG_DECL int nng_ctx_get_addr(nng_ctx, const char *, nng_sockaddr *); NNG_DECL int nng_ctx_set(nng_ctx, const char *, const void *, size_t); NNG_DECL int nng_ctx_set_bool(nng_ctx, const char *, bool); @@ -478,7 +477,6 @@ NNG_DECL int nng_ctx_set_uint64(nng_ctx, const char *, uint64_t); NNG_DECL int nng_ctx_set_string(nng_ctx, const char *, const char *); NNG_DECL int nng_ctx_set_ptr(nng_ctx, const char *, void *); NNG_DECL int nng_ctx_set_ms(nng_ctx, const char *, nng_duration); -NNG_DECL int nng_ctx_set_addr(nng_ctx, const char *, const nng_sockaddr *); // nng_alloc is used to allocate memory. It's intended purpose is for // allocating memory suitable for message buffers with nng_send(). @@ -1173,8 +1171,6 @@ NNG_DECL int nng_stream_set_size(nng_stream *, const char *, size_t); NNG_DECL int nng_stream_set_uint64(nng_stream *, const char *, uint64_t); NNG_DECL int nng_stream_set_string(nng_stream *, const char *, const char *); NNG_DECL int nng_stream_set_ptr(nng_stream *, const char *, void *); -NNG_DECL int nng_stream_set_addr( - nng_stream *, const char *, const nng_sockaddr *); NNG_DECL int nng_stream_dialer_alloc(nng_stream_dialer **, const char *); NNG_DECL int nng_stream_dialer_alloc_url( @@ -1442,6 +1438,12 @@ NNG_DECL int nng_pipe_getopt_string( // a library; it will affect all sockets. NNG_DECL void nng_closeall(void) NNG_DEPRECATED; +// THese functions are deprecated, but they really serve no useful purpose. +NNG_DECL int nng_stream_set_addr( + nng_stream *, const char *, const nng_sockaddr *) NNG_DEPRECATED; +NNG_DECL int nng_ctx_get_addr(nng_ctx, const char *, nng_sockaddr *) NNG_DEPRECATED; +NNG_DECL int nng_ctx_set_addr(nng_ctx, const char *, const nng_sockaddr *) NNG_DEPRECATED; + #endif // NNG_ELIDE_DEPRECATED // nng_init_parameter is used by applications to change a tunable setting. diff --git a/src/core/stream.c b/src/core/stream.c index 95bc41236..b70ff2bec 100644 --- a/src/core/stream.c +++ b/src/core/stream.c @@ -513,11 +513,13 @@ nng_stream_set_string(nng_stream *s, const char *n, const char *v) s, n, v, v == NULL ? 0 : strlen(v) + 1, NNI_TYPE_STRING)); } +#ifndef NNG_ELIDE_DEPRECATED int nng_stream_set_addr(nng_stream *s, const char *n, const nng_sockaddr *v) { return (nni_stream_set(s, n, v, sizeof(*v), NNI_TYPE_SOCKADDR)); } +#endif int nng_stream_dialer_set( diff --git a/src/nng.c b/src/nng.c index e95746268..b5e7430b2 100644 --- a/src/nng.c +++ b/src/nng.c @@ -468,11 +468,13 @@ nng_ctx_get_ms(nng_ctx id, const char *n, nng_duration *v) return (ctx_get(id, n, v, NULL, NNI_TYPE_DURATION)); } +#ifndef NNG_ELIDE_DEPRECATED int nng_ctx_get_addr(nng_ctx id, const char *n, nng_sockaddr *v) { return (ctx_get(id, n, v, NULL, NNI_TYPE_SOCKADDR)); } +#endif static int ctx_set(nng_ctx id, const char *n, const void *v, size_t sz, nni_type t) @@ -540,11 +542,13 @@ nng_ctx_set_string(nng_ctx id, const char *n, const char *v) ctx_set(id, n, v, v == NULL ? 0 : strlen(v) + 1, NNI_TYPE_STRING)); } +#ifndef NNG_ELIDE_DEPRECATED int nng_ctx_set_addr(nng_ctx id, const char *n, const nng_sockaddr *v) { return (ctx_set(id, n, v, sizeof(*v), NNI_TYPE_SOCKADDR)); } +#endif int nng_dial(nng_socket sid, const char *addr, nng_dialer *dp, int flags)