diff --git a/docs/man/nng_dialer_get.3.adoc b/docs/man/nng_dialer_get.3.adoc index 29c0341a1..9b1e65778 100644 --- a/docs/man/nng_dialer_get.3.adoc +++ b/docs/man/nng_dialer_get.3.adoc @@ -25,8 +25,6 @@ int nng_dialer_get_int(nng_dialer d, const char *opt, int *ivalp); int nng_dialer_get_ms(nng_dialer d, const char *opt, nng_duration *durp); -int nng_dialer_get_ptr(nng_dialer d, const char *opt, void **ptr); - int nng_dialer_get_size(nng_dialer d, const char *opt, size_t *zp); int nng_dialer_get_addr(nng_dialer d, const char *opt, nng_sockaddr *sap); @@ -69,12 +67,6 @@ This function is used to retrieve time xref:nng_duration.5.adoc[durations] (The special value ((`NNG_DURATION_INFINITE`)) means an infinite amount of time, and the special value ((`NNG_DURATION_DEFAULT`)) means a context-specific default.) -`nng_dialer_get_ptr()`:: -This function is used to retrieve a pointer, _ptr_, to structured data. -The data referenced by _ptr_ is generally managed using other functions. -Note that this form is somewhat special in that the object is generally -not copied, but instead the *pointer* to the object is copied. - `nng_dialer_get_size()`:: This function is used to retrieve a size into the pointer _zp_, typically for buffer sizes, message maximum sizes, and similar options. diff --git a/docs/man/nng_listener_get.3.adoc b/docs/man/nng_listener_get.3.adoc index 216a28f6d..a5df826dc 100644 --- a/docs/man/nng_listener_get.3.adoc +++ b/docs/man/nng_listener_get.3.adoc @@ -25,8 +25,6 @@ int nng_listener_get_int(nng_listener l, const char *opt, int *ivalp); int nng_listener_get_ms(nng_listener l, const char *opt, nng_duration *durp); -int nng_listener_get_ptr(nng_listener l, const char *opt, void **ptr); - int nng_listener_get_size(nng_listener l, const char *opt, size_t *zp); int nng_listener_get_addr(nng_listener l, const char *opt, nng_sockaddr *sap); @@ -67,12 +65,6 @@ The value will be stored at _ivalp_. This function is used to retrieve time xref:nng_duration.5.adoc[durations] (such as timeouts), stored in _durp_ as a number of milliseconds. -`nng_listener_get_ptr()`:: -This function is used to retrieve a pointer, _ptr_, to structured data. -The data referenced by _ptr_ is generally managed using other functions. -Note that this form is somewhat special in that the object is generally -not copied, but instead the *pointer* to the object is copied. - `nng_listener_get_size()`:: This function is used to retrieve a size into the pointer _zp_, typically for buffer sizes, message maximum sizes, and similar options. diff --git a/docs/man/nng_stream_dialer_get.3str.adoc b/docs/man/nng_stream_dialer_get.3str.adoc index 13813c1f7..aece5521b 100644 --- a/docs/man/nng_stream_dialer_get.3str.adoc +++ b/docs/man/nng_stream_dialer_get.3str.adoc @@ -26,8 +26,6 @@ int nng_stream_dialer_get_int(nng_stream_dialer *d, const char *opt, int *valp); int nng_stream_dialer_get_ms(nng_stream_dialer *d, const char *opt, nng_duration *valp); -int nng_stream_dialer_get_ptr(nng_stream_dialer *d, const char *opt, void **valp); - int nng_stream_dialer_get_size(nng_stream_dialer *d, const char *opt, size_t *valp); int nng_stream_dialer_get_addr(nng_stream_dialer *d, const char *opt, nng_sockaddr *valp); @@ -69,16 +67,6 @@ xref:nng_duration.5.adoc[durations] (The special value ((`NNG_DURATION_INFINITE`)) means an infinite amount of time, and the special value ((`NNG_DURATION_DEFAULT`)) means a context-specific default.) -`nng_stream_dialer_get_ptr()`:: -This function is used to retrieve a pointer to structured data. -The data referenced is generally managed using other functions. -Note that this form is somewhat special in that the object is generally -not copied, but instead the *pointer* to the object is copied. -+ -NOTE: Care must be taken to ensure that the application respects any -considerations about the lifetime of the underlying object. -See the documentation for the option for more specific guidance. - `nng_stream_dialer_get_size()`:: This function is used to retrieve a size, typically for buffer sizes, message maximum sizes, and similar options. diff --git a/docs/man/nng_stream_get.3str.adoc b/docs/man/nng_stream_get.3str.adoc index b0f8ee198..a7137ecbe 100644 --- a/docs/man/nng_stream_get.3str.adoc +++ b/docs/man/nng_stream_get.3str.adoc @@ -26,8 +26,6 @@ int nng_stream_get_int(nng_stream *s, const char *opt, int *valp); int nng_stream_get_ms(nng_stream *s, const char *opt, nng_duration *valp); -int nng_stream_get_ptr(nng_stream *s, const char *opt, void **valp); - int nng_stream_get_size(nng_stream *s, const char *opt, size_t *valp); int nng_stream_get_addr(nng_stream *s, const char *opt, nng_sockaddr *valp); @@ -68,16 +66,6 @@ xref:nng_duration.5.adoc[durations] (The special value ((`NNG_DURATION_INFINITE`)) means an infinite amount of time, and the special value ((`NNG_DURATION_DEFAULT`)) means a context-specific default.) -`nng_stream_get_ptr()`:: -This function is used to retrieve a pointer to structured data. -The data referenced is generally managed using other functions. -Note that this form is somewhat special in that the object is generally -not copied, but instead the *pointer* to the object is copied. -+ -NOTE: Care must be taken to ensure that the application respects any -considerations about the lifetime of the underyling object. -See the documentation for the option for more specific guidance. - `nng_stream_get_size()`:: This function is used to retrieve a size, typically for buffer sizes, message maximum sizes, and similar options. diff --git a/docs/man/nng_stream_listener_get.3str.adoc b/docs/man/nng_stream_listener_get.3str.adoc index 77c8e4b1e..3aeec8575 100644 --- a/docs/man/nng_stream_listener_get.3str.adoc +++ b/docs/man/nng_stream_listener_get.3str.adoc @@ -26,8 +26,6 @@ int nng_stream_listener_get_int(nng_stream_listener *l, const char *opt, int *va int nng_stream_listener_get_ms(nng_stream_listener *l, const char *opt, nng_duration *valp); -int nng_stream_listener_get_ptr(nng_stream_listener *l, const char *opt, void **valp); - int nng_stream_listener_get_size(nng_stream_listener *l, const char *opt, size_t *valp); int nng_stream_listener_get_addr(nng_stream_listener *l, const char *opt, nng_sockaddr *valp); @@ -70,16 +68,6 @@ xref:nng_duration.5.adoc[durations] (The special value ((`NNG_DURATION_INFINITE`)) means an infinite amount of time, and the special value ((`NNG_DURATION_DEFAULT`)) means a context-specific default.) -`nng_stream_listener_get_ptr()`:: -This function is used to retrieve a pointer to structured data. -The data referenced is generally managed using other functions. -Note that this form is somewhat special in that the object is generally -not copied, but instead the *pointer* to the object is copied. -+ -NOTE: Care must be taken to ensure that the application respects any -considerations about the lifetime of the underyling object. -See the documentation for the option for more specific guidance. - `nng_stream_listener_get_size()`:: This function is used to retrieve a size, typically for buffer sizes, message maximum sizes, and similar options. diff --git a/docs/ref/migrate/nng1.md b/docs/ref/migrate/nng1.md index 54e89e8e5..bff5b5815 100644 --- a/docs/ref/migrate/nng1.md +++ b/docs/ref/migrate/nng1.md @@ -92,14 +92,19 @@ and are thus removed: - `nng_ctx_get_string` - `nng_ctx_set_string` +- `nng_dialer_get_ptr` - `nng_dialer_set_ptr` +- `nng_listener_get_ptr` - `nng_listener_set_ptr` - `nng_socket_get_ptr` - `nng_socket_set_ptr` - `nng_socket_get_string` - `nng_socket_set_string` +- `nng_stream_get_ptr` - `nng_stream_set_ptr` +- `nng_stream_dialer_get_ptr` - `nng_stream_dialer_set_ptr` +- `nng_stream_listener_get_ptr` - `nng_stream_listener_set_ptr` - `nng_ctx_get_ptr` (not documented) - `nng_ctx_set_ptr` (not documented) diff --git a/include/nng/nng.h b/include/nng/nng.h index 78b570ec5..1061a00b4 100644 --- a/include/nng/nng.h +++ b/include/nng/nng.h @@ -361,7 +361,6 @@ NNG_DECL int nng_dialer_get_int(nng_dialer, const char *, int *); NNG_DECL int nng_dialer_get_size(nng_dialer, const char *, size_t *); NNG_DECL int nng_dialer_get_uint64(nng_dialer, const char *, uint64_t *); NNG_DECL int nng_dialer_get_string(nng_dialer, const char *, char **); -NNG_DECL int nng_dialer_get_ptr(nng_dialer, const char *, void **); NNG_DECL int nng_dialer_get_ms(nng_dialer, const char *, nng_duration *); NNG_DECL int nng_dialer_get_addr(nng_dialer, const char *, nng_sockaddr *); NNG_DECL int nng_dialer_get_tls(nng_dialer, nng_tls_config **); @@ -384,7 +383,6 @@ NNG_DECL int nng_listener_get_int(nng_listener, const char *, int *); NNG_DECL int nng_listener_get_size(nng_listener, const char *, size_t *); NNG_DECL int nng_listener_get_uint64(nng_listener, const char *, uint64_t *); NNG_DECL int nng_listener_get_string(nng_listener, const char *, char **); -NNG_DECL int nng_listener_get_ptr(nng_listener, const char *, void **); NNG_DECL int nng_listener_get_ms(nng_listener, const char *, nng_duration *); NNG_DECL int nng_listener_get_addr(nng_listener, const char *, nng_sockaddr *); NNG_DECL int nng_listener_get_tls(nng_listener, nng_tls_config **); @@ -705,7 +703,6 @@ NNG_DECL int nng_pipe_get_ms(nng_pipe, const char *, nng_duration *); NNG_DECL int nng_pipe_get_size(nng_pipe, const char *, size_t *); NNG_DECL int nng_pipe_get_uint64(nng_pipe, const char *, uint64_t *); NNG_DECL int nng_pipe_get_string(nng_pipe, const char *, char **); -NNG_DECL int nng_pipe_get_ptr(nng_pipe, const char *, void **); NNG_DECL int nng_pipe_get_addr(nng_pipe, const char *, nng_sockaddr *); NNG_DECL int nng_pipe_close(nng_pipe); @@ -1140,7 +1137,6 @@ NNG_DECL int nng_stream_get_ms(nng_stream *, const char *, nng_duration *); NNG_DECL int nng_stream_get_size(nng_stream *, const char *, size_t *); NNG_DECL int nng_stream_get_uint64(nng_stream *, const char *, uint64_t *); NNG_DECL int nng_stream_get_string(nng_stream *, const char *, char **); -NNG_DECL int nng_stream_get_ptr(nng_stream *, const char *, void **); NNG_DECL int nng_stream_get_addr(nng_stream *, const char *, nng_sockaddr *); NNG_DECL int nng_stream_dialer_alloc(nng_stream_dialer **, const char *); @@ -1161,8 +1157,6 @@ NNG_DECL int nng_stream_dialer_get_uint64( nng_stream_dialer *, const char *, uint64_t *); NNG_DECL int nng_stream_dialer_get_string( nng_stream_dialer *, const char *, char **); -NNG_DECL int nng_stream_dialer_get_ptr( - nng_stream_dialer *, const char *, void **); NNG_DECL int nng_stream_dialer_get_addr( nng_stream_dialer *, const char *, nng_sockaddr *); NNG_DECL int nng_stream_dialer_set_bool( @@ -1205,8 +1199,6 @@ NNG_DECL int nng_stream_listener_get_uint64( nng_stream_listener *, const char *, uint64_t *); NNG_DECL int nng_stream_listener_get_string( nng_stream_listener *, const char *, char **); -NNG_DECL int nng_stream_listener_get_ptr( - nng_stream_listener *, const char *, void **); NNG_DECL int nng_stream_listener_get_addr( nng_stream_listener *, const char *, nng_sockaddr *); NNG_DECL int nng_stream_listener_set_bool( diff --git a/src/core/defs.h b/src/core/defs.h index 46a32ef59..979c03000 100644 --- a/src/core/defs.h +++ b/src/core/defs.h @@ -189,14 +189,11 @@ typedef enum { NNI_TYPE_NONE, // DO NOT USE NNI_TYPE_BOOL, NNI_TYPE_INT32, - NNI_TYPE_UINT32, - NNI_TYPE_INT64, NNI_TYPE_UINT64, NNI_TYPE_SIZE, NNI_TYPE_DURATION, NNI_TYPE_STRING, NNI_TYPE_SOCKADDR, - NNI_TYPE_POINTER, } nni_type; typedef nni_type nni_opt_type; diff --git a/src/core/options.c b/src/core/options.c index fabd55fa6..1540a807f 100644 --- a/src/core/options.c +++ b/src/core/options.c @@ -88,19 +88,6 @@ nni_copyin_size( return (0); } -int -nni_copyin_ptr(void **pp, const void *v, size_t sz, nni_type t) -{ - NNI_ARG_UNUSED(sz); - - if (t != NNI_TYPE_POINTER) { - return (NNG_EBADTYPE); - } - - *pp = *(void **) v; - return (0); -} - int nni_copyin_str(char *s, const void *v, size_t maxsz, nni_type t) { @@ -173,17 +160,6 @@ nni_copyout_ms(nng_duration d, void *dst, size_t *szp, nni_type t) return (0); } -int -nni_copyout_ptr(void *p, void *dst, size_t *szp, nni_type t) -{ - NNI_ARG_UNUSED(szp); - if (t != NNI_TYPE_POINTER) { - return (NNG_EBADTYPE); - } - *(void **) dst = p; - return (0); -} - int nni_copyout_size(size_t s, void *dst, size_t *szp, nni_type t) { diff --git a/src/core/stream.c b/src/core/stream.c index cc7ac4962..ad0265866 100644 --- a/src/core/stream.c +++ b/src/core/stream.c @@ -346,12 +346,6 @@ nng_stream_get_string(nng_stream *s, const char *n, char **v) return (nni_stream_get(s, n, v, NULL, NNI_TYPE_STRING)); } -int -nng_stream_get_ptr(nng_stream *s, const char *n, void **v) -{ - return (nni_stream_get(s, n, v, NULL, NNI_TYPE_POINTER)); -} - int nng_stream_get_ms(nng_stream *s, const char *n, nng_duration *v) { @@ -394,12 +388,6 @@ nng_stream_dialer_get_string(nng_stream_dialer *d, const char *n, char **v) return (nni_stream_dialer_get(d, n, v, NULL, NNI_TYPE_STRING)); } -int -nng_stream_dialer_get_ptr(nng_stream_dialer *d, const char *n, void **v) -{ - return (nni_stream_dialer_get(d, n, v, NULL, NNI_TYPE_POINTER)); -} - int nng_stream_dialer_get_ms(nng_stream_dialer *d, const char *n, nng_duration *v) { @@ -450,12 +438,6 @@ nng_stream_listener_get_string(nng_stream_listener *l, const char *n, char **v) return (nni_stream_listener_get(l, n, v, NULL, NNI_TYPE_STRING)); } -int -nng_stream_listener_get_ptr(nng_stream_listener *l, const char *n, void **v) -{ - return (nni_stream_listener_get(l, n, v, NULL, NNI_TYPE_POINTER)); -} - int nng_stream_listener_get_ms( nng_stream_listener *l, const char *n, nng_duration *v) diff --git a/src/nng.c b/src/nng.c index 51700bb46..473f394a7 100644 --- a/src/nng.c +++ b/src/nng.c @@ -820,12 +820,6 @@ nng_dialer_get_string(nng_dialer id, const char *n, char **v) return (dialer_get(id, n, v, NULL, NNI_TYPE_STRING)); } -int -nng_dialer_get_ptr(nng_dialer id, const char *n, void **v) -{ - return (dialer_get(id, n, v, NULL, NNI_TYPE_POINTER)); -} - int nng_dialer_get_ms(nng_dialer id, const char *n, nng_duration *v) { @@ -967,12 +961,6 @@ nng_listener_get_string(nng_listener id, const char *n, char **v) return (listener_get(id, n, v, NULL, NNI_TYPE_STRING)); } -int -nng_listener_get_ptr(nng_listener id, const char *n, void **v) -{ - return (listener_get(id, n, v, NULL, NNI_TYPE_POINTER)); -} - int nng_listener_get_ms(nng_listener id, const char *n, nng_duration *v) { @@ -1444,12 +1432,6 @@ nng_pipe_get_string(nng_pipe id, const char *n, char **v) return (pipe_get(id, n, v, NULL, NNI_TYPE_STRING)); } -int -nng_pipe_get_ptr(nng_pipe id, const char *n, void **v) -{ - return (pipe_get(id, n, v, NULL, NNI_TYPE_POINTER)); -} - int nng_pipe_get_ms(nng_pipe id, const char *n, nng_duration *v) { diff --git a/src/supplemental/tls/tls_common.c b/src/supplemental/tls/tls_common.c index c3c4d3c35..c04d03a56 100644 --- a/src/supplemental/tls/tls_common.c +++ b/src/supplemental/tls/tls_common.c @@ -554,22 +554,6 @@ tls_get_peer_cn(void *arg, void *buf, size_t *szp, nni_type t) return (0); } -static int -tls_get_peer_alt_names(void *arg, void *buf, size_t *szp, nni_type t) -{ - NNI_ARG_UNUSED(szp); - - if (t != NNI_TYPE_POINTER) { - return (NNG_EBADTYPE); - } - - tls_conn *conn = arg; - nni_mtx_lock(&conn->lock); - *(char ***) buf = conn->ops.peer_alt_names((void *) (conn + 1)); - nni_mtx_unlock(&conn->lock); - return (0); -} - static const nni_option tls_options[] = { { .o_name = NNG_OPT_TLS_VERIFIED, @@ -579,10 +563,6 @@ static const nni_option tls_options[] = { .o_name = NNG_OPT_TLS_PEER_CN, .o_get = tls_get_peer_cn, }, - { - .o_name = NNG_OPT_TLS_PEER_ALT_NAMES, - .o_get = tls_get_peer_alt_names, - }, { .o_name = NULL, },