about summary refs log tree commit
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-06-01 21:00:00 +0000
committerEric Wong <normalperson@yhbt.net>2011-06-02 16:55:20 +0000
commitb23c5ea4159a16907745ea348af0a88f7ee5405b (patch)
treee8137c11ee3c86670ead41a64841d4e0b52efe5e
parent86be024b138239f1c802a95934155ab4e8d01b64 (diff)
downloadrpatricia-b23c5ea4159a16907745ea348af0a88f7ee5405b.tar.gz
remove inet_pton() substitute
It's standardized in POSIX.1-2001
-rw-r--r--ext/rpatricia/patricia.c37
1 files changed, 0 insertions, 37 deletions
diff --git a/ext/rpatricia/patricia.c b/ext/rpatricia/patricia.c
index 7fc3d27..ebd7999 100644
--- a/ext/rpatricia/patricia.c
+++ b/ext/rpatricia/patricia.c
@@ -67,43 +67,6 @@ comp_with_mask (void *addr, void *dest, u_int mask)
     return (0);
 }
 
-/* inet_pton substitute implementation
- * Uses inet_addr to convert an IP address in dotted decimal notation into
- * unsigned long and copies the result to dst.
- * Only supports AF_INET.  Follows standard error return conventions of
- * inet_pton.
- */
-int
-inet_pton (int af, const char *src, void *dst)
-{
-    u_long result;  
-
-    if (af == AF_INET) {
-        result = inet_addr(src);
-        if (result == -1)
-            return 0;
-        else {
-                        memcpy (dst, &result, 4);
-            return 1;
-                }
-        }
-#ifdef NT
-#ifdef HAVE_IPV6
-        else if (af == AF_INET6) {
-                struct in6_addr Address;
-                return (inet6_addr(src, &Address));
-        }
-#endif /* HAVE_IPV6 */
-#endif /* NT */
-#ifndef NT
-    else {
-
-        errno = EAFNOSUPPORT;
-        return -1;
-    }
-#endif /* NT */
-}
-
 /* this allows imcomplete prefix */
 int
 my_inet_pton (int af, const char *src, void *dst)