From 7df0165712bb6ca623830ac55c548696c83e8647 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 31 Dec 2017 13:31:02 -0800 Subject: Rename config init/fini to alloc/free, add documentation for them. --- docs/libnng.adoc | 23 +++++++++++ docs/nng.adoc | 1 + docs/nng_tls.adoc | 2 +- docs/nng_tls_config_alloc.adoc | 91 ++++++++++++++++++++++++++++++++++++++++++ docs/nng_tls_config_free.adoc | 61 ++++++++++++++++++++++++++++ docs/nng_ws.adoc | 2 +- 6 files changed, 178 insertions(+), 2 deletions(-) create mode 100644 docs/nng_tls_config_alloc.adoc create mode 100644 docs/nng_tls_config_free.adoc (limited to 'docs') diff --git a/docs/libnng.adoc b/docs/libnng.adoc index c9ff2d5b..3c320bb1 100644 --- a/docs/libnng.adoc +++ b/docs/libnng.adoc @@ -148,9 +148,31 @@ The following functions are used to register a transport for use. | <>|register inproc transport | <>|register IPC transport | <>|register TCP transport +| <>|register TLS transport +| <>|register WebSocket transport +| <>|register WebSocket Secure transport | <>|register ZeroTier transport |=== +TLS Configuration Objects +~~~~~~~~~~~~~~~~~~~~~~~~ + +The following functions are used to manipulate TLS configuration objects. + +[cols="1,4"] +|=== +| <>|allocate TLS configuration +| <>|set authentication mode +| <>|set certificate authority chain +| <>|set own certificate +| <>|set certificate revocation list +| <>}free TLS configuration +| <>|set private key +| <>|set private key password +| <>|set remote server name +|=== + + SEE ALSO -------- <> @@ -160,6 +182,7 @@ COPYRIGHT --------- Copyright 2017 mailto:garrett@damore.org[Garrett D'Amore] + +Copyright 2017 mailto:info@staysail.tech[Staysail Systems, Inc.] + Copyright 2017 mailto:info@capitar.com[Capitar IT Group BV] This document is supplied under the terms of the diff --git a/docs/nng.adoc b/docs/nng.adoc index d0fc5ee3..6eadc2ce 100644 --- a/docs/nng.adoc +++ b/docs/nng.adoc @@ -125,6 +125,7 @@ The library API is documented at <>. SEE ALSO -------- +<> <> COPYRIGHT diff --git a/docs/nng_tls.adoc b/docs/nng_tls.adoc index a6737d01..acf71d7b 100644 --- a/docs/nng_tls.adoc +++ b/docs/nng_tls.adoc @@ -243,7 +243,7 @@ if the `NNG_OPT_TLS_AUTH_MODE` option is set to SEE ALSO -------- <> -<> +<> COPYRIGHT --------- diff --git a/docs/nng_tls_config_alloc.adoc b/docs/nng_tls_config_alloc.adoc new file mode 100644 index 00000000..4b41258f --- /dev/null +++ b/docs/nng_tls_config_alloc.adoc @@ -0,0 +1,91 @@ +nng_tls_config_alloc(3) +======================= +:doctype: manpage +:manmanual: nng +:mansource: nng +:manvolnum: 3 +:icons: font +:source-highlighter: pygments +:copyright: Copyright 2017 Staysail Systems, Inc. \ + This software is supplied under the terms of the MIT License, a \ + copy of which should be located in the distribution where this \ + file was obtained (LICENSE.txt). A copy of the license may also \ + be found online at https://opensource.org/licenses/MIT. + +NAME +---- +nng_tls_config_alloc - allocate TLS configuration object + +SYNOPSIS +-------- + +[source, c] +----------- +#include + +typedef enum nng_tls_mode { + NNG_TLS_MODE_CLIENT, + NNG_TLS_MODE_SERVER +} nng_tls_mode; + +int nng_tls_config_alloc(nni_tls_config **cfgp, nng_tls_mode mode); +----------- + +DESCRIPTION +----------- + +The `nng_tls_config_alloc()` function creates a newly initialized +TLS (Transport Layer Security, see +https://tools.ietf.org/html/rfc5246[RFC 5246]) +configuration object. + +This object is initialized for use when acting as either a +client (`NNG_TLS_MODE_CLIENT`) or as a server (`NNG_TLS_MODE_SERVER`). + +A TLS object can be further modified by functions that set the security +keys used, peeer certificates, protocol policies, and so forth. + +A single TLS configuration object can be used with multiple TLS streams +or services. The underlying system uses reference counting to ensure +that object is not inadvertently freed while in use. + +Also note that a TLS configuration object becomes "read-only" after it +is first used with a service. After this points, attempts to apply +further changes to the configuration will result in `NNG_EBUSY`. + + +RETURN VALUES +------------- + +This function returns 0 on success, and non-zero otherwise. + + +ERRORS +------ + +`NNG_ENOMEM`:: Insufficient memory is available to allocate the object. + + +SEE ALSO +-------- + +<> +<> +<> +<> +<> +<> +<> +<> +<> +<> +<> + + +COPYRIGHT +--------- + +Copyright 2017 mailto:info@staysail.tech[Staysail Systems, Inc.] + +This document is supplied under the terms of the +https://opensource.org/licenses/LICENSE.txt[MIT License]. diff --git a/docs/nng_tls_config_free.adoc b/docs/nng_tls_config_free.adoc new file mode 100644 index 00000000..8e94e7f2 --- /dev/null +++ b/docs/nng_tls_config_free.adoc @@ -0,0 +1,61 @@ +nng_tls_config_alloc(3) +======================= +:doctype: manpage +:manmanual: nng +:mansource: nng +:manvolnum: 3 +:icons: font +:source-highlighter: pygments +:copyright: Copyright 2017 Staysail Systems, Inc. \ + This software is supplied under the terms of the MIT License, a \ + copy of which should be located in the distribution where this \ + file was obtained (LICENSE.txt). A copy of the license may also \ + be found online at https://opensource.org/licenses/MIT. + +NAME +---- +nng_tls_config_free - deallocate a TLS configuration object + +SYNOPSIS +-------- + +[source, c] +----------- +#include + +void nng_tls_config_free(nni_tls_config *cfg); +----------- + +DESCRIPTION +----------- + +The `nng_tls_config_free()` decrements the reference count on a +TLS configuration object, and if the resulting reference count is zero, +then deallocates the configuration object. + +RETURN VALUES +------------- + +None. + + +ERRORS +------ + +None. + + +SEE ALSO +-------- + +<> +<> + + +COPYRIGHT +--------- + +Copyright 2017 mailto:info@staysail.tech[Staysail Systems, Inc.] + +This document is supplied under the terms of the +https://opensource.org/licenses/LICENSE.txt[MIT License]. diff --git a/docs/nng_ws.adoc b/docs/nng_ws.adoc index b6185757..66bcff67 100644 --- a/docs/nng_ws.adoc +++ b/docs/nng_ws.adoc @@ -169,7 +169,7 @@ This object is only available for `wss://` endpoints. SEE ALSO -------- <> -<> +<> COPYRIGHT --------- -- cgit v1.2.3-70-g09d2