xref: /haiku/src/system/libnetwork/musl/network/inet_addr.c (revision cbf71a819fd6ceaa0d813b5956060516cf0d842a)
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 Cavalier in_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