aboutsummaryrefslogtreecommitdiff
path: root/src/core/transport.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-12-29 16:16:57 -0800
committerGarrett D'Amore <garrett@damore.org>2018-12-29 16:16:57 -0800
commit5b35daaf2fe6c6fbe0b15740efbffe16ff278e6c (patch)
tree24c383103cc3ff3e98e2e8179d0633e9b2f6010a /src/core/transport.h
parentd3bd35ab49ad74528fd9e34cce9016d74dd91943 (diff)
downloadnng-5b35daaf2fe6c6fbe0b15740efbffe16ff278e6c.tar.gz
nng-5b35daaf2fe6c6fbe0b15740efbffe16ff278e6c.tar.bz2
nng-5b35daaf2fe6c6fbe0b15740efbffe16ff278e6c.zip
IPC option rework (pipe/conn) to reduce code duplication.
Diffstat (limited to 'src/core/transport.h')
-rw-r--r--src/core/transport.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/core/transport.h b/src/core/transport.h
index 1736f8ea..338b3f67 100644
--- a/src/core/transport.h
+++ b/src/core/transport.h
@@ -27,7 +27,8 @@
#define NNI_TRANSPORT_V3 0x54520003
#define NNI_TRANSPORT_V4 0x54520004
#define NNI_TRANSPORT_V5 0x54520005
-#define NNI_TRANSPORT_VERSION NNI_TRANSPORT_V5
+#define NNI_TRANSPORT_V6 0x54220006
+#define NNI_TRANSPORT_VERSION NNI_TRANSPORT_V6
// Endpoint operations are called by the socket in a
// protocol-independent fashion. The socket makes individual calls,
@@ -58,6 +59,12 @@ struct nni_tran_dialer_ops {
// nonblocking.
void (*d_close)(void *);
+ // d_getopt is used to obtain an option.
+ int (*d_getopt)(void *, const char *, void *, size_t *, nni_type);
+
+ // d_setopt is used to set or change an option.
+ int (*d_setopt)(void *, const char *, const void *, size_t, nni_type);
+
// 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.
@@ -88,6 +95,12 @@ struct nni_tran_listener_ops {
// nonblocking.
void (*l_close)(void *);
+ // l_getopt is used to obtain an option.
+ int (*l_getopt)(void *, const char *, void *, size_t *, nni_type);
+
+ // l_setopt is used to set or change an option.
+ int (*l_setopt)(void *, const char *, const void *, size_t, nni_type);
+
// 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.
@@ -137,6 +150,10 @@ struct nni_tran_pipe_ops {
// whatever transport specific manner is appropriate.
uint16_t (*p_peer)(void *);
+ // p_getopt is used to obtain an option. Pipes don't implement
+ // option setting.
+ int (*p_getopt)(void *, const char *, void *, size_t *, nni_type);
+
// 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.