aboutsummaryrefslogtreecommitdiff
path: root/src/core/protocol.h
diff options
context:
space:
mode:
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 */