aboutsummaryrefslogtreecommitdiff
path: root/src/core/transport.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2020-11-15 17:47:54 -0800
committerGarrett D'Amore <garrett@damore.org>2020-11-15 17:47:54 -0800
commit249932f3a208260f6b9c99d778b22d51cfabe87b (patch)
tree4fd4826127e9c225d5232c39d4ae1db89b539689 /src/core/transport.h
parenteb328da56c3fc7167b536dcb206df0abb0f4a9b9 (diff)
downloadnng-249932f3a208260f6b9c99d778b22d51cfabe87b.tar.gz
nng-249932f3a208260f6b9c99d778b22d51cfabe87b.tar.bz2
nng-249932f3a208260f6b9c99d778b22d51cfabe87b.zip
fixes #1071 tran_chkopt can be cleaned up
This is a sweeping cleanup of the transport logic around options, and also harmonizes the names used when setting or getting options. Additionally, legacy methods are now moved into a separate file and can be elided via CMake or a preprocessor define. Fundamentally, the ability to set to transport options via the socket is deprecated; there are numerous problems with this and my earlier approaches to deal with this have been somewhat misguided. Further these approaches will not work with future protocol work that is planned (were some options need to be negotiated with peers at the time of connection establishment.) Documentation has been updated to reflect this. The test suites still make rather broad use of the older APIs, and will be converted later.
Diffstat (limited to 'src/core/transport.h')
-rw-r--r--src/core/transport.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/core/transport.h b/src/core/transport.h
index 84d9c1d9..b2da2c7a 100644
--- a/src/core/transport.h
+++ b/src/core/transport.h
@@ -1,5 +1,5 @@
//
-// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2020 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2018 Capitar IT Group BV <info@capitar.com>
// Copyright 2018 Devolutions <info@devolutions.net>
//
@@ -29,7 +29,8 @@
#define NNI_TRANSPORT_V4 0x54520004
#define NNI_TRANSPORT_V5 0x54520005
#define NNI_TRANSPORT_V6 0x54220006
-#define NNI_TRANSPORT_VERSION NNI_TRANSPORT_V6
+#define NNI_TRANSPORT_V7 0x54220006
+#define NNI_TRANSPORT_VERSION NNI_TRANSPORT_V7
// Endpoint operations are called by the socket in a
// protocol-independent fashion. The socket makes individual calls,
@@ -183,18 +184,11 @@ struct nni_tran {
// tran_fini, if not NULL, is called during library deinitialization.
// It should release any global resources, close any open files, etc.
void (*tran_fini)(void);
-
- // tran_chkopt is used to check option validity; this is used as
- // an initial filter on the data, without actually setting anything.
- // This can be useful, for example, before any transports are
- // configured on the socket.
- int (*tran_checkopt)(const char *, const void *, size_t, nni_type);
};
// These APIs are used by the framework internally, and not for use by
// transport implementations.
extern nni_tran *nni_tran_find(nni_url *);
-extern int nni_tran_chkopt(const char *, const void *, size_t, int);
extern int nni_tran_sys_init(void);
extern void nni_tran_sys_fini(void);
extern int nni_tran_register(const nni_tran *);