From: rofl0r Date: Wed, 19 Dec 2012 06:32:38 +0000 (+0100) Subject: add inet_network (required for wine) X-Git-Tag: v0.9.9~46^2~1 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=36d7303878a8827b706317383fc218529f432143;p=oweals%2Fmusl.git add inet_network (required for wine) --- diff --git a/include/arpa/inet.h b/include/arpa/inet.h index 92938403..fdc501aa 100644 --- a/include/arpa/inet.h +++ b/include/arpa/inet.h @@ -24,6 +24,7 @@ uint32_t ntohl(uint32_t); uint16_t ntohs(uint16_t); in_addr_t inet_addr (const char *); +in_addr_t inet_network (const char *); char *inet_ntoa (struct in_addr); int inet_pton (int, const char *__restrict, void *__restrict); const char *inet_ntop (int, const void *__restrict, char *__restrict, socklen_t); diff --git a/src/network/inet_network.c b/src/network/inet_network.c new file mode 100644 index 00000000..ae60d7f6 --- /dev/null +++ b/src/network/inet_network.c @@ -0,0 +1,11 @@ +#include +#include +#include +#include "__dns.h" + +in_addr_t inet_network(const char *p) +{ + struct sockaddr_in sin; + if (__ipparse(&sin, AF_INET, p)) return -1; + return ntohl(sin.sin_addr.s_addr); +}