aboutsummaryrefslogtreecommitdiff
path: root/src/core/protocol.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-04-04 12:37:34 -0700
committerGarrett D'Amore <garrett@damore.org>2018-04-04 13:13:24 -0700
commit45f455064b5704f3d5ed8ecf9f197a18fe72ee59 (patch)
tree76a626029f3a5a818b113b7e4342efaf6220a03f /src/core/protocol.h
parent505a9bce029e51540739c853a6c9eef0ecfb2e90 (diff)
downloadnng-45f455064b5704f3d5ed8ecf9f197a18fe72ee59.tar.gz
nng-45f455064b5704f3d5ed8ecf9f197a18fe72ee59.tar.bz2
nng-45f455064b5704f3d5ed8ecf9f197a18fe72ee59.zip
fixes #331 replace NNG_OPT_RAW option with constructor
This makes the raw mode something that is immutable, determined at socket construction. This is an enabling change for the separate context support coming soon. As a result, this is an API breaking change for users of the raw mode option (NNG_OPT_RAW). There aren't many of them out there. Cooked mode is entirely unaffected. There are changes to tests and documentation included.
Diffstat (limited to 'src/core/protocol.h')
-rw-r--r--src/core/protocol.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/protocol.h b/src/core/protocol.h
index 01e3d11c..9b241138 100644
--- a/src/core/protocol.h
+++ b/src/core/protocol.h
@@ -127,10 +127,12 @@ struct nni_proto {
// 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.
+// no sense. Also, we can detect raw mode, thereby providing handling for
+// that at the socket layer (NNG_PROTO_FLAG_RAW).
#define NNI_PROTO_FLAG_RCV 1 // Protocol can receive
#define NNI_PROTO_FLAG_SND 2 // Protocol can send
#define NNI_PROTO_FLAG_SNDRCV 3 // Protocol can both send & recv
+#define NNI_PROTO_FLAG_RAW 4 // Protocol is raw
// nni_proto_open is called by the protocol to create a socket instance
// with its ops vector. The intent is that applications will only see