inet_lnaof Subroutine

Purpose

Returns the host ID of an Internet address.

Library

Standard C Library (libc.a)

Syntax

#include <sys/socket.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

int inet_Inaof ( InternetAddr)
struct in_addr InternetAddr;

Description

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.

Note: The application must verify that the network and host IDs for the Internet address conform to either a Class A, B, or C Internet address. The inet_lnaof subroutine processes any other number as a Class C address.

Parameters

Item Description
InternetAddr Specifies the Internet address to separate.

Return Values

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.

Files

Item Description
 /etc/hosts Contains host names.