1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> in_addr_t inet_addr(const char *p) { struct in_addr a; if (!__inet_aton(p, &a)) return -1; return a.s_addr; } #ifdef TEST int main(void) { return 0; } #endif