1*cbf71a81SAugustin Cavalier #include <sys/socket.h> 2*cbf71a81SAugustin Cavalier #include <netinet/in.h> 3*cbf71a81SAugustin Cavalier #include <arpa/inet.h> 4*cbf71a81SAugustin Cavalier inet_addr(const char * p)5*cbf71a81SAugustin Cavalierin_addr_t inet_addr(const char *p) 6*cbf71a81SAugustin Cavalier { 7*cbf71a81SAugustin Cavalier struct in_addr a; 8*cbf71a81SAugustin Cavalier if (!inet_aton(p, &a)) return -1; 9*cbf71a81SAugustin Cavalier return a.s_addr; 10*cbf71a81SAugustin Cavalier } 11