home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ARM Club 3
/
TheARMClub_PDCD3.iso
/
hensa
/
network
/
netlib_1
/
NetLibSrc
/
c
/
network
< prev
next >
Wrap
Text File
|
1995-02-28
|
304b
|
17 lines
#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));
}