diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-12-29 21:28:49 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-12-31 17:10:04 -0800 |
| commit | a73ff5363eae228009413872b05aff758a46c5ca (patch) | |
| tree | d5fa805188f915fc94c9b80d4f5cbbb96e6a4551 /src/supplemental/tls/tls_api.h | |
| parent | e0fff1f9c45f5486fc2e7eeb49b4462c3bb2dad4 (diff) | |
| download | nng-a73ff5363eae228009413872b05aff758a46c5ca.tar.gz nng-a73ff5363eae228009413872b05aff758a46c5ca.tar.bz2 nng-a73ff5363eae228009413872b05aff758a46c5ca.zip | |
fixes #825 TCP public API should use generic setopt/getopt
This changes much of the internal API for TCP option handling, and
includes hooks for some of this in various consumers. Note that the
consumers still need to have additional work done to complete them,
which will be part of providing public "raw" TLS and WebSocket APIs.
We would also like to finish addressing the call sites of
nni_tcp_listener_start() that assume the sockaddr is modified --
it would be superior to use the NNG_OPT_LOCADDR option. Thaat will be
addressed in a follow up PR.
Diffstat (limited to 'src/supplemental/tls/tls_api.h')
| -rw-r--r-- | src/supplemental/tls/tls_api.h | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/supplemental/tls/tls_api.h b/src/supplemental/tls/tls_api.h index 53dba7fe..63424d5e 100644 --- a/src/supplemental/tls/tls_api.h +++ b/src/supplemental/tls/tls_api.h @@ -1,6 +1,7 @@ // // Copyright 2018 Staysail Systems, Inc. <info@staysail.tech> // Copyright 2018 Capitar IT Group BV <info@capitar.com> +// Copyright 2018 Devolutions <info@devolutions.net> // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -13,6 +14,8 @@ #include <stdbool.h> +#include <nng/supplemental/tls/tls.h> + // nni_tls represents the context for a single TLS stream. typedef struct nni_tls nni_tls; @@ -36,19 +39,10 @@ extern void nni_tls_close(nni_tls *); extern void nni_tls_fini(nni_tls *); extern void nni_tls_send(nni_tls *, nng_aio *); extern void nni_tls_recv(nni_tls *, nng_aio *); -extern int nni_tls_sockname(nni_tls *, nni_sockaddr *); -extern int nni_tls_peername(nni_tls *, nni_sockaddr *); -extern int nni_tls_set_nodelay(nni_tls *, bool); -extern int nni_tls_set_keepalive(nni_tls *, bool); - -// nni_tls_verified returns true if the peer, or false if the peer did not -// verify. (During the handshake phase, the peer is not verified, so this -// might return false if executed too soon. The verification status will -// be accurate once the handshake is finished, however. -extern bool nni_tls_verified(nni_tls *); - -// nni_tls_ciphersuite_name returns the name of the ciphersuite in use. -extern const char *nni_tls_ciphersuite_name(nni_tls *); + +extern int nni_tls_setopt( + nni_tls *, const char *, const void *, size_t, nni_type); +extern int nni_tls_getopt(nni_tls *, const char *, void *, size_t *, nni_type); // TBD: getting additional peer certificate information... |
