aboutsummaryrefslogtreecommitdiff
path: root/src/supplemental/tls/none
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-12-29 21:28:49 -0800
committerGarrett D'Amore <garrett@damore.org>2018-12-31 17:10:04 -0800
commita73ff5363eae228009413872b05aff758a46c5ca (patch)
treed5fa805188f915fc94c9b80d4f5cbbb96e6a4551 /src/supplemental/tls/none
parente0fff1f9c45f5486fc2e7eeb49b4462c3bb2dad4 (diff)
downloadnng-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/none')
-rw-r--r--src/supplemental/tls/none/tls.c42
1 files changed, 19 insertions, 23 deletions
diff --git a/src/supplemental/tls/none/tls.c b/src/supplemental/tls/none/tls.c
index e9d84e19..257bb6b1 100644
--- a/src/supplemental/tls/none/tls.c
+++ b/src/supplemental/tls/none/tls.c
@@ -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
@@ -17,9 +18,10 @@
// We provide stub functions only to satisfy linkage.
#include "core/nng_impl.h"
-#include "nng/supplemental/tls/tls.h"
#include "supplemental/tls/tls_api.h"
+#include <nng/supplemental/tls/tls.h>
+
void
nni_tls_config_fini(nng_tls_config *cfg)
{
@@ -72,40 +74,34 @@ nni_tls_recv(nni_tls *tp, nni_aio *aio)
nni_aio_finish_error(aio, NNG_ENOTSUP);
}
-int
-nni_tls_peername(nni_tls *tp, nni_sockaddr *sa)
-{
- NNI_ARG_UNUSED(tp);
- NNI_ARG_UNUSED(sa);
- return (NNG_ENOTSUP);
-}
-
-int
-nni_tls_sockname(nni_tls *tp, nni_sockaddr *sa)
-{
- NNI_ARG_UNUSED(tp);
- NNI_ARG_UNUSED(sa);
- return (NNG_ENOTSUP);
-}
-
void
nni_tls_close(nni_tls *tp)
{
NNI_ARG_UNUSED(tp);
}
-const char *
-nni_tls_ciphersuite_name(nni_tls *tp)
+int
+nni_tls_getopt(
+ nni_tls *tp, const char *name, void *buf, size_t *szp, nni_type t)
{
NNI_ARG_UNUSED(tp);
- return (NULL);
+ NNI_ARG_UNUSED(name);
+ NNI_ARG_UNUSED(buf);
+ NNI_ARG_UNUSED(szp);
+ NNI_ARG_UNUSED(t);
+ return (NNG_ENOTSUP);
}
-bool
-nni_tls_verified(nni_tls *tp)
+int
+nni_tls_setopt(
+ nni_tls *tp, const char *name, const void *buf, size_t sz, nni_type t)
{
NNI_ARG_UNUSED(tp);
- return (false);
+ NNI_ARG_UNUSED(name);
+ NNI_ARG_UNUSED(buf);
+ NNI_ARG_UNUSED(sz);
+ NNI_ARG_UNUSED(t);
+ return (NNG_ENOTSUP);
}
int