summaryrefslogtreecommitdiff
path: root/docs/man
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2019-01-06 18:21:03 -0800
committerGarrett D'Amore <garrett@damore.org>2019-01-06 18:21:03 -0800
commit099d89877aca6a7236254e39d9c9f5c46083cee7 (patch)
tree7c90fc10243c837ade64d469712a2fb4c4ca2027 /docs/man
parentc270253d61706c1e0229e58cd2ce76b49890612c (diff)
downloadnng-099d89877aca6a7236254e39d9c9f5c46083cee7.tar.gz
nng-099d89877aca6a7236254e39d9c9f5c46083cee7.tar.bz2
nng-099d89877aca6a7236254e39d9c9f5c46083cee7.zip
fixes #846 Document IPC public API
Diffstat (limited to 'docs/man')
-rw-r--r--docs/man/CMakeLists.txt32
-rw-r--r--docs/man/libnng.3.adoc28
-rw-r--r--docs/man/nng_ipc.5.adoc85
-rw-r--r--docs/man/nng_ipc_close.3ipc.adoc61
-rw-r--r--docs/man/nng_ipc_dialer.5.adoc50
-rw-r--r--docs/man/nng_ipc_dialer_alloc.3ipc.adoc49
-rw-r--r--docs/man/nng_ipc_dialer_close.3ipc.adoc57
-rw-r--r--docs/man/nng_ipc_dialer_dial.3ipc.adoc65
-rw-r--r--docs/man/nng_ipc_dialer_free.3ipc.adoc54
-rw-r--r--docs/man/nng_ipc_dialer_getopt.3ipc.adoc63
-rw-r--r--docs/man/nng_ipc_dialer_setopt.3ipc.adoc58
-rw-r--r--docs/man/nng_ipc_free.3ipc.adoc59
-rw-r--r--docs/man/nng_ipc_getopt.3ipc.adoc69
-rw-r--r--docs/man/nng_ipc_listener.5.adoc51
-rw-r--r--docs/man/nng_ipc_listener_accept.3ipc.adoc63
-rw-r--r--docs/man/nng_ipc_listener_alloc.3ipc.adoc50
-rw-r--r--docs/man/nng_ipc_listener_close.3ipc.adoc57
-rw-r--r--docs/man/nng_ipc_listener_free.3ipc.adoc52
-rw-r--r--docs/man/nng_ipc_listener_getopt.3ipc.adoc65
-rw-r--r--docs/man/nng_ipc_listener_listen.3ipc.adoc56
-rw-r--r--docs/man/nng_ipc_listener_setopt.3ipc.adoc63
-rw-r--r--docs/man/nng_ipc_recv.3ipc.adoc72
-rw-r--r--docs/man/nng_ipc_send.3ipc.adoc71
-rw-r--r--docs/man/nng_ipc_setopt.3ipc.adoc56
-rw-r--r--docs/man/nng_options.5.adoc86
25 files changed, 1468 insertions, 4 deletions
diff --git a/docs/man/CMakeLists.txt b/docs/man/CMakeLists.txt
index ecdbf1e2..b88a0ddd 100644
--- a/docs/man/CMakeLists.txt
+++ b/docs/man/CMakeLists.txt
@@ -272,6 +272,28 @@ if (NNG_ENABLE_DOC)
nng_http_server_stop
)
+ set(NNG_MAN3IPC
+ nng_ipc_close
+ nng_ipc_free
+ nng_ipc_getopt
+ nng_ipc_dialer_alloc
+ nng_ipc_dialer_close
+ nng_ipc_dialer_dial
+ nng_ipc_dialer_free
+ nng_ipc_dialer_getopt
+ nng_ipc_dialer_setopt
+ nng_ipc_listener_accept
+ nng_ipc_listener_alloc
+ nng_ipc_listener_close
+ nng_ipc_listener_free
+ nng_ipc_listener_getopt
+ nng_ipc_listener_listen
+ nng_ipc_listener_setopt
+ nng_ipc_recv
+ nng_ipc_send
+ nng_ipc_setopt
+ )
+
set(NNG_MAN3SUPP
nng_clock
nng_cv_alloc
@@ -291,7 +313,7 @@ if (NNG_ENABLE_DOC)
nng_thread_destroy
)
- set(NNG_MAN3TCP
+ set(NNG_MAN3TCP
nng_tcp_close
nng_tcp_free
nng_tcp_getopt
@@ -311,7 +333,7 @@ if (NNG_ENABLE_DOC)
nng_tcp_recv
nng_tcp_send
nng_tcp_setopt
- )
+ )
set(NNG_MAN3TLS
nng_tls_config_alloc
@@ -385,13 +407,17 @@ if (NNG_ENABLE_DOC)
nng_man(${F} 3http)
endforeach()
+ foreach(F ${NNG_MAN3IPC})
+ nng_man(${F} 3ipc)
+ endforeach()
+
foreach(F ${NNG_MAN3SUPP})
nng_man(${F} 3supp)
endforeach()
foreach(F ${NNG_MAN3TCP})
nng_man(${F} 3tcp)
- endforeach()
+ endforeach()
foreach(F ${NNG_MAN3TLS})
nng_man(${F} 3tls)
diff --git a/docs/man/libnng.3.adoc b/docs/man/libnng.3.adoc
index 3ee45786..9747e060 100644
--- a/docs/man/libnng.3.adoc
+++ b/docs/man/libnng.3.adoc
@@ -308,6 +308,34 @@ Most applications won't need to use these.
|===
+=== Supplemental IPC
+
+These IPC functions are available for use with direct interprocess
+communication (IPC).
+Most applications won't need to use these.
+
+|===
+|<<nng_ipc_close.3ipc#,nng_ipc_close()>>|close IPC connection
+|<<nng_ipc_dialer_alloc.3ipc#,nng_ipc_dialer_alloc()>>|allocate IPC dialer
+|<<nng_ipc_dialer_close.3ipc#,nng_ipc_dialer_close()>>|close IPC dialer
+|<<nng_ipc_dialer_dial.3ipc#,nng_ipc_dialer_dial()>>|initiate outgoing IPC connection
+|<<nng_ipc_dialer_free.3ipc#,nng_ipc_dialer_free()>>|free IPC dialer
+|<<nng_ipc_dialer_getopt.3ipc#,nng_ipc_dialer_getopt()>>|get option from IPC dialer
+|<<nng_ipc_dialer_setopt.3ipc#,nng_ipc_dialer_setopt()>>|set option on IPC dialer
+|<<nng_ipc_free.3ipc#,nng_ipc_free()>>|free IPC connection
+|<<nng_ipc_getopt.3ipc#,nng_ipc_getopt()>>|get option from IPC connection
+|<<nng_ipc_listener_accept.3ipc#,nng_ipc_listener_accept()>>|accept incoming IPC connection
+|<<nng_ipc_listener_alloc.3ipc#,nng_ipc_listener_alloc()>>|allocate IPC listener
+|<<nng_ipc_listener_close.3ipc#,nng_ipc_listener_close()>>|close IPC listener
+|<<nng_ipc_listener_free.3ipc#,nng_ipc_listener_free()>>|free IPC listener
+|<<nng_ipc_listener_getopt.3ipc#,nng_ipc_listener_getopt()>>|get option from IPC listener
+|<<nng_ipc_listener_listen.3ipc#,nng_ipc_listener_listen()>>|bind IPC listener
+|<<nng_ipc_listener_setopt.3ipc#,nng_ipc_listener_setopt()>>|set option on IPC listener
+|<<nng_ipc_recv.3ipc#,nng_ipc_recv()>>|receive from IPC connection
+|<<nng_ipc_send.3ipc#,nng_ipc_send()>>|send to IPC connection
+|<<nng_ipc_setopt.3ipc#,nng_ipc_setopt()>>|set option on IPC connection
+|===
+
=== HTTP Support
The library may be configured with support for HTTP, and this will
diff --git a/docs/man/nng_ipc.5.adoc b/docs/man/nng_ipc.5.adoc
new file mode 100644
index 00000000..85f881c0
--- /dev/null
+++ b/docs/man/nng_ipc.5.adoc
@@ -0,0 +1,85 @@
+= nng_ipc(5)
+//
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
+// Copyright 2019 Devolutions <info@devolutions.net>
+//
+// This document 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_ipc - IPC connection
+
+== SYNOPSIS
+
+[source, c]
+----
+#include <nng/nng.h>
+#include <nng/supplemental/ipc/ipc.h>
+
+typedef struct nng_ipc_s nng_ipc;
+----
+
+== DESCRIPTION
+
+An `nng_ipc` (((IPC connection))) represents a connected stream
+using interprocess communication (IPC).
+IPC stream objects can be used to send or receive data.
+
+NOTE: The `nng_ipc` object is used for raw IPC connections, and
+should not be confused with a pipe object created using the
+<<nng_ipc.7#,nng_ipc(7)>> transport.
+
+TIP: Most NNG applications should not use this, but instead use the
+<<nng_ipc.7#,nng_ipc(7)>> transport instead.
+
+These objects are created either establishing an outgoing connection
+with <<nng_ipc_dialer_dial.3ipc#,`nng_ipc_dialer_dial()`>> or by
+accepting in incoming connection with
+<<nng_ipc_listener_accept.3ipc#,`nng_ipc_listener_accept()`>>.
+
+IPC connections are byte streams, and are "`reliable`" in that data
+will not be delivered out of order, or with portions missing.
+
+Data can be sent using <<nng_ipc_send.3ipc#,`nng_ipc_send()`>> or
+received with <<nng_ipc_recv.3ipc#,`nng_ipc_recv()`>>.
+
+When the connection is no longer needed, it should be freed with
+<<nng_ipc_free.3ipc#,`nng_ipc_free()`>>.
+
+TIP: It is possible to close the connection, without freeing it, by
+using <<nng_ipc_close.3ipc#,`nng_ipc_close()`>>.
+
+=== Options
+
+The following options are applicable to IPC connections, and may be
+accessed using the <<nng_ipc_getopt.3ipc#,`nng_ipc_getopt()`>> and
+<<nng_ipc_setopt.3ipc#,`nng_ipc_setopt()`>> functions.
+
+* <<nng_options.5#NNG_OPT_LOCADDR,`NNG_OPT_LOCADDR`>>
+* <<nng_options.5#NNG_OPT_REMADDR,`NNG_OPT_REMADDR`>>
+* <<nng_options.5#NNG_OPT_IPC_PEER_GID,`NNG_OPT_IPC_PEER_GID`>>
+* <<nng_options.5#NNG_OPT_IPC_PEER_PID,`NNG_OPT_IPC_PEER_PID`>>
+* <<nng_options.5#NNG_OPT_IPC_PEER_UID,`NNG_OPT_IPC_PEER_UID`>>
+* <<nng_options.5#NNG_OPT_IPC_PEER_ZONEID,`NNG_OPT_IPC_PEER_ZONEID`>>
+
+Other platform specific options may be available as well.
+
+== SEE ALSO
+
+[.text-left]
+<<libnng.3#,libnng(3)>>,
+<<nng_ipc_close.3ipc#,nng_ipc_close(3ipc)>>,
+<<nng_ipc_dialer_dial.3ipc#,nng_ipc_dialer_dial(3ipc)>>,
+<<nng_ipc_free.3ipc#,nng_ipc_free(3ipc)>>,
+<<nng_ipc_getopt.3ipc#,nng_ipc_getopt(3ipc)>>,
+<<nng_ipc_listener_accept.3ipc#,nng_ipc_listener_accept(3ipc)>>,
+<<nng_ipc_recv.3ipc#,nng_ipc_recv(3ipc)>>,
+<<nng_ipc_send.3ipc#,nng_ipc_send(3ipc)>>,
+<<nng_ipc_setopt.3ipc#,nng_ipc_setopt(3ipc)>>,
+<<nng.7#,nng(7)>>,
+<<nng_ipc.7#,nng_ipc(7)>>
diff --git a/docs/man/nng_ipc_close.3ipc.adoc b/docs/man/nng_ipc_close.3ipc.adoc
new file mode 100644
index 00000000..df490013
--- /dev/null
+++ b/docs/man/nng_ipc_close.3ipc.adoc
@@ -0,0 +1,61 @@
+= nng_ipc_close(3ipc)
+//
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
+// Copyright 2019 Devolutions <info@devolutions.net>
+//
+// This document 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_ipc_close - close IPC connection
+
+== SYNOPSIS
+
+[source, c]
+----
+#include <nng/nng.h>
+#include <nng/supplemental/ipc/ipc.h>
+
+void nng_ipc_close(nng_ipc *conn);
+----
+
+== DESCRIPTION
+
+The `nng_ipc_close()` function closes the supplied IPC connection, _conn_.
+
+If any operations are pending (such as <<nng_ipc_send.3ipc#,`nng_ipc_send()`>>
+or <<nng_ipc_recv.3ipc#,`nng_ipc_recv()`>>) they will be terminated with
+an `NNG_ECLOSED` error condition.
+Also, any new operations will fail with `NNG_ECLOSED` after the connection
+is closed.
+
+NOTE: Closing the connection while data is in transmission will likely
+lead to loss of that data.
+There is no automatic linger or flush to ensure that the socket send buffers
+have completely transmitted.
+
+NOTE: Closing the connection does not free the resources associated with it.
+Once it is certain that no more operations are pending on the connection,
+it should be freed with <<nng_ipc_free.3ipc#,`nng_ipc_free()`>>.
+
+== RETURN VALUES
+
+None.
+
+== ERRORS
+
+None.
+
+== SEE ALSO
+
+[.text-left]
+<<nng_strerror.3#,nng_strerror(3)>>,
+<<nng_ipc_free.3ipc#,nng_ipc_free(3ipc)>>,
+<<nng_ipc_recv.3ipc#,nng_ipc_recv(3ipc)>>,
+<<nng_ipc_send.3ipc#,nng_ipc_send(3ipc)>>,
+<<nng_ipc.5#,nng_ipc(5)>>
diff --git a/docs/man/nng_ipc_dialer.5.adoc b/docs/man/nng_ipc_dialer.5.adoc
new file mode 100644
index 00000000..95f9d3ef
--- /dev/null
+++ b/docs/man/nng_ipc_dialer.5.adoc
@@ -0,0 +1,50 @@
+= nng_ipc_dialer(5)
+//
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
+// Copyright 2019 Devolutions <info@devolutions.net>
+//
+// This document 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_ipc_dialer - IPC dialer
+
+== SYNOPSIS
+
+[source, c]
+----
+#include <nng/nng.h>
+#include <nng/supplemental/ipc/ipc.h>
+
+typedef struct nng_ipc_dialer_s nng_ipc_dialer;
+----
+
+== DESCRIPTION
+
+(((IPC, dialer)))
+An `nng_ipc_dialer` is a handle to an IPC "`dialer`", which is responsible for
+creating a connections (<<nng_ipc.5#,`nng_ipc`>> objects) by connecting to
+remote systems.
+
+NOTE: The `nng_ipc_dialer` object is used for raw IPC connections, and
+should not be confused with a dialer object created using the
+<<nng_ipc.7#,nng_ipc(7)>> transport.
+
+TIP: Most NNG applications should not use this, but instead use the
+<<nng_ipc.7#,nng_ipc(7)>> transport instead.
+
+== SEE ALSO
+
+[.text-left]
+<<nng_ipc_dialer_alloc.3ipc#,nng_ipc_dialer_alloc(3ipc)>>,
+<<nng_ipc_dialer_close.3ipc#,nng_ipc_dialer_close(3ipc)>>,
+<<nng_ipc_dialer_dial.3ipc#,nng_ipc_dialer_dial(3ipc)>>,
+<<nng_ipc_dialer_free.3ipc#,nng_ipc_dialer_free(3ipc)>>,
+<<nng_ipc.5#,nng_ipc(5)>>,
+<<nng_ipc_listener.5#,nng_ipc_listener(5)>>,
+<<nng_ipc.7#,nng_ipc(7)>>
diff --git a/docs/man/nng_ipc_dialer_alloc.3ipc.adoc b/docs/man/nng_ipc_dialer_alloc.3ipc.adoc
new file mode 100644
index 00000000..6b2c1fbb
--- /dev/null
+++ b/docs/man/nng_ipc_dialer_alloc.3ipc.adoc
@@ -0,0 +1,49 @@
+= nng_ipc_dialer_alloc(3ipc)
+//
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
+// Copyright 2019 Devolutions <info@devolutions.net>
+//
+// This document 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_ipc_dialer_alloc - allocate IPC dialer
+
+== SYNOPSIS
+
+[source, c]
+----
+#include <nng/nng.h>
+#include <nng/supplemental/ipc/ipc.h>
+
+int nng_ipc_dialer_alloc(nng_ipc_dialer *dp);
+----
+
+== DESCRIPTION
+
+The `nng_ipc_dialer_alloc()` allocates an IPC dialer, which can be used
+to create outgoing connections over IPC, and stores a pointer to it
+it in the location referenced by _dp_.
+
+== RETURN VALUES
+
+This function returns 0 on success, and non-zero otherwise.
+
+== ERRORS
+
+[horizontal]
+`NNG_ENOMEM`:: Insufficient free memory exists.
+
+== SEE ALSO
+
+[.text-left]
+<<nng_ipc_dialer_close.3ipc#,nng_ipc_dialer_close(3ipc)>>,
+<<nng_ipc_dialer_dial.3ipc#,nng_ipc_dialer_dial(3ipc)>>,
+<<nng_ipc_dialer_free.3ipc#,nng_ipc_dialer_free(3ipc)>>,
+<<nng_ipc_dialer.5#,nng_ipc_dialer(5)>>,
+<<nng_strerror.3#,nng_strerror(3)>>
diff --git a/docs/man/nng_ipc_dialer_close.3ipc.adoc b/docs/man/nng_ipc_dialer_close.3ipc.adoc
new file mode 100644
index 00000000..013274eb
--- /dev/null
+++ b/docs/man/nng_ipc_dialer_close.3ipc.adoc
@@ -0,0 +1,57 @@
+= nng_ipc_dialer_close(3ipc)
+//
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
+//
+// This document 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_ipc_dialer_close - close IPC dialer
+
+== SYNOPSIS
+
+[source, c]
+----
+#include <nng/nng.h>
+#include <nng/supplemental/ipc/ipc.h>
+
+void nng_ipc_dialer_close(nng_ipc_dialer *d);
+----
+
+== DESCRIPTION
+
+The `nng_ipc_dialer_close()` function closes the supplied IPC dialer _d_,
+but does not free the underlying resources associated with it.
+
+If any <<nng_ipc_dialer_dial.3ipc#,dial>> operations using _d_ are
+in progress, they will be terminated with an `NNG_ECLOSED` error condition.
+
+Furthermore any future accesses to the dialer _d_ will also result in
+`NNG_ECLOSED`.
+
+NOTE: This function does not release the memory for the dialer, so the
+application should still free the memory using
+<<nng_ipc_dialer_free.3ipc#,`nng_ipc_dialer_free(3ipc)`>>
+once it is certain that nothing else is using it.
+
+== RETURN VALUES
+
+None.
+
+== ERRORS
+
+None.
+
+== SEE ALSO
+
+[.text-left]
+<<nng_strerror.3#,nng_strerror(3)>>,
+<<nng_ipc_dialer_alloc.3ipc#,nng_ipc_dialer_alloc(3ipc)>>,
+<<nng_ipc_dialer_dial.3ipc#,nng_ipc_dialer_dial(3ipc)>>,
+<<nng_ipc_dialer_free.3ipc#,nng_ipc_dialer_free(3ipc)>>,
+<<nng_ipc_dialer.5#,nng_ipc_dialer(5)>>
diff --git a/docs/man/nng_ipc_dialer_dial.3ipc.adoc b/docs/man/nng_ipc_dialer_dial.3ipc.adoc
new file mode 100644
index 00000000..c2c18266
--- /dev/null
+++ b/docs/man/nng_ipc_dialer_dial.3ipc.adoc
@@ -0,0 +1,65 @@
+= nng_ipc_dialer_dial(3ipc)
+//
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
+// Copyright 2019 Devolutions <info@devolutions.net>
+//
+// This document 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_ipc_dialer_dial - initiate outgoing IPC connection
+
+== SYNOPSIS
+
+[source, c]
+----
+#include <nng/nng.h>
+#include <nng/supplemental/ipc/ipc.h>
+
+void nng_ipc_dialer_dial(nng_ipc_dialer *d, const nng_sockaddr *sa, nng_aio *aio);
+----
+
+== DESCRIPTION
+
+The `nng_ipc_dialer_dial()` attempts to establish an IPC connection to the
+remote peer identified by _sa_, using the dialer _d_.
+The operation is completed asynchronously, using _aio_.
+
+The address _sa_ must be in the `NNG_AF_IPC` family,
+and have a valid path for IPC.
+
+If a connection is successfully established, the _aio_ will have the
+resulting <<nng_ipc.5#,`nng_ipc`>> stored as its first output.
+(See <<nng_aio_get_output.3#,`nng_aio_get_output()`>>.)
+
+== RETURN VALUES
+
+None.
+
+== ERRORS
+
+[horizontal]
+`NNG_EADDRINVAL`:: The address specified is invalid.
+`NNG_ECANCELED`:: The operation was aborted.
+`NNG_ECLOSED`:: The dialer is closed.
+`NNG_ECONNREFUSED`:: The IPC connection was refused by the server.
+`NNG_ECONNRESET`:: The IPC connection was reset by the server.
+`NNG_ENOMEM`:: Insufficient free memory exists.
+`NNG_EPERM`:: Insufficient permission to access the IPC path.
+
+== SEE ALSO
+
+[.text-left]
+<<nng_strerror.3#,nng_strerror(3)>>,
+<<nng_ipc_dialer_alloc.3ipc#,nng_ipc_dialer_alloc(3ipc)>>,
+<<nng_ipc_dialer_close.3ipc#,nng_ipc_dialer_close(3ipc)>>,
+<<nng_ipc_dialer_free.3ipc#,nng_ipc_dialer_free(3ipc)>>,
+<<nng_aio.5#,nng_aio(5)>>,
+<<nng_sockaddr.5#,nng_sockaddr(5)>>,
+<<nng_ipc.5#,nng_ipc(5)>>,
+<<nng_ipc_dialer.5#,nng_ipc_dialer(5)>>
diff --git a/docs/man/nng_ipc_dialer_free.3ipc.adoc b/docs/man/nng_ipc_dialer_free.3ipc.adoc
new file mode 100644
index 00000000..eaf0f5a1
--- /dev/null
+++ b/docs/man/nng_ipc_dialer_free.3ipc.adoc
@@ -0,0 +1,54 @@
+= nng_ipc_dialer_free(3ipc)
+//
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
+// Copyright 2019 Devolutions <info@devolutions.net>
+//
+// This document 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_ipc_dialer_free - free IPC dialer
+
+== SYNOPSIS
+
+[source, c]
+----
+#include <nng/nng.h>
+#include <nng/supplemental/ipc/ipc.h>
+
+void nng_ipc_dialer_free(nng_ipc_dialer *d);
+----
+
+== DESCRIPTION
+
+The `nng_ipc_dialer_free()` function closes the supplied IPC dialer _d_,
+and frees the underlying resources associated with it.
+
+If any <<nng_ipc_dialer_dial.3#,dial>> operations
+ using _d_ are
+in progress, they will be terminated with an `NNG_ECLOSED` error condition.
+
+WARNING: It is important that the application ensure that no further accesses
+are made to _d_, as the memory backing it will be reclaimed for other uses.
+
+== RETURN VALUES
+
+None.
+
+== ERRORS
+
+None.
+
+== SEE ALSO
+
+[.text-left]
+<<nng_strerror.3#,nng_strerror(3)>>,
+<<nng_ipc_dialer_alloc.3ipc#,nng_ipc_dialer_alloc(3ipc)>>,
+<<nng_ipc_dialer_close.3ipc#,nng_ipc_dialer_close(3ipc)>>,
+<<nng_ipc_dialer_dial.3ipc#,nng_ipc_dialer_dial(3ipc)>>,
+<<nng_ipc_dialer.5#,nng_ipc_dialer(5)>>
diff --git a/docs/man/nng_ipc_dialer_getopt.3ipc.adoc b/docs/man/nng_ipc_dialer_getopt.3ipc.adoc
new file mode 100644
index 00000000..b6b457d0
--- /dev/null
+++ b/docs/man/nng_ipc_dialer_getopt.3ipc.adoc
@@ -0,0 +1,63 @@
+= nng_ipc_dialer_getopt(3ipc)
+//
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
+// Copyright 2019 Devolutions <info@devolutions.net>
+//
+// This document 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_ipc_dialer_getopt - get option from IPC dialer
+
+== SYNOPSIS
+
+[source, c]
+----
+#include <nng/nng.h>
+#include <nng/supplemental/ipc/ipc.h>
+
+int nng_ipc_getopt(nng_ipc_dialer *d, const char *name, void *data, size_t *sizep);
+----
+
+== DESCRIPTION
+
+The `nng_ipc_dialer_getopt()` is used to retrieve the value of the option _name_ for the <<nng_ipc_dialer.5#,IPC dialer>> _d_.
+The size of the buffer located at _data_ to receive the copy is passed by the
+caller at the location referenced by _sizep_.
+If this size is sufficient to hold the entire object, the object is copied into
+the buffer specified by _data_.
+In either event, the size of the source object (the amount of data copied,
+or that would have been copied if sufficient space were available) is stored
+at the location of _sizep_.
+
+=== Options
+
+There are no predefined options for IPC dialers at this time.
+
+== RETURN VALUES
+
+This function returns 0 on success, and non-zero otherwise.
+
+== ERRORS
+
+[horizontal]
+`NNG_ECLOSED`:: The dialer is closed.
+`NNG_EINVAL`:: There was insufficient space to receive the object.
+ The amount of data actually needed is returned in _sizep_.
+`NNG_ENOTSUP`:: The option _name_ is not supported.
+`NNG_EWRITEONLY`:: The option _name_ may not read.
+
+== SEE ALSO
+
+[.text-left]
+<<nng_ipc_dialer_setopt.3ipc#,nng_ipc_dialer_setopt(3ipc)>>,
+<<nng_ipc_getopt.3ipc#,nng_ipc_getopt(3ipc)>>,
+<<nng_options.5#,nng_options(5)>>,
+<<nng_strerror.3#,nng_strerror(3)>>,
+<<nng_ipc.5#,nng_ipc(5)>>,
+<<nng_ipc_dialer.5#,nng_ipc_dialer(5)>>
diff --git a/docs/man/nng_ipc_dialer_setopt.3ipc.adoc b/docs/man/nng_ipc_dialer_setopt.3ipc.adoc
new file mode 100644
index 00000000..6a78296f
--- /dev/null
+++ b/docs/man/nng_ipc_dialer_setopt.3ipc.adoc
@@ -0,0 +1,58 @@
+= nng_ipc_dialer_setopt(3ipc)
+//
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
+// Copyright 2019 Devolutions <info@devolutions.net>
+//
+// This document 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_ipc_dialer_setopt - set option on IPC dialer
+
+== SYNOPSIS
+
+[source, c]
+----
+#include <nng/nng.h>
+#include <nng/supplemental/ipc/ipc.h>
+
+int nng_ipc_dialer_setopt(nng_ipc_dialer *d, const char *name, const void *data, size_t size);
+----
+
+== DESCRIPTION
+
+The `nng_ipc_dialer_setopt()` is used to set the option _name_ for the
+<<nng_ipc_dialer.5#,IPC dialer>> _d_.
+The value to set is copied from _data_, which should be _size_ bytes
+in length.
+
+=== Options
+
+There are no predefined options for IPC dialers at this time.
+
+== RETURN VALUES
+
+This function returns 0 on success, and non-zero otherwise.
+
+== ERRORS
+
+[horizontal]
+`NNG_ECLOSED`:: The dialer is closed.
+`NNG_EINVAL`:: Either _data_ or _size_ are invalid.
+`NNG_ENOTSUP`:: The option _name_ is not supported.
+`NNG_EREADONLY`:: The option _name_ may not be modified.
+
+== SEE ALSO
+
+[.text-left]
+<<nng_ipc_dialer_getopt.3ipc#,nng_ipc_dialer_getopt(3ipc)>>,
+<<nng_ipc_setopt.3ipc#,nng_ipc_setopt(3ipc)>>,
+<<nng_options.5#,nng_options(5)>>,
+<<nng_strerror.3#,nng_strerror(3)>>,
+<<nng_ipc.5#,nng_ipc(5)>>,
+<<nng_ipc_dialer.5#,nng_ipc_dialer(5)>>
diff --git a/docs/man/nng_ipc_free.3ipc.adoc b/docs/man/nng_ipc_free.3ipc.adoc
new file mode 100644
index 00000000..646122a0
--- /dev/null
+++ b/docs/man/nng_ipc_free.3ipc.adoc
@@ -0,0 +1,59 @@
+= nng_ipc_free(3ipc)
+//
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
+// Copyright 2019 Devolutions <info@devolutions.net>
+//
+// This document 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_ipc_free - free IPC connection
+
+== SYNOPSIS
+
+[source, c]
+----
+#include <nng/nng.h>
+#include <nng/supplemental/ipc/ipc.h>
+
+void nng_ipc_free(nng_ipc *conn);
+----
+
+== DESCRIPTION
+
+The `nng_ipc_free()` function closes the supplied IPC connection, _conn_,
+and frees the underlying resources associated with it.
+
+If any operations are pending (such as <<nng_ipc_send.3ipc#,`nng_ipc_send()`>>
+or <<nng_ipc_recv.3ipc#,`nng_ipc_recv()`>>) they will be terminated with
+an `NNG_ECLOSED` error condition.
+
+WARNING: It is important that the application ensure that no further accesses
+are made to _conn_, as the memory backing it will be reclaimed for other uses.
+
+NOTE: Closing the connection while data is in transmission will likely
+lead to loss of that data.
+There is no automatic linger or flush to ensure that the socket send buffers
+have completely transmitted.
+
+== RETURN VALUES
+
+None.
+
+== ERRORS
+
+None.
+
+== SEE ALSO
+
+[.text-left]
+<<nng_strerror.3#,nng_strerror(3)>>,
+<<nng_ipc_close.3ipc#,nng_ipc_close(3ipc)>>,
+<<nng_ipc_recv.3ipc#,nng_ipc_recv(3ipc)>>,
+<<nng_ipc_send.3ipc#,nng_ipc_send(3ipc)>>,
+<<nng_ipc.5#,nng_ipc(5)>>
diff --git a/docs/man/nng_ipc_getopt.3ipc.adoc b/docs/man/nng_ipc_getopt.3ipc.adoc
new file mode 100644
index 00000000..1436e94f
--- /dev/null
+++ b/docs/man/nng_ipc_getopt.3ipc.adoc
@@ -0,0 +1,69 @@
+= nng_ipc_getopt(3ipc)
+//
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
+// Copyright 2019 Devolutions <info@devolutions.net>
+//
+// This document 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_ipc_getopt - get option from IPC connection
+
+== SYNOPSIS
+
+[source, c]
+----
+#include <nng/nng.h>
+#include <nng/supplemental/ipc/ipc.h>
+
+int nng_ipc_getopt(nng_ipc *conn, const char *name, void *data, size_t *sizep);
+----
+
+== DESCRIPTION
+
+The `nng_ipc_getopt()` is used to retrieve the value of the option _name_ for
+the <<nng_ipc.5#,IPC connection>> _conn_.
+The size of the buffer located at _data_ to receive the copy is passed by the
+caller at the location referenced by _sizep_.
+If this size is sufficient to hold the entire object, the object is copied into
+the buffer specified by _data_.
+In either event, the size of the source object (the amount of data copied,
+or that would have been copied if sufficient space were available) is stored
+at the location of _sizep_.
+
+=== Options
+
+The options specifically suppported for retrieval from IPC connections are:
+
+* <<nng_options.5#NNG_OPT_IPC_PEER_GID,`NNG_OPT_IPC_PEER_GID`>>
+* <<nng_options.5#NNG_OPT_IPC_PEER_PID,`NNG_OPT_IPC_PEER_PID`>>
+* <<nng_options.5#NNG_OPT_IPC_PEER_UID,`NNG_OPT_IPC_PEER_UID`>>
+* <<nng_options.5#NNG_OPT_IPC_PEER_ZONEID,`NNG_OPT_IPC_PEER_ZONEID`>>
+* <<nng_options.5#NNG_OPT_LOCADDR,`NNG_OPT_LOCADDR`>>
+* <<nng_options.5#NNG_OPT_REMADDR,`NNG_OPT_REMADDR`>>
+
+== RETURN VALUES
+
+This function returns 0 on success, and non-zero otherwise.
+
+== ERRORS
+
+[horizontal]
+`NNG_ECLOSED`:: The connection _conn_ is closed.
+`NNG_EINVAL`:: There was insufficient space to receive the object.
+ The amount of data actually needed is returned in _sizep_.
+`NNG_ENOTSUP`:: The option _name_ is not supported.
+`NNG_EWRITEONLY`:: The option _name_ may not read.
+
+== SEE ALSO
+
+[.text-left]
+<<nng_ipc_setopt.3ipc#,nng_ipc_setopt(3ipc)>>,
+<<nng_options.5#,nng_options(5)>>,
+<<nng_strerror.3#,nng_strerror(3)>>,
+<<nng_ipc.5#,nng_ipc(5)>>
diff --git a/docs/man/nng_ipc_listener.5.adoc b/docs/man/nng_ipc_listener.5.adoc
new file mode 100644
index 00000000..ba90fba3
--- /dev/null
+++ b/docs/man/nng_ipc_listener.5.adoc
@@ -0,0 +1,51 @@
+= nng_ipc_listener(5)
+//
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
+// Copyright 2019 Devolutions <info@devolutions.net>
+//
+// This document 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_ipc_listener - IPC listener
+
+== SYNOPSIS
+
+[source, c]
+----
+#include <nng/nng.h>
+#include <nng/supplemental/ipc/ipc.h>
+
+typedef struct nng_ipc_dialer_s nng_ipc_dialer;
+----
+
+== DESCRIPTION
+
+(((IPC, listener)))
+An `nng_ipc_listener` is a handle to an IPC "`listener`", which is responsible
+for accepting connections (<<nng_ipc.5#,`nng_ipc`>> objects) from remote
+systems.
+
+NOTE: The `nng_ipc_listener` object is used for raw IPC connections, and
+should not be confused with a listener object created using the
+<<nng_ipc.7#,nng_ipc(7)>> transport.
+
+TIP: Most NNG applications should not use this, but instead use the
+<<nng_ipc.7#,nng_ipc(7)>> transport instead.
+
+== SEE ALSO
+
+[.text-left]
+<<nng_ipc_listener_accept.3ipc#,nng_ipc_listener_accept(3ipc)>>,
+<<nng_ipc_listener_alloc.3ipc#,nng_ipc_listener_alloc(3ipc)>>,
+<<nng_ipc_listener_close.3ipc#,nng_ipc_listener_close(3ipc)>>,
+<<nng_ipc_listener_free.3ipc#,nng_ipc_listener_free(3ipc)>>,
+<<nng_ipc_listener_listen.3ipc#,nng_ipc_listener_listen(3ipc)>>,
+<<nng_ipc.5#,nng_ipc(5)>>,
+<<nng_ipc_dialer.5#,nng_ipc_dialer(5)>>,
+<<nng_ipc.7#,nng_ipc(7)>>
diff --git a/docs/man/nng_ipc_listener_accept.3ipc.adoc b/docs/man/nng_ipc_listener_accept.3ipc.adoc
new file mode 100644
index 00000000..b5fa7377
--- /dev/null
+++ b/docs/man/nng_ipc_listener_accept.3ipc.adoc
@@ -0,0 +1,63 @@
+= nng_ipc_listener_accept(3ipc)
+//
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
+// Copyright 2019 Devolutions <info@devolutions.net>
+//
+// This document 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_ipc_listener_accept - accept incoming IPC connection
+
+== SYNOPSIS
+
+[source, c]
+----
+#include <nng/nng.h>
+#include <nng/supplemental/ipc/ipc.h>
+
+void nng_ipc_listener_accept(nng_ipc_listener *l, nng_aio *aio);
+----
+
+== DESCRIPTION
+
+The `nng_ipc_listener_accept()` attempts to accept an incoming IPC connection
+from a remote peer, using the listener _l_.
+The operation is completed asynchronously, using _aio_.
+
+This operation can only be done after the listener is already bound to
+an IPC path and is <<nng_ipc_listener_listen.3ipc#,listening>>.
+
+If a connection is successfully established, the _aio_ will have the
+resulting <<nng_ipc.5#,`nng_ipc`>> stored as its first output.
+(See <<nng_aio_get_output.3#,`nng_aio_get_output()`>>.)
+
+== RETURN VALUES
+
+None.
+
+== ERRORS
+
+[horizontal]
+`NNG_ECANCELED`:: The operation was aborted.
+`NNG_ECLOSED`:: The listener is closed.
+`NNG_ECONNRESET`:: The IPC connection was reset by the peer.
+`NNG_ENOMEM`:: Insufficient free memory exists.
+`NNG_ESTATE`:: The listener is not not listening.
+
+== SEE ALSO
+
+[.text-left]
+<<nng_strerror.3#,nng_strerror(3)>>,
+<<nng_ipc_listener_alloc.3ipc#,nng_ipc_listener_alloc(3ipc)>>,
+<<nng_ipc_listener_close.3ipc#,nng_ipc_listener_close(3ipc)>>,
+<<nng_ipc_listener_free.3ipc#,nng_ipc_listener_free(3ipc)>>,
+<<nng_ipc_listener_listen.3ipc#,nng_ipc_listener_listen(3ipc)>>,
+<<nng_aio.5#,nng_aio(5)>>,
+<<nng_ipc.5#,nng_ipc(5)>>,
+<<nng_ipc_listener.5#,nng_ipc_listener(5)>>
diff --git a/docs/man/nng_ipc_listener_alloc.3ipc.adoc b/docs/man/nng_ipc_listener_alloc.3ipc.adoc
new file mode 100644
index 00000000..b9372bb7
--- /dev/null
+++ b/docs/man/nng_ipc_listener_alloc.3ipc.adoc
@@ -0,0 +1,50 @@
+= nng_ipc_listener_alloc(3ipc)
+//
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
+// Copyright 2019 Devolutions <info@devolutions.net>
+//
+// This document 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_ipc_listener_alloc - allocate IPC listener
+
+== SYNOPSIS
+
+[source, c]
+----
+#include <nng/nng.h>
+#include <nng/supplemental/ipc/ipc.h>
+
+int nng_ipc_listener_alloc(nng_ipc_listener *lp);
+----
+
+== DESCRIPTION
+
+The `nng_ipc_listener_alloc()` allocates an IPC listener, which can be used
+to accept incoming connections over IPC, and stores a pointer to it
+it in the location referenced by _lp_.
+
+== RETURN VALUES
+
+This function returns 0 on success, and non-zero otherwise.
+
+== ERRORS
+
+[horizontal]
+`NNG_ENOMEM`:: Insufficient free memory exists.
+
+== SEE ALSO
+
+[.text-left]
+<<nng_ipc_listener_accept.3ipc#,nng_ipc_listener_accept(3ipc)>>,
+<<nng_ipc_listener_close.3ipc#,nng_ipc_listener_close(3ipc)>>,
+<<nng_ipc_listener_free.3ipc#,nng_ipc_listener_free(3ipc)>>,
+<<nng_ipc_listener_listen.3ipc#,nng_ipc_listener_listen(3ipc)>>,
+<<nng_ipc_listener.5#,nng_ipc_listener(5)>>,
+<<nng_strerror.3#,nng_strerror(3)>>
diff --git a/docs/man/nng_ipc_listener_close.3ipc.adoc b/docs/man/nng_ipc_listener_close.3ipc.adoc
new file mode 100644
index 00000000..ba7238ae
--- /dev/null
+++ b/docs/man/nng_ipc_listener_close.3ipc.adoc
@@ -0,0 +1,57 @@
+= nng_ipc_listener_close(3ipc)
+//
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
+//
+// This document 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_ipc_listener_close - close TCP listener
+
+== SYNOPSIS
+
+[source, c]
+----
+#include <nng/nng.h>
+#include <nng/supplemental/tcp/tcp.h>
+
+void nng_ipc_listener_close(nng_ipc_listener *l);
+----
+
+== DESCRIPTION
+
+The `nng_ipc_listener_close()` function closes the supplied TCP listener _l_,
+but does not free the underlying resources associated with it.
+
+If any <<nng_ipc_listener_accept.3ipc#,accept>> operations using _l_
+are in progress, they will be terminated with an `NNG_ECLOSED` error condition.
+
+Furthermore any future accesses to the listener _l_ will also result in
+`NNG_ECLOSED`.
+
+NOTE: This function does not release the memory for the listener, so the
+application should still free the memory using
+<<nng_ipc_listener_free.3ipc#,`nng_ipc_listener_free()`>>
+once it is certain that nothing else is using it.
+
+== RETURN VALUES
+
+None.
+
+== ERRORS
+
+None.
+
+== SEE ALSO
+
+[.text-left]
+<<nng_strerror.3#,nng_strerror(3)>>,
+<<nng_ipc_listener_alloc.3ipc#,nng_ipc_listener_alloc(3ipc)>>,
+<<nng_ipc_listener_accept.3ipc#,nng_ipc_listener_accept(3ipc)>>,
+<<nng_ipc_listener_free.3ipc#,nng_ipc_listener_free(3ipc)>>,
+<<nng_ipc_listener.5#,nng_ipc_listener(5)>>
diff --git a/docs/man/nng_ipc_listener_free.3ipc.adoc b/docs/man/nng_ipc_listener_free.3ipc.adoc
new file mode 100644
index 00000000..f3b856c8
--- /dev/null
+++ b/docs/man/nng_ipc_listener_free.3ipc.adoc
@@ -0,0 +1,52 @@
+= nng_ipc_listener_free(3tcp)
+//
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
+// Copyright 2019 Devolutions <info@devolutions.net>
+//
+// This document 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_ipc_listener_free - free IPC listener
+
+== SYNOPSIS
+
+[source, c]
+----
+#include <nng/nng.h>
+#include <nng/supplemental/ipc/ipc.h>
+
+void nng_ipc_listener_free(nng_ipc_listener *l);
+----
+
+== DESCRIPTION
+
+The `nng_ipc_listener_free()` function closes the supplied IPC listener _l_,
+and frees the underlying resources associated with it.
+
+If any <<nng_ipc_listener_accept.3tcp#,accept>> operations using _l_
+are in progress, they will be terminated with an `NNG_ECLOSED` error condition.
+
+WARNING: It is important that the application ensure that no further accesses
+are made to _l_, as the memory backing it will be reclaimed for other uses.
+
+== RETURN VALUES
+
+None.
+
+== ERRORS
+
+None.
+
+== SEE ALSO
+
+[.text-left]
+<<nng_strerror.3#,nng_strerror(3)>>,
+<<nng_ipc_listener_alloc.3tcp#,nng_ipc_listener_alloc(3tcp)>>,
+<<nng_ipc_listener_close.3tcp#,nng_ipc_listener_close(3tcp)>>,
+<<nng_ipc_listener.5#,nng_ipc_listener(5)>>
diff --git a/docs/man/nng_ipc_listener_getopt.3ipc.adoc b/docs/man/nng_ipc_listener_getopt.3ipc.adoc
new file mode 100644
index 00000000..86366556
--- /dev/null
+++ b/docs/man/nng_ipc_listener_getopt.3ipc.adoc
@@ -0,0 +1,65 @@
+= nng_ipc_listener_getopt(3ipc)
+//
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
+// Copyright 2019 Devolutions <info@devolutions.net>
+//
+// This document 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_ipc_listener_getopt - get option from TCP listener
+
+== SYNOPSIS
+
+[source, c]
+----
+#include <nng/nng.h>
+#include <nng/supplemental/tcp/tcp.h>
+
+int nng_ipc_listener_getopt(nng_ipc_listener *l, const char *name, void *data, size_t *sizep);
+----
+
+== DESCRIPTION
+
+The `nng_ipc_listener_getopt()` is used to retrieve the value of the option _name_ for the <<nng_ipc_listener.5#,IPC listener>> _l_.
+The size of the buffer located at _data_ to receive the copy is passed by the
+caller at the location referenced by _sizep_.
+If this size is sufficient to hold the entire object, the object is copied into
+the buffer specified by _data_.
+In either event, the size of the source object (the amount of data copied,
+or that would have been copied if sufficient space were available) is stored
+at the location of _sizep_.
+
+=== Options
+
+The only option specifically suppported for retrieval from IPC listeners is:
+
+* <<nng_options.5#NNG_OPT_LOCADDR,`NNG_OPT_LOCADDR`>>
+
+== RETURN VALUES
+
+This function returns 0 on success, and non-zero otherwise.
+
+== ERRORS
+
+[horizontal]
+`NNG_ECLOSED`:: The dialer is closed.
+`NNG_EINVAL`:: There was insufficient space to receive the object.
+ The amount of data actually needed is returned in _sizep_.
+`NNG_ENOTSUP`:: The option _name_ is not supported.
+`NNG_EWRITEONLY`:: The option _name_ may not read.
+
+== SEE ALSO
+
+[.text-left]
+<<nng_ipc_listener_setopt.3ipc#,nng_ipc_listener_setopt(3ipc)>>,
+<<nng_ipc_getopt.3ipc#,nng_ipc_getopt(3ipc)>>,
+<<nng_options.5#,nng_options(5)>>,
+<<nng_strerror.3#,nng_strerror(3)>>,
+<<nng_ipc.5#,nng_ipc(5)>>,
+<<nng_ipc_listener.5#,nng_ipc_listener(5)>>
diff --git a/docs/man/nng_ipc_listener_listen.3ipc.adoc b/docs/man/nng_ipc_listener_listen.3ipc.adoc
new file mode 100644
index 00000000..43b29c9b
--- /dev/null
+++ b/docs/man/nng_ipc_listener_listen.3ipc.adoc
@@ -0,0 +1,56 @@
+= nng_ipc_listener_listen(3ipc)
+//
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
+// Copyright 2019 Devolutions <info@devolutions.net>
+//
+// This document 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_ipc_listener_listen - bind IPC listener
+
+== SYNOPSIS
+
+[source, c]
+----
+#include <nng/nng.h>
+#include <nng/supplemental/ipc/ipc.h>
+
+int nng_ipc_listener_listen(nng_ipc_listener l, const nng_sockaddr *sa);
+----
+
+== DESCRIPTION
+
+The `nng_ipc_listener_listen()` attempts to bind the listener _l_
+to the local address specified by _sa_, which must be in the
+`NNG_AF_IPC` address family and must have a valid IPC path.
+
+== RETURN VALUES
+
+This function returns 0 on success, and non-zero otherwise.
+
+== ERRORS
+
+[horizontal]
+`NNG_EADDRINUSE`:: The address specified by _sa_ is already in use.
+`NNG_EADDRINVAL`:: The address specified by _sa_ is invalid or unavailable.
+`NNG_ECLOSED`:: The listener _l_ has been closed.
+`NNG_EPERM`:: Insufficient permission to create the specified IPC path.
+`NNG_ESTATE`:: The listener _l_ is already bound.
+
+== SEE ALSO
+
+[.text-left]
+<<nng_strerror.3#,nng_strerror(3)>>,
+<<nng_ipc_listener_accept.3ipc#,nng_ipc_listener_accept(3ipc)>>,
+<<nng_ipc_listener_alloc.3ipc#,nng_ipc_listener_alloc(3ipc)>>,
+<<nng_ipc_listener_close.3ipc#,nng_ipc_listener_close(3ipc)>>,
+<<nng_ipc_listener_free.3ipc#,nng_ipc_listener_free(3ipc)>>,
+<<nng_ipc_listener_getopt.3ipc#,nng_ipc_listener_getopt(3ipc)>>,
+<<nng_sockaddr.5#,nng_sockaddr(5)>>,
+<<nng_ipc_listener.5#,nng_ipc_listener(5)>>
diff --git a/docs/man/nng_ipc_listener_setopt.3ipc.adoc b/docs/man/nng_ipc_listener_setopt.3ipc.adoc
new file mode 100644
index 00000000..7b4be712
--- /dev/null
+++ b/docs/man/nng_ipc_listener_setopt.3ipc.adoc
@@ -0,0 +1,63 @@
+= nng_ipc_listener_setopt(3ipc)
+//
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
+// Copyright 2019 Devolutions <info@devolutions.net>
+//
+// This document 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_ipc_listener_setopt - set option on IPC listener
+
+== SYNOPSIS
+
+[source, c]
+----
+#include <nng/nng.h>
+#include <nng/supplemental/ipc/ipc.h>
+
+int nng_ipc_listener_setopt(nng_ipc_listener *l, const char *name, const void *data, size_t size);
+----
+
+== DESCRIPTION
+
+The `nng_ipc_listener_setopt()` is used to set the option _name_ for the
+<<nng_ipc_listener.5#,IPC listener>> _l_.
+The value to set is copied from _data_, which should be _size_ bytes
+in length.
+
+=== Options
+
+The options specifically suppported for modification on IPC listeners are:
+
+* <<nng_options.5#NNG_OPT_IPC_PERMISSIONS,`NNG_OPT_IPC_PERMISSIONS`>>
+* <<nng_options.5#NNG_OPT_IPC_SECURITY_DESCRIPTOR,`NNG_OPT_IPC_SECURITY_DESCRIPTOR`>>
+
+NOTE: Availability of the above options is platform-specific.
+
+== RETURN VALUES
+
+This function returns 0 on success, and non-zero otherwise.
+
+== ERRORS
+
+[horizontal]
+`NNG_ECLOSED`:: The listener is closed.
+`NNG_EINVAL`:: Either _data_ or _size_ are invalid.
+`NNG_ENOTSUP`:: The option _name_ is not supported.
+`NNG_EREADONLY`:: The option _name_ may not be modified.
+
+== SEE ALSO
+
+[.text-left]
+<<nng_ipc_listener_getopt.3ipc#,nng_ipc_listener_getopt(3ipc)>>,
+<<nng_ipc_setopt.3ipc#,nng_ipc_setopt(3ipc)>>,
+<<nng_options.5#,nng_options(5)>>,
+<<nng_strerror.3#,nng_strerror(3)>>,
+<<nng_ipc.5#,nng_ipc(5)>>,
+<<nng_ipc_listener.5#,nng_ipc_listener(5)>>
diff --git a/docs/man/nng_ipc_recv.3ipc.adoc b/docs/man/nng_ipc_recv.3ipc.adoc
new file mode 100644
index 00000000..44ed8651
--- /dev/null
+++ b/docs/man/nng_ipc_recv.3ipc.adoc
@@ -0,0 +1,72 @@
+= nng_ipc_recv(3ipc)
+//
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
+// Copyright 2019 Devolutions <info@devolutions.net>
+//
+// This document 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_ipc_recv - receive from IPC connection
+
+== SYNOPSIS
+
+[source, c]
+----
+#include <nng/nng.h>
+#include <nng/supplemental/ipc/ipc.h>
+
+void nng_ipc_recv(nng_ipc *conn, nng_aio *aio);
+----
+
+== DESCRIPTION
+
+The `nng_ipc_recv()` function starts an asynchronous receive from the
+IPC connection _conn_, into the scatter/gather vector located in the
+asynchronous I/O structure _aio_.
+
+NOTE: The <<nng_aio_set_iov.3#,`nng_aio_set_iov()`>> function must have been
+called first, to set the scatter/gather vector for _aio_.
+
+This function returns immediately, with no return value.
+Completion of the operation is signaled via the _aio_,
+and the final result may be obtained via
+<<nng_aio_result.3#,`nng_aio_result()`>>.
+That result will either be zero or an error code.
+
+The I/O operation completes as soon as at least one byte has been
+received, or an error has occurred.
+Therefore, the number of bytes read may be less than requested.
+The actual number of bytes read can be determined with
+<<nng_aio_count.3#,`nng_aio_count()`>>.
+
+== RETURN VALUES
+
+None.
+
+== ERRORS
+
+[horizontal]
+`NNG_ECANCELED`:: The operation was canceled.
+`NNG_ECLOSED`:: The connection was closed.
+`NNG_ECONNRESET`:: The peer closed the connection.
+`NNG_EINVAL`:: The _aio_ does not contain a valid scatter/gather vector.
+`NNG_ENOMEM`:: Insufficient free memory to perform the operation.
+`NNG_ETIMEDOUT`:: Timeout waiting for data from the connection.
+
+== SEE ALSO
+
+[.text-left]
+<<nng_aio_alloc.3#,nng_aio_alloc(3)>>,
+<<nng_aio_count.3#,nng_aio_count(3)>>,
+<<nng_aio_result.3#,nng_aio_result(3)>>,
+<<nng_aio_set_iov.3#,nng_aio_set_iov(3)>>,
+<<nng_ipc_close.3ipc#,nng_ipc_close(3ipc)>>,
+<<nng_ipc_send.3ipc#,nng_ipc_send(3ipc)>>,
+<<nng_ipc.5#,nng_ipc(5)>>,
+<<nng_strerror.3#,nng_strerror(3)>>
diff --git a/docs/man/nng_ipc_send.3ipc.adoc b/docs/man/nng_ipc_send.3ipc.adoc
new file mode 100644
index 00000000..d606ddd9
--- /dev/null
+++ b/docs/man/nng_ipc_send.3ipc.adoc
@@ -0,0 +1,71 @@
+= nng_ipc_send(3ipc)
+//
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
+// Copyright 2019 Devolutions <info@devolutions.net>
+//
+// This document 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_ipc_send - send to IPC connection
+
+== SYNOPSIS
+
+[source, c]
+----
+#include <nng/nng.h>
+#include <nng/supplemental/ipc/ipc.h>
+
+void nng_ipc_send(nng_ipc *conn, nng_aio *aio);
+----
+
+== DESCRIPTION
+
+The `nng_ipc_send()` function starts an asynchronous send over the
+IPC connection _conn_ from the scatter/gather vector located in the
+asynchronous I/O structure _aio_.
+
+NOTE: The <<nng_aio_set_iov.3#,`nng_aio_set_iov()`>> function must have been
+called first, to set the scatter/gather vector for _aio_.
+
+This function returns immediately, with no return value.
+Completion of the operation is signaled via the _aio_, and the final
+result may be obtained via <<nng_aio_result.3#,`nng_aio_result()`>>.
+That result will either be zero or an error code.
+
+The I/O operation completes as soon as at least one byte has been
+sent, or an error has occurred.
+Therefore, the number of bytes sent may be less than requested.
+The actual number of bytes sent can be determined with
+<<nng_aio_count.3#,`nng_aio_count()`>>.
+
+== RETURN VALUES
+
+None.
+
+== ERRORS
+
+[horizontal]
+`NNG_ECANCELED`:: The operation was canceled.
+`NNG_ECLOSED`:: The connection was closed.
+`NNG_ECONNRESET`:: The peer closed the connection.
+`NNG_EINVAL`:: The _aio_ does not contain a valid scatter/gather vector.
+`NNG_ENOMEM`:: Insufficient free memory to perform the operation.
+`NNG_ETIMEDOUT`:: Timeout waiting for data from the connection.
+
+== SEE ALSO
+
+[.text-left]
+<<nng_aio_alloc.3#,nng_aio_alloc(3)>>,
+<<nng_aio_count.3#,nng_aio_count(3)>>,
+<<nng_aio_result.3#,nng_aio_result(3)>>,
+<<nng_aio_set_iov.3#,nng_aio_set_iov(3)>>,
+<<nng_ipc_close.3ipc#,nng_ipc_close(3ipc)>>,
+<<nng_ipc_recv.3ipc#,nng_ipc_recv(3ipc)>>,
+<<nng_ipc.5#,nng_ipc(5)>>,
+<<nng_strerror.3#,nng_strerror(3)>>
diff --git a/docs/man/nng_ipc_setopt.3ipc.adoc b/docs/man/nng_ipc_setopt.3ipc.adoc
new file mode 100644
index 00000000..86dcbc40
--- /dev/null
+++ b/docs/man/nng_ipc_setopt.3ipc.adoc
@@ -0,0 +1,56 @@
+= nng_ipc_setopt(3ipc)
+//
+// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
+// Copyright 2019 Devolutions <info@devolutions.net>
+//
+// This document 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_ipc_setopt - set option on IPC connection
+
+== SYNOPSIS
+
+[source, c]
+----
+#include <nng/nng.h>
+#include <nng/supplemental/tcp/tcp.h>
+
+int nng_ipc_setopt(nng_ipc *conn, const char *name, const void *data, size_t size);
+----
+
+== DESCRIPTION
+
+The `nng_ipc_setopt()` is used to set the option _name_ for the
+<<nng_ipc.5#,IPC connection>> _conn_.
+The value to set is copied from _data_, which should be _size_ bytes
+in length.
+
+=== Options
+
+There are no options defined for modification on IPC connections at this time.
+
+== RETURN VALUES
+
+This function returns 0 on success, and non-zero otherwise.
+
+== ERRORS
+
+[horizontal]
+`NNG_ECLOSED`:: The connection _conn_ is closed.
+`NNG_EINVAL`:: Either _data_ or _size_ are invalid.
+`NNG_ENOTSUP`:: The option _name_ is not supported.
+`NNG_EREADONLY`:: The option _name_ may not be modified.
+
+== SEE ALSO
+
+[.text-left]
+<<nng_ipc_getopt.3ipc#,nng_ipc_getopt(3ipc)>>,
+<<nng_options.5#,nng_options(5)>>,
+<<nng_strerror.3#,nng_strerror(3)>>,
+<<nng_ipc.5#,nng_ipc(5)>>
diff --git a/docs/man/nng_options.5.adoc b/docs/man/nng_options.5.adoc
index a1d19b5f..6b8a09f3 100644
--- a/docs/man/nng_options.5.adoc
+++ b/docs/man/nng_options.5.adoc
@@ -71,10 +71,11 @@ In addition to the options listed here, transports and protocols will generally
have some of their own options, which will be documented with the transport
or protocol.
-=== Options
+=== Generic Options
In the following list of options, the name of the option is supplied,
along with the data type of the underlying value.
+
Some options are only meaningful or supported in certain contexts; for
example there is no single meaningful address for a socket, since sockets
can have multiple dialers and endpoints associated with them.
@@ -319,6 +320,11 @@ This read-only option is used to obtain the name of the socket's protocol.
This read-only option is used to obtain the name of the peer protocol for
the socket.
+=== TCP Options
+
+The following options are generally application to objects making use of
+TCP/IP communications.
+
[[NNG_OPT_TCP_NODELAY]]
((`NNG_OPT_TCP_NODELAY`))::
(`bool`)
@@ -363,6 +369,84 @@ First, it can be used to detect dead peers on an otherwise quiescent network.
Second, it can be used to keep connection table entries in NAT and other
middleware from being expiring due to lack of activity.
+=== IPC Options
+
+The following options are meaningful for IPC communications.
+
+NOTE: Most of these options are platform-specific, and may not be available
+on every platform.
+
+[[NNG_OPT_IPC_PEER_GID]]((`NNG_OPT_IPC_PEER_GID`))::
+(`uint64_t`)
+This read-only option provides a connected peer's primary
+group id.
+This is the effective group id of the peer when either the underlying
+`listen()` or `connect()` calls were made, and is not forgeable.
+This option is generally only available on POSIX systems.
+
+[[NNG_OPT_IPC_PEER_PID]]((`NNG_OPT_IPC_PEER_PID`))::
+(`uint64_t`)
+This read-only option provides the the process id
+of the connected peer.
+This option is only available on Windows, Linux, and certain other systems.
++
+NOTE: Applications should not assume that the process ID does not change,
+as it is possible (although unsupported!) for a nefarious process to pass a
+file descriptor between processes.
+However, it is not possible for a nefarious application to forge the identity
+of a well-behaved one using this method.
+
+[[NNG_OPT_IPC_PEER_UID]]((`NNG_OPT_IPC_PEER_UID`))::
+(`uint64_t`)
+This read-only option provides a connected peer's user id.
+This is the effective user id of the peer when either the underlying
+`listen()` or `connect()` calls were made, and is not forgeable.
+This option is generally only available on POSIX systems.
+
+[[NNG_OPT_IPC_PEER_ZONEID]]((`NNG_OPT_IPC_PEER_ZONEID`))::
+(`uint64_t`)
+This read-only option provides a connected peer's the zone id.
+Zones (and this option) are only supported on Solaris and illumos systems.
+
+[[NNG_OPT_IPC_PERMISSIONS]]((`NNG_OPT_IPC_PERMISSIONS`))::
+(`int`)
+This write-only option may be applied to a listener to configure the
+permissions that are used on the UNIX domain socket created by that listener.
+This property is only supported on POSIX systems.
+The value is of type `int`, representing the normal permission bits
+on a file, such as `0600` (typically meaning read-write to the owner, and
+no permissions for anyone else.)
+The default is system-specific, most often `0644`.
++
+IMPORTANT: Not all systems validate these permissions.
+In particular, illumos and Solaris are known to ignore these permission
+settings when connecting.
++
+NOTE: Normally both read and write permission will be necessary for a
+peer dialer to connect.
+See your system documentation for UNIX domain sockets for more information.
++
+NOTE: The _umask_ of the process is *not* applied to these bits.
++
+TIP: The best practice for limiting access is to place the socket in a
+directory writable only by the server, and only readable and searchable
+by clients.
+All mainstream POSIX systems will fail to permit a client to connect
+to a socket located in a directory for which the client lacks search (execute)
+permission.
++
+TIP: Also consider using the `NNG_OPT_IPC_PEER_UID` property from within a
+a pipe notification callback (`<<nng_pipe_notify.3#,nng_pipe_notify()>>`)
+to validate peer credentials.
+
+[[NNG_OPT_IPC_SECURITY_DESCRIPTOR]]((`NNG_OPT_IPC_SECURITY_DESCRIPTOR`))::
+(`PSECURITY_DESCRIPTOR`)
+This write-only option may be used on listeners on Windows platforms to
+configure the `SECURITY_DESCRIPTOR` that is used when creating the underlying
+named pipe.
+The value is a pointer, `PSECURITY_DESCRIPTOR`, and may only be
+applied to listeners that have not been started yet.
+
== SEE ALSO
[.text-left]