aboutsummaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-08-17 11:49:16 -0700
committerGarrett D'Amore <garrett@damore.org>2017-08-17 11:49:16 -0700
commit76c1fc80c931b086493835d037245ebbb5f8d406 (patch)
treee33b7765f755f7497eff26a9458c09ebe1da94ff /src/transport
parenta9633313ec8e578c805cd53b37ba3360d83157bc (diff)
downloadnng-76c1fc80c931b086493835d037245ebbb5f8d406.tar.gz
nng-76c1fc80c931b086493835d037245ebbb5f8d406.tar.bz2
nng-76c1fc80c931b086493835d037245ebbb5f8d406.zip
fixes #39 Transport ops vector should be versioned
This also includes tests for some of the edge cases surrounding pluggable transports, such as version mismatch, duplication registration, and failure to initialize.
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/inproc/inproc.c11
-rw-r--r--src/transport/ipc/ipc.c11
-rw-r--r--src/transport/tcp/tcp.c11
3 files changed, 18 insertions, 15 deletions
diff --git a/src/transport/inproc/inproc.c b/src/transport/inproc/inproc.c
index 08cf99a2..5b443d63 100644
--- a/src/transport/inproc/inproc.c
+++ b/src/transport/inproc/inproc.c
@@ -522,9 +522,10 @@ static nni_tran_ep nni_inproc_ep_ops = {
// This is the inproc transport linkage, and should be the only global
// symbol in this entire file.
struct nni_tran nni_inproc_tran = {
- .tran_scheme = "inproc",
- .tran_ep = &nni_inproc_ep_ops,
- .tran_pipe = &nni_inproc_pipe_ops,
- .tran_init = nni_inproc_init,
- .tran_fini = nni_inproc_fini,
+ .tran_version = NNI_TRANSPORT_VERSION,
+ .tran_scheme = "inproc",
+ .tran_ep = &nni_inproc_ep_ops,
+ .tran_pipe = &nni_inproc_pipe_ops,
+ .tran_init = nni_inproc_init,
+ .tran_fini = nni_inproc_fini,
};
diff --git a/src/transport/ipc/ipc.c b/src/transport/ipc/ipc.c
index 0b0e487f..d421d57a 100644
--- a/src/transport/ipc/ipc.c
+++ b/src/transport/ipc/ipc.c
@@ -673,9 +673,10 @@ static nni_tran_ep nni_ipc_ep_ops = {
// This is the IPC transport linkage, and should be the only global
// symbol in this entire file.
struct nni_tran nni_ipc_tran = {
- .tran_scheme = "ipc",
- .tran_ep = &nni_ipc_ep_ops,
- .tran_pipe = &nni_ipc_pipe_ops,
- .tran_init = nni_ipc_tran_init,
- .tran_fini = nni_ipc_tran_fini,
+ .tran_version = NNI_TRANSPORT_VERSION,
+ .tran_scheme = "ipc",
+ .tran_ep = &nni_ipc_ep_ops,
+ .tran_pipe = &nni_ipc_pipe_ops,
+ .tran_init = nni_ipc_tran_init,
+ .tran_fini = nni_ipc_tran_fini,
};
diff --git a/src/transport/tcp/tcp.c b/src/transport/tcp/tcp.c
index b3136b35..035ced62 100644
--- a/src/transport/tcp/tcp.c
+++ b/src/transport/tcp/tcp.c
@@ -737,9 +737,10 @@ static nni_tran_ep nni_tcp_ep_ops = {
// This is the TCP transport linkage, and should be the only global
// symbol in this entire file.
struct nni_tran nni_tcp_tran = {
- .tran_scheme = "tcp",
- .tran_ep = &nni_tcp_ep_ops,
- .tran_pipe = &nni_tcp_pipe_ops,
- .tran_init = nni_tcp_tran_init,
- .tran_fini = nni_tcp_tran_fini,
+ .tran_version = NNI_TRANSPORT_VERSION,
+ .tran_scheme = "tcp",
+ .tran_ep = &nni_tcp_ep_ops,
+ .tran_pipe = &nni_tcp_pipe_ops,
+ .tran_init = nni_tcp_tran_init,
+ .tran_fini = nni_tcp_tran_fini,
};