Returns the host ID of an Internet address.
Standard C Library (libc.a)
#include <sys/socket.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
int inet_Inaof ( InternetAddr)
struct in_addr InternetAddr;
The inet_lnaof subroutine masks off the host ID of an Internet address based on the Internet address class. The calling application must enter the Internet address as an unsigned long value.
All applications containing the inet_lnaof subroutine must be compiled with the _BSD macro set to a specific value. Acceptable values are 43 and 44. In addition, all socket applications must include the BSD libbsd.a library.
Item | Description |
---|---|
InternetAddr | Specifies the Internet address to separate. |
The return values of the inet_lnaof subroutine depend on the class of Internet address the application provides:
Value | Description |
---|---|
Class A | The logical product of the Internet address and 0x00FFFFFF. |
Class B | The logical product of the Internet address and 0x0000FFFF. |
Class C | The logical product of the Internet address and 0x000000FF. |
Item | Description |
---|---|
/etc/hosts | Contains host names. |