aboutsummaryrefslogtreecommitdiff
path: root/src/core/platform.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-08-20 10:45:27 -0700
committerGarrett D'Amore <garrett@damore.org>2017-08-21 07:18:31 -0700
commit75adda86be49e6839e50443f0bae5875d9910897 (patch)
treee29b8b449c863be01e5f02945940dc390b239462 /src/core/platform.h
parent6305e16ab64e42fd9791819d416a6e3534439b0b (diff)
downloadnng-75adda86be49e6839e50443f0bae5875d9910897.tar.gz
nng-75adda86be49e6839e50443f0bae5875d9910897.tar.bz2
nng-75adda86be49e6839e50443f0bae5875d9910897.zip
fixes #41 Move DNS out of tcp transport
This moves the DNS related functionality into common code, and also removes all the URL parsing stuff out of the platform specific code and into the transports. Now the transports just take sockaddr's on initialization. (We may want to move this until later.) We also add UDP resolution as another separate API.
Diffstat (limited to 'src/core/platform.h')
-rw-r--r--src/core/platform.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/core/platform.h b/src/core/platform.h
index 6e049bb3..02ea9a11 100644
--- a/src/core/platform.h
+++ b/src/core/platform.h
@@ -192,8 +192,10 @@ extern void nni_plat_fini(void);
typedef struct nni_plat_tcp_ep nni_plat_tcp_ep;
typedef struct nni_plat_tcp_pipe nni_plat_tcp_pipe;
-// nni_plat_tcp_ep_init creates a new endpoint associated with the url.
-extern int nni_plat_tcp_ep_init(nni_plat_tcp_ep **, const char *, int);
+// nni_plat_tcp_ep_init creates a new endpoint associated with the local
+// and remote addresses.
+extern int nni_plat_tcp_ep_init(
+ nni_plat_tcp_ep **, const nni_sockaddr *, const nni_sockaddr *, int);
// nni_plat_tcp_ep_fini closes the endpoint and releases resources.
extern void nni_plat_tcp_ep_fini(nni_plat_tcp_ep *);
@@ -240,6 +242,11 @@ extern void nni_plat_tcp_pipe_recv(nni_plat_tcp_pipe *, nni_aio *);
extern void nni_plat_tcp_resolv(
const char *, const char *, int, int, nni_aio *);
+// nni_plat_udp_resolve is just like nni_plat_tcp_resolve, but looks up
+// service names using UDP.
+extern void nni_plat_udp_resolv(
+ const char *, const char *, int, int, nni_aio *);
+
//
// IPC (UNIX Domain Sockets & Named Pipes) Support.
//
@@ -248,7 +255,7 @@ typedef struct nni_plat_ipc_ep nni_plat_ipc_ep;
typedef struct nni_plat_ipc_pipe nni_plat_ipc_pipe;
// nni_plat_ipc_ep_init creates a new endpoint associated with the url.
-extern int nni_plat_ipc_ep_init(nni_plat_ipc_ep **, const char *, int);
+extern int nni_plat_ipc_ep_init(nni_plat_ipc_ep **, const nni_sockaddr *, int);
// nni_plat_ipc_ep_fini closes the endpoint and releases resources.
extern void nni_plat_ipc_ep_fini(nni_plat_ipc_ep *);