aboutsummaryrefslogtreecommitdiff
path: root/src/core/protocol.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2016-12-14 10:55:01 -0800
committerGarrett D'Amore <garrett@damore.org>2016-12-14 10:55:01 -0800
commit58c24226e1d688a4eb0d5c3e041d0ee12152c045 (patch)
treee03e5c5912d7f53edf8663de7393fe07028fd70f /src/core/protocol.h
parente0543fecaeb01ccdf7512004c54cd72b143b67c8 (diff)
downloadnng-58c24226e1d688a4eb0d5c3e041d0ee12152c045.tar.gz
nng-58c24226e1d688a4eb0d5c3e041d0ee12152c045.tar.bz2
nng-58c24226e1d688a4eb0d5c3e041d0ee12152c045.zip
nn_socket_create() implemented.
Diffstat (limited to 'src/core/protocol.h')
-rw-r--r--src/core/protocol.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/protocol.h b/src/core/protocol.h
index a6000863..d7396456 100644
--- a/src/core/protocol.h
+++ b/src/core/protocol.h
@@ -47,6 +47,7 @@ struct nni_protocol {
*/
uint16_t proto_self; /* our 16-bit protocol ID */
uint16_t proto_peer; /* who we peer with (protocol ID) */
+ const char *proto_name; /* string version of our name */
/*
* Create protocol instance data, which will be stored on the socket.
@@ -136,4 +137,12 @@ extern int nni_pipe_send(nng_pipe_t, nng_msg_t);
extern uint32_t nni_pipe_id(nng_pipe_t);
extern void nni_pipe_close(nng_pipe_t);
+/*
+ * These functions are not used by protocols, but rather by the socket
+ * core implementation. The lookups can be used by transports as well.
+ */
+extern struct nni_protocol *nni_protocol_find(uint16_t);
+extern const char *nni_protocol_name(uint16_t);
+extern uint16_t nni_protocol_number(const char *);
+
#endif /* CORE_PROTOCOL_H */