2 * Acess2 POSIX Sockets Library
3 * - By John Hodge (thePowersGang)
6 * - inet_pton/inet_ntop
8 #include <netinet/in.h>
9 #include <net.h> // Net_PrintAddress
10 #include <acess/sys.h> // _SysDebug
14 int inet_pton(int af, const char *src, void *dst)
16 _SysDebug("TODO: inet_pton");
20 const char *inet_ntop(int af, const void *src, char *dest, size_t len)
22 const char *str = NULL;
26 str = Net_PrintAddress(4, &((const struct in_addr*)src)->s_addr);
29 str = Net_PrintAddress(6, &((const struct in6_addr*)src)->s6_addr);
35 strncpy(dest, str, len);
39 char *inet_ntoa(struct in_addr in)
41 return Net_PrintAddress(4, &in.s_addr);