From 68e2aea44d766c6dbe438642d2591875602c78b4 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 21 Jan 2017 20:16:02 -0800 Subject: Added protocol flags (which ones can send, and which can receive). --- src/core/protocol.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/core/protocol.h') diff --git a/src/core/protocol.h b/src/core/protocol.h index 11c4c304..82ebd88f 100644 --- a/src/core/protocol.h +++ b/src/core/protocol.h @@ -92,10 +92,18 @@ struct nni_proto { uint16_t proto_self; // our 16-bit D uint16_t proto_peer; // who we peer with (ID) const char * proto_name; // Our name + uint16_t proto_flags; // Protocol flags const nni_proto_sock_ops * proto_sock_ops; // Per-socket opeations const nni_proto_pipe_ops * proto_pipe_ops; // Per-pipe operations. }; +// These flags determine which operations make sense. We use them so that +// we can reject attempts to create notification fds for operations that make +// no sense. +#define NNI_PROTO_FLAG_RECV 1 // Protocol can receive +#define NNI_PROTO_FLAG_SEND 2 // Protocol can send +#define NNI_PROTO_FLAG_SENDRECV 3 // Protocol can both send & recv + // These functions are not used by protocols, but rather by the socket // core implementation. The lookups can be used by transports as well. extern nni_proto *nni_proto_find(uint16_t); -- cgit v1.2.3-70-g09d2