The inet_netof() call returns the network number portion of the internet host address in network-byte order.
Syntax
#include <types.h> #include <arpa\inet.h> u_long inet_netof(in) struct in_addr in;
Parameters
in
Description
The inet_netof() call returns the network number from the specified internet address number, typed as unsigned long value. The inet_netof() call masks off the network number and the host number from the internet address, based on the internet address class.
Note: The application assumes responsibility for verifying that the network number and the host number for the internet address conforms to a class A or B or C internet address. The inet_netof() call processes any other class of address as a class C address.
Return Values
The network number is returned in host-byte order. The return value points to static data that subsequent API calls can modify.
When successful, the inet_netof() call returns a network number from the specified long value representing the internet address. If the application gives a class A internet address, the inet_lnoaf() call returns the logical product of the internet address and 0xFF000000. If the application gives a class B internet address, the inet_lnoaf() call returns the logical product of the internet address and 0xFFFF0000. If the application does not give a class A or B internet address, the inet_lnoaf() call returns the logical product of the internet address and 0xFFFFFF00.
Related Calls
endhostent() endnetent()
gethostbyaddr()
gethostbyname()
getnetbyaddr()
getnetbyname()
getnetent()
inet_addr()
inet_lnaof()
inet_makeaddr()
inet_network()
inet_ntoa()
sethostent()
setnetent()