From: John Hodge Date: Sun, 9 Mar 2014 07:26:45 +0000 (+0800) Subject: Usermode/libpsocket - Minor fixes X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=ec198418bc1ae2ce70b1ea8a4c4db75f4973df3b;p=tpg%2Facess2.git Usermode/libpsocket - Minor fixes --- diff --git a/Usermode/Libraries/libpsocket.so_src/include_exp/sys/socket.h b/Usermode/Libraries/libpsocket.so_src/include_exp/sys/socket.h index d9ce4ecd..9c3e3bda 100644 --- a/Usermode/Libraries/libpsocket.so_src/include_exp/sys/socket.h +++ b/Usermode/Libraries/libpsocket.so_src/include_exp/sys/socket.h @@ -20,7 +20,7 @@ extern "C" { typedef uint32_t socklen_t; -typedef enum +enum { AF_UNSPEC = 0, AF_PACKET = 1, diff --git a/Usermode/Libraries/libpsocket.so_src/pton.c b/Usermode/Libraries/libpsocket.so_src/pton.c index 581c4f1c..1ae69c44 100644 --- a/Usermode/Libraries/libpsocket.so_src/pton.c +++ b/Usermode/Libraries/libpsocket.so_src/pton.c @@ -8,6 +8,7 @@ #include #include // Net_PrintAddress #include // _SysDebug +#include // === CODE === int inet_pton(int af, const char *src, void *dst) @@ -22,7 +23,7 @@ const char *inet_ntop(int af, const void *src, char *dest, size_t len) switch(af) { case AF_INET: - str = Net_PrintAddress(4, ((struct in_addr*)src)->s_addr); + str = Net_PrintAddress(4, &((struct in_addr*)src)->s_addr); break; case AF_INET6: str = Net_PrintAddress(6, ((struct in6_addr*)src)->s6_addr); @@ -35,3 +36,8 @@ const char *inet_ntop(int af, const void *src, char *dest, size_t len) return dest; } +char *inet_ntoa(struct in_addr in) +{ + return Net_PrintAddress(4, &in.s_addr); +} +