9 #include <sys/socket.h>
10 #include <netinet/in.h>
12 #define CLASS(x) (x[0]>>6)
15 inet_aton(char *from, struct in_addr *in)
23 to = (unsigned char*)&in->s_addr;
26 for(i = 0; i < 4 && *from; i++, from = p){
27 x = strtoul(from, &p, 0);
28 if(x != (unsigned char)x || p == from)
29 return 0; /* parse error */
34 return 0; /* parse error */
38 case 0: /* class A - 1 byte net */
49 case 2: /* class B - 2 byte net */