1 #include <sys/socket.h>
9 int inet_pton(int af, const char *s, void *a0)
11 unsigned char *a = a0;
16 /* Reimplement this because inet_pton cannot accept special v4 forms */
18 for (i=0; i<4 && *s; i++) {
19 a[i] = x = strtoul(s, (char **)&z, 10);
20 if (!isdigit(*s) || z==s || (*z && *z != '.') || x>255)
25 } else if (af==AF_INET6) {
26 return !__ipparse(a, AF_INET6, s);