From 3d916b35f2dadd17a7c9f5acd08ef396b8c8263c Mon Sep 17 00:00:00 2001 From: plutooo Date: Thu, 1 Aug 2013 11:52:13 -0700 Subject: core: getaddrinfo() lookup error handling --- core/network.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'core/network.h') 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); /* function to cleanup networking stuff(doesn't do much right now) */ void shutdown_networking(); -/* resolves provided address to a binary data in network byte order - address is ASCII null terminated string - address should represent IPv4, IPv6 or a hostname - on success returns a data in network byte order that can be used to set IP.i or IP_Port.ip.i - on failure returns -1 */ -int resolve_addr(const char *address); +/* + resolve_addr(): + address should represent IPv4 or a hostname with A record + + returns a data in network byte order that can be used to set IP.i or IP_Port.ip.i + returns 0 on failure + + TODO: Fix ipv6 support +*/ +uint32_t resolve_addr(const char *address); #ifdef __cplusplus } -- cgit v1.2.3