diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-08-23 11:23:22 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-08-23 21:14:12 -0700 |
| commit | 8ad296769192cf4628710ac0b228be2aca6d8dad (patch) | |
| tree | edd6240a63cc3b2a7e6206e1cc07b5c5edb9f1bf /src/nng.h | |
| parent | 7074c5c50936308d1ef58be4ce1ca5e776e4c8cb (diff) | |
| download | nng-8ad296769192cf4628710ac0b228be2aca6d8dad.tar.gz nng-8ad296769192cf4628710ac0b228be2aca6d8dad.tar.bz2 nng-8ad296769192cf4628710ac0b228be2aca6d8dad.zip | |
Implement dynamic option numbering.
This permits option numbers to be allocated based on string name.
Eventually all the option values will be replaced with option
names. This will facilitate transports (ZeroTier) that may need
further options.
Diffstat (limited to 'src/nng.h')
| -rw-r--r-- | src/nng.h | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -309,6 +309,13 @@ NNG_DECL void nng_msg_set_pipe(nng_msg *, nng_pipe); NNG_DECL nng_pipe nng_msg_get_pipe(const nng_msg *); NNG_DECL int nng_msg_getopt(nng_msg *, int, void *, size_t *); +// Lookup an option by name. This returns either the option value, +// or -1 if the option name is unknown. +NNG_DECL int nng_option_lookup(const char *); + +// Lookup an option name by id. Returns NULL if not known. +NNG_DECL const char *nng_option_name(int); + // Pipe API. Generally pipes are only "observable" to applications, but // we do permit an application to close a pipe. This can be useful, for // example during a connection notification, to disconnect a pipe that @@ -417,7 +424,6 @@ enum nng_opt_enum { NNG_OPT_REMOTEADDR = NNG_OPT_SOCKET(17), NNG_OPT_RCVFD = NNG_OPT_SOCKET(18), NNG_OPT_SNDFD = NNG_OPT_SOCKET(19), - NNG_OPT_POLYAMOROUS = NNG_OPT_SOCKET(20), }; // XXX: TBD: priorities, socket names, ipv4only |
