home *** CD-ROM | disk | FTP | other *** search
- #include "arpa/inet.h"
- #include "netinet/in.h"
- #include "sys/byteorder.h"
-
- /*
- * Extract a network number in host byte order from a string
- */
- u_long inet_network(const char *cp)
- {
- struct in_addr net;
-
- /* Decode the address string */
- net.s_addr = inet_addr(cp);
-
- return ntohl(inet_netof(net));
- }
-