#define INADDRSZ 4
#define INT16SZ 2
-#ifndef AF_INET6
-#define AF_INET6 AF_MAX+1 /* just to let this compile */
-#endif
-
#ifdef WIN32
#define EAFNOSUPPORT WSAEAFNOSUPPORT
#endif
*/
static int inet_pton4(const char *src, unsigned char *dst);
+#ifdef ENABLE_IPV6
static int inet_pton6(const char *src, unsigned char *dst);
+#endif
/* int
* inet_pton(af, src, dst)
switch (af) {
case AF_INET:
return (inet_pton4(src, dst));
+#ifdef ENABLE_IPV6
+#ifndef AF_INET6
+#define AF_INET6 AF_MAX+1 /* just to let this compile */
+#endif
case AF_INET6:
return (inet_pton6(src, dst));
+#endif
default:
errno = EAFNOSUPPORT;
return (-1);
return (1);
}
+#ifdef ENABLE_IPV6
/* int
* inet_pton6(src, dst)
* convert presentation level address to network order binary form.
memcpy(dst, tmp, IN6ADDRSZ);
return (1);
}
+#endif /* ENABLE_IPV6 */
#endif /* HAVE_INET_PTON */