diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-12-28 21:07:58 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-12-29 14:22:06 -0800 |
| commit | d3bd35ab49ad74528fd9e34cce9016d74dd91943 (patch) | |
| tree | 596459970f49a340f5e292f7bdb4060f4ea2be81 /src/core/transport.h | |
| parent | 02e90dd4f29037e43f28e3bd1e912d4092011d23 (diff) | |
| download | nng-d3bd35ab49ad74528fd9e34cce9016d74dd91943.tar.gz nng-d3bd35ab49ad74528fd9e34cce9016d74dd91943.tar.bz2 nng-d3bd35ab49ad74528fd9e34cce9016d74dd91943.zip | |
fixes #831 Unify option structures, o_type is unused
Diffstat (limited to 'src/core/transport.h')
| -rw-r--r-- | src/core/transport.h | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/src/core/transport.h b/src/core/transport.h index 8e5bba48..1736f8ea 100644 --- a/src/core/transport.h +++ b/src/core/transport.h @@ -11,6 +11,8 @@ #ifndef CORE_TRANSPORT_H #define CORE_TRANSPORT_H +#include "core/options.h" + // We quite intentionally use a signature where the upper word is nonzero, // which ensures that if we get garbage we will reject it. This is more // likely to mismatch than all zero bytes would. The actual version is @@ -27,28 +29,6 @@ #define NNI_TRANSPORT_V5 0x54520005 #define NNI_TRANSPORT_VERSION NNI_TRANSPORT_V5 -// Option handlers. -struct nni_tran_option { - // o_name is the name of the option. - const char *o_name; - - // o_type is the type of the option. - nni_opt_type o_type; - - // o_get retrieves the value of the option. The first argument is the - // dialer, listener, or pipe where the request is being made. - int (*o_get)(void *, void *, size_t *, nni_opt_type); - - // o_set sets the value of the option. The first argument is the - // dialer, listener, or pipe where the request is being made. - int (*o_set)(void *, const void *, size_t, nni_opt_type); - - // o_chk checks to see if the proposed value is legal -- this is - // checks only the type, size, and generic range validation. This - // function can be called before any transport objects are created. - int (*o_chk)(const void *, size_t, nni_opt_type); -}; - // Endpoint operations are called by the socket in a // protocol-independent fashion. The socket makes individual calls, // which are expected to block if appropriate (except for destroy), or @@ -81,7 +61,7 @@ struct nni_tran_dialer_ops { // d_options is an array of dialer options. The final // element must have a NULL name. If this member is NULL, then // no dialer specific options are available. - nni_tran_option *d_options; + nni_option *d_options; }; struct nni_tran_listener_ops { @@ -111,7 +91,7 @@ struct nni_tran_listener_ops { // l_options is an array of listener options. The final // element must have a NULL name. If this member is NULL, then // no dialer specific options are available. - nni_tran_option *l_options; + nni_option *l_options; }; // Pipe operations are entry points called by the socket. These may be @@ -160,7 +140,7 @@ struct nni_tran_pipe_ops { // p_options is an array of pipe options. The final element // must have a NULL name. If this member is NULL, then no // transport specific options are available. - nni_tran_option *p_options; + nni_option *p_options; }; // Transport implementation details. Transports must implement the |
