summaryrefslogtreecommitdiff
path: root/core/network.h
diff options
context:
space:
mode:
authorplutooo <tfy12vbr@student.lu.se>2013-08-01 11:52:13 -0700
committerplutooo <tfy12vbr@student.lu.se>2013-08-01 11:54:06 -0700
commit3d916b35f2dadd17a7c9f5acd08ef396b8c8263c (patch)
treecf0fcbc0a51c0c02e4949e3cd4e8822b41bf5af8 /core/network.h
parentd534a052648cc0085d6d6e40c22701e2feb5b416 (diff)
core: getaddrinfo() lookup error handling
Diffstat (limited to 'core/network.h')
-rw-r--r--core/network.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/core/network.h b/core/network.h
index 3277070c..a5f7899b 100644
--- a/core/network.h
+++ b/core/network.h
@@ -116,12 +116,16 @@ int init_networking(IP ip, uint16_t port);
116/* function to cleanup networking stuff(doesn't do much right now) */ 116/* function to cleanup networking stuff(doesn't do much right now) */
117void shutdown_networking(); 117void shutdown_networking();
118 118
119/* resolves provided address to a binary data in network byte order 119/*
120 address is ASCII null terminated string 120 resolve_addr():
121 address should represent IPv4, IPv6 or a hostname 121 address should represent IPv4 or a hostname with A record
122 on success returns a data in network byte order that can be used to set IP.i or IP_Port.ip.i 122
123 on failure returns -1 */ 123 returns a data in network byte order that can be used to set IP.i or IP_Port.ip.i
124int resolve_addr(const char *address); 124 returns 0 on failure
125
126 TODO: Fix ipv6 support
127*/
128uint32_t resolve_addr(const char *address);
125 129
126#ifdef __cplusplus 130#ifdef __cplusplus
127} 131}