home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************
- *
- * $Source$
- * $Date$
- * $Revision$
- * $State$
- * $Author$
- *
- * $Log$
- ***************************************************************************/
-
- static const char rcs_id[] = "$Id$";
-
- #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));
- }
-