diff options
| author | Garrett D'Amore <garrett@damore.org> | 2019-01-06 15:51:27 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2019-01-06 15:51:27 -0800 |
| commit | 1a808eb90bbea075aa40ff40ee29507d37f41a10 (patch) | |
| tree | fcf97589dfa7f3c8fd5b819b962d311c803090f7 /include | |
| parent | 127383b238bee21c11b1ad118b63d2c3fe55de50 (diff) | |
| download | nng-1a808eb90bbea075aa40ff40ee29507d37f41a10.tar.gz nng-1a808eb90bbea075aa40ff40ee29507d37f41a10.tar.bz2 nng-1a808eb90bbea075aa40ff40ee29507d37f41a10.zip | |
fixes #853 Move IPC options to nng.h
Diffstat (limited to 'include')
| -rw-r--r-- | include/nng/nng.h | 36 | ||||
| -rw-r--r-- | include/nng/transport/ipc/ipc.h | 33 |
2 files changed, 36 insertions, 33 deletions
diff --git a/include/nng/nng.h b/include/nng/nng.h index 5ea9d374..3063a652 100644 --- a/include/nng/nng.h +++ b/include/nng/nng.h @@ -1,5 +1,5 @@ // -// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2019 Staysail Systems, Inc. <info@staysail.tech> // Copyright 2018 Capitar IT Group BV <info@capitar.com> // // This software is supplied under the terms of the MIT License, a @@ -754,6 +754,40 @@ enum nng_flag_enum { // state current). This is a boolean. #define NNG_OPT_TCP_KEEPALIVE "tcp-keepalive" +// IPC options. These will largely vary depending on the platform, +// as POSIX systems have very different options than Windows. + +// Security Descriptor. This option may only be set on listeners +// on the Windows platform, where the object is a pointer to a +// a Windows SECURITY_DESCRIPTOR. +#define NNG_OPT_IPC_SECURITY_DESCRIPTOR "ipc:security-descriptor" + +// Permissions bits. This option is only valid for listeners on +// POSIX platforms and others that honor UNIX style permission bits. +// Note that some platforms may not honor the permissions here, although +// at least Linux and macOS seem to do so. Check before you rely on +// this for security. +#define NNG_OPT_IPC_PERMISSIONS "ipc:permissions" + +// Peer UID. This is only available on POSIX style systems. +#define NNG_OPT_IPC_PEER_UID "ipc:peer-uid" + +// Peer GID (primary group). This is only available on POSIX style systems. +#define NNG_OPT_IPC_PEER_GID "ipc:peer-gid" + +// Peer process ID. Available on Windows, Linux, and SunOS. +// In theory we could obtain this with the first message sent, +// but we have elected not to do this for now. (Nice RFE for a FreeBSD +// guru though.) +#define NNG_OPT_IPC_PEER_PID "ipc:peer-pid" + +// Peer Zone ID. Only on SunOS systems. (Linux containers have no +// definable kernel identity; they are a user-land fabrication made up +// from various pieces of different namespaces. FreeBSD does have +// something called JailIDs, but it isn't obvious how to determine this, +// or even if processes can use IPC across jail boundaries.) +#define NNG_OPT_IPC_PEER_ZONEID "ipc:peer-zoneid" + // XXX: TBD: priorities, ipv4only // Statistics. These are for informational purposes only, and subject diff --git a/include/nng/transport/ipc/ipc.h b/include/nng/transport/ipc/ipc.h index 497fb2b5..c69c4dc9 100644 --- a/include/nng/transport/ipc/ipc.h +++ b/include/nng/transport/ipc/ipc.h @@ -1,5 +1,5 @@ // -// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2019 Staysail Systems, Inc. <info@staysail.tech> // Copyright 2018 Capitar IT Group BV <info@capitar.com> // // This software is supplied under the terms of the MIT License, a @@ -16,35 +16,4 @@ NNG_DECL int nng_ipc_register(void); -// Security Descriptor. This option may only be set on listeners -// on the Windows platform, where the object is a pointer to a -// a Windows SECURITY_DESCRIPTOR. -#define NNG_OPT_IPC_SECURITY_DESCRIPTOR "ipc:security-descriptor" - -// Permissions bits. This option is only valid for listeners on -// POSIX platforms and others that honor UNIX style permission bits. -// Note that some platforms may not honor the permissions here, although -// at least Linux and macOS seem to do so. Check before you rely on -// this for security. -#define NNG_OPT_IPC_PERMISSIONS "ipc:permissions" - -// Peer UID. This is only available on POSIX style systems. -#define NNG_OPT_IPC_PEER_UID "ipc:peer-uid" - -// Peer GID (primary group). This is only available on POSIX style systems. -#define NNG_OPT_IPC_PEER_GID "ipc:peer-gid" - -// Peer process ID. Available on Windows, Linux, and SunOS. -// In theory we could obtain this with the first message sent, -// but we have elected not to do this for now. (Nice RFE for a FreeBSD -// guru though.) -#define NNG_OPT_IPC_PEER_PID "ipc:peer-pid" - -// Peer Zone ID. Only on SunOS systems. (Linux containers have no -// definable kernel identity; they are a user-land fabrication made up -// from various pieces of different namespaces. FreeBSD does have -// something called JailIDs, but it isn't obvious how to determine this, -// or even if processes can use IPC across jail boundaries.) -#define NNG_OPT_IPC_PEER_ZONEID "ipc:peer-zoneid" - #endif // NNG_TRANSPORT_IPC_IPC_H |
