From 5cf750697624d4fd63cfe26921209d7c30e1a2d2 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 21 Jan 2019 22:40:10 -0800 Subject: fixes #872 create unified nng_stream API This is a major change, and includes changes to use a polymorphic stream API for all transports. There have been related bugs fixed along the way. Additionally the man pages have changed. The old non-polymorphic APIs are removed now. This is a breaking change, but the old APIs were never part of any released public API. --- src/supplemental/tls/none/tls.c | 92 ++++++++++++----------------------------- 1 file changed, 27 insertions(+), 65 deletions(-) (limited to 'src/supplemental/tls/none/tls.c') diff --git a/src/supplemental/tls/none/tls.c b/src/supplemental/tls/none/tls.c index 257bb6b1..a1e70b73 100644 --- a/src/supplemental/tls/none/tls.c +++ b/src/supplemental/tls/none/tls.c @@ -1,5 +1,5 @@ // -// Copyright 2018 Staysail Systems, Inc. +// Copyright 2019 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV // Copyright 2018 Devolutions // @@ -20,8 +20,6 @@ #include "core/nng_impl.h" #include "supplemental/tls/tls_api.h" -#include - void nni_tls_config_fini(nng_tls_config *cfg) { @@ -42,68 +40,6 @@ nni_tls_config_hold(nng_tls_config *cfg) NNI_ARG_UNUSED(cfg); } -void -nni_tls_fini(nni_tls *tp) -{ - NNI_ARG_UNUSED(tp); -} - -int -nni_tls_init(nni_tls **tpp, nng_tls_config *cfg, nni_tcp_conn *tcp) -{ - NNI_ARG_UNUSED(tpp); - NNI_ARG_UNUSED(cfg); - NNI_ARG_UNUSED(tcp); - - return (NNG_ENOTSUP); -} - -// nni_tls_send is the exported send function. It has a similar -// calling convention as the platform TCP pipe. -void -nni_tls_send(nni_tls *tp, nni_aio *aio) -{ - NNI_ARG_UNUSED(tp); - nni_aio_finish_error(aio, NNG_ENOTSUP); -} - -void -nni_tls_recv(nni_tls *tp, nni_aio *aio) -{ - NNI_ARG_UNUSED(tp); - nni_aio_finish_error(aio, NNG_ENOTSUP); -} - -void -nni_tls_close(nni_tls *tp) -{ - NNI_ARG_UNUSED(tp); -} - -int -nni_tls_getopt( - nni_tls *tp, const char *name, void *buf, size_t *szp, nni_type t) -{ - NNI_ARG_UNUSED(tp); - NNI_ARG_UNUSED(name); - NNI_ARG_UNUSED(buf); - NNI_ARG_UNUSED(szp); - NNI_ARG_UNUSED(t); - return (NNG_ENOTSUP); -} - -int -nni_tls_setopt( - nni_tls *tp, const char *name, const void *buf, size_t sz, nni_type t) -{ - NNI_ARG_UNUSED(tp); - NNI_ARG_UNUSED(name); - NNI_ARG_UNUSED(buf); - NNI_ARG_UNUSED(sz); - NNI_ARG_UNUSED(t); - return (NNG_ENOTSUP); -} - int nng_tls_config_server_name(nng_tls_config *cfg, const char *name) { @@ -190,3 +126,29 @@ nng_tls_config_free(nng_tls_config *cfg) { NNI_ARG_UNUSED(cfg); } + +int +nni_tls_dialer_alloc(nng_stream_dialer **dp, const nng_url *url) +{ + NNI_ARG_UNUSED(dp); + NNI_ARG_UNUSED(url); + return (NNG_ENOTSUP); +} + +int +nni_tls_listener_alloc(nng_stream_listener **lp, const nng_url *url) +{ + NNI_ARG_UNUSED(lp); + NNI_ARG_UNUSED(url); + return (NNG_ENOTSUP); +} + +int +nni_tls_checkopt(const char *nm, const void *buf, size_t sz, nni_type t) +{ + NNI_ARG_UNUSED(nm); + NNI_ARG_UNUSED(buf); + NNI_ARG_UNUSED(sz); + NNI_ARG_UNUSED(t); + return (NNG_ENOTSUP); +} \ No newline at end of file -- cgit v1.2.3-70-g09d2