Usermode/libpsocket - Minor fixes
authorJohn Hodge <[email protected]>
Sun, 9 Mar 2014 07:26:45 +0000 (15:26 +0800)
committerJohn Hodge <[email protected]>
Sun, 9 Mar 2014 07:26:45 +0000 (15:26 +0800)
Usermode/Libraries/libpsocket.so_src/include_exp/sys/socket.h
Usermode/Libraries/libpsocket.so_src/pton.c

index d9ce4ec..9c3e3bd 100644 (file)
@@ -20,7 +20,7 @@ extern "C" {
 
 typedef uint32_t       socklen_t;
 
-typedef enum
+enum
 {
        AF_UNSPEC       = 0,
        AF_PACKET       = 1,
index 581c4f1..1ae69c4 100644 (file)
@@ -8,6 +8,7 @@
 #include <netinet/in.h>
 #include <net.h>       // Net_PrintAddress
 #include <acess/sys.h> // _SysDebug
+#include <string.h>
 
 // === 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);
+}
+

UCC git Repository :: git.ucc.asn.au