diff options
author | rofl0r <retnyg@gmx.net> | 2012-12-19 07:32:38 +0100 |
---|---|---|
committer | rofl0r <retnyg@gmx.net> | 2012-12-19 07:32:38 +0100 |
commit | 36d7303878a8827b706317383fc218529f432143 (patch) | |
tree | e0cbd314a58fe477d833f1538c39a08b41514028 | |
parent | 3bb167b33818b3ac569f73a2ff82ff1ab3b04c4a (diff) | |
download | musl-36d7303878a8827b706317383fc218529f432143.tar.gz |
add inet_network (required for wine)
-rw-r--r-- | include/arpa/inet.h | 1 | ||||
-rw-r--r-- | src/network/inet_network.c | 11 |
2 files changed, 12 insertions, 0 deletions
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 <sys/socket.h> +#include <netinet/in.h> +#include <arpa/inet.h> +#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); +} |