aboutsummaryrefslogtreecommitdiff
path: root/src/nng.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-05-05 11:03:33 -0700
committerGarrett D'Amore <garrett@damore.org>2018-05-06 15:21:33 -0700
commit916ba1ab23aa50b855fd795f095eaedb328e84d9 (patch)
treeb764e37145e7caf8f2fe7d1a3999ab6798c3a095 /src/nng.h
parent7ecb0e4a74bbb3d49ebe37a14b2534a242cb930a (diff)
downloadnng-916ba1ab23aa50b855fd795f095eaedb328e84d9.tar.gz
nng-916ba1ab23aa50b855fd795f095eaedb328e84d9.tar.bz2
nng-916ba1ab23aa50b855fd795f095eaedb328e84d9.zip
fixes #396 illumos doesn't build (missing NNG_PLATFORM_POSIX ON)
fixes #397 Need to cast zoneid fixes #395 sun is predefined on illumos/Solaris fixes #394 alloca needs to #include <alloca.h> fixes #399 Cannot use SVR4.2 specific msghdr fixes #402 getpeerucred needs a NULL initialized ucred fixes #403 syntax error in posix_tcp - attempt to return void fixes #407 illumos getegid wrong fixes #406 nni_idhash_count is dead code fixes #404 idhash typedef redeclared fixes #405 warning: newline not last character in file This is basically a slew of related bug fixes required to make this work on illumos. Note that the fixes are not "complete", because more work is required to support port events given that epoll is busted on illumos. We also fixed a bunch of things that aren't actually "bugs" per se, but really just warnings. Silencing them makes things better for everyone. Apparently not all compilers are equally happy with redundant (but otherwise identical) typedefs; we use structs in some places instead of shorter type names to silence these complaints. Note that IPC permissions (the mode bits on the socket vnode) are not validated on SunOS systems. This change includes documentation to reflect that.
Diffstat (limited to 'src/nng.h')
-rw-r--r--src/nng.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/nng.h b/src/nng.h
index ac4f178b..0c62dcb9 100644
--- a/src/nng.h
+++ b/src/nng.h
@@ -160,7 +160,7 @@ enum nng_sockaddr_family {
NNG_AF_IPC = 2,
NNG_AF_INET = 3,
NNG_AF_INET6 = 4,
- NNG_AF_ZT = 5, // ZeroTier
+ NNG_AF_ZT = 5 // ZeroTier
};
// Scatter/gather I/O.
@@ -223,9 +223,10 @@ NNG_DECL int nng_getopt_ptr(nng_socket, const char *, void **);
// Only one callback can be set on a given socket, and there is no way
// to retrieve the old value.
typedef enum {
- NNG_PIPE_ADD,
- NNG_PIPE_REM,
+ NNG_PIPE_ADD, // Pipe added to socket
+ NNG_PIPE_REM // Pipe removed from socket
} nng_pipe_action;
+
typedef void (*nng_pipe_cb)(nng_pipe, nng_pipe_action, void *);
NNG_DECL int nng_pipe_notify(nng_socket, nng_pipe_cb, void *);
@@ -619,7 +620,7 @@ NNG_DECL nng_listener nng_pipe_listener(nng_pipe);
// Flags.
enum nng_flag_enum {
NNG_FLAG_ALLOC = 1, // Recv to allocate receive buffer.
- NNG_FLAG_NONBLOCK = 2, // Non-blocking operations.
+ NNG_FLAG_NONBLOCK = 2 // Non-blocking operations.
};
// Options.
@@ -758,8 +759,8 @@ enum nng_flag_enum {
// NNG_DECL int nng_stat_type(nng_stat *);
enum nng_stat_type_enum {
- NNG_STAT_LEVEL = 0,
- NNG_STAT_COUNTER = 1,
+ NNG_STAT_LEVEL = 0, // Numeric "absolute" value, diffs meaningless
+ NNG_STAT_COUNTER = 1 // Incrementing value (diffs are meaningful)
};
// nng_stat_unit provides information about the unit for the statistic,
@@ -774,7 +775,7 @@ enum nng_unit_enum {
NNG_UNIT_MESSAGES = 2,
NNG_UNIT_BOOLEAN = 3,
NNG_UNIT_MILLIS = 4,
- NNG_UNIT_EVENTS = 5,
+ NNG_UNIT_EVENTS = 5
};
// nng_stat_value returns returns the actual value of the statistic.
@@ -845,7 +846,7 @@ enum nng_errno_enum {
NNG_EBADTYPE = 30,
NNG_EINTERNAL = 1000,
NNG_ESYSERR = 0x10000000,
- NNG_ETRANERR = 0x20000000,
+ NNG_ETRANERR = 0x20000000
};
// URL support. We frequently want to process a URL, and these methods