aboutsummaryrefslogtreecommitdiff
path: root/src/core/options.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-01-24 19:26:31 -0800
committerGarrett D'Amore <garrett@damore.org>2017-01-24 19:42:43 -0800
commite88f07b434dbcfdb57435a14e1beadcdae3cef0d (patch)
tree79433ae3c4ed6d2501e4d63ad9ada5a621df3bd9 /src/core/options.h
parent907a1eb392ca4b29c62b9cc3d2df1ad337695abf (diff)
downloadnng-e88f07b434dbcfdb57435a14e1beadcdae3cef0d.tar.gz
nng-e88f07b434dbcfdb57435a14e1beadcdae3cef0d.tar.bz2
nng-e88f07b434dbcfdb57435a14e1beadcdae3cef0d.zip
Add endpoint tuning of maxrcv size. Fix cmsg API.
The CMSG handling was completely borked. This is fixed now, and we stash the SP header size (ugh) in the CMSG contents to match what nanomsg does. We now pass the cmsg validation test. We also fixed handling of certain endpoint-related options, so that endpoints can get options from the socket at initialization time. This required a minor change to the transport API for endpoints. Finally, we fixed a critical fault in the REP handling of RAW sockets, which caused them to always return NNG_ESTATE in all cases. It should now honor the actual socket option.
Diffstat (limited to 'src/core/options.h')
-rw-r--r--src/core/options.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/options.h b/src/core/options.h
index 2d843a4c..ec5cce90 100644
--- a/src/core/options.h
+++ b/src/core/options.h
@@ -37,6 +37,17 @@ extern int nni_setopt_int(int *, const void *, size_t, int, int);
// nni_getopt_int gets an integer.
extern int nni_getopt_int(int *, void *, size_t *);
+// nni_setopt_size sets a size_t option.
+extern int nni_setopt_size(size_t *, const void *, size_t, size_t, size_t);
+
+// We limit the maximum size to 4GB. That's intentional because some of the
+// underlying protocols cannot cope with anything bigger than 32-bits.
+#define NNI_MINSZ (0)
+#define NNI_MAXSZ ((size_t) 0xffffffff)
+
+// nni_getopt_size obtains a size_t option.
+extern int nni_getopt_size(size_t *, void *, size_t *);
+
// nni_getopt_fd obtains a notification file descriptor.
extern int nni_getopt_fd(nni_sock *, nni_notifyfd *, int, void *, size_t *);