aboutsummaryrefslogtreecommitdiff
path: root/src/core/platform.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-03-04 17:04:11 -0800
committerGarrett D'Amore <garrett@damore.org>2018-03-04 19:42:17 -0800
commit23a38d766780f4749945d84316b4e0a71e707b15 (patch)
tree336cf1bfc7c7e32999653a4c4014232d2b735a3e /src/core/platform.h
parent0094f83a9e3b54d6cbfc1ea1885036366b87b991 (diff)
downloadnng-23a38d766780f4749945d84316b4e0a71e707b15.tar.gz
nng-23a38d766780f4749945d84316b4e0a71e707b15.tar.bz2
nng-23a38d766780f4749945d84316b4e0a71e707b15.zip
fixes #262 NNG_OPT_URL should be resolved
This causes TCP, TLS, and ZT endpoints to resolve any wildcards, and even IP addresses, when reporting the listen URL. The dialer URL is reported unresolved. Test cases for this are added as well, and nngcat actually reports this if --verbose is supplied.
Diffstat (limited to 'src/core/platform.h')
-rw-r--r--src/core/platform.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core/platform.h b/src/core/platform.h
index cf635f4a..3f336f11 100644
--- a/src/core/platform.h
+++ b/src/core/platform.h
@@ -207,7 +207,7 @@ extern void nni_plat_tcp_ep_close(nni_plat_tcp_ep *);
// nni_plat_tcp_listen creates an TCP socket in listening mode, bound
// to the specified path.
-extern int nni_plat_tcp_ep_listen(nni_plat_tcp_ep *);
+extern int nni_plat_tcp_ep_listen(nni_plat_tcp_ep *, nni_sockaddr *);
// nni_plat_tcp_ep_accept starts an accept to receive an incoming connection.
// An accepted connection will be passed back in the a_pipe member.
@@ -248,6 +248,12 @@ extern int nni_plat_tcp_pipe_peername(nni_plat_tcp_pipe *, nni_sockaddr *);
// nni_plat_tcp_pipe_sockname gets the local name.
extern int nni_plat_tcp_pipe_sockname(nni_plat_tcp_pipe *, nni_sockaddr *);
+// nni_plat_tcp_ntop obtains the IP address for the socket (enclosing it
+// in brackets if it is IPv6) and port. Enough space for both must
+// be present (48 bytes and 6 bytes each), although if either is NULL then
+// those components are skipped.
+extern int nni_plat_tcp_ntop(const nni_sockaddr *, char *, char *);
+
// nni_plat_tcp_resolv resolves a TCP name asynchronously. The family
// should be one of NNG_AF_INET, NNG_AF_INET6, or NNG_AF_UNSPEC. The
// first two constrain the name to those families, while the third will