[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Communications Technical Reference, Volume 2

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.

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

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:

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.

Implementation Specifics

The inet_Inaof subroutine is part of Base Operating System (BOS) Runtime.

All applications containing the inet_lnaof subroutine must be compiled with _BSD set to a specific value. Acceptable values are 43 and 44. In addition, all socket applications must include the BSD libbsd.a library.

Files

/etc/hosts
                          Contains host names.

Related Information

The endhostent subroutine, endnetent subroutine, gethostbyaddr subroutine, gethostbyname subroutine, getnetbyaddr subroutine, getnetbyname subroutine, getnetent subroutine, inet_addr subroutine, inet_makeaddr subroutine, inet_netof subroutine, inet_network subroutine, inet_ntoa subroutine, sethostent subroutine. setnetent subroutine.

Sockets Overview and Understanding Network Address Translation in AIX Version 4.3 Communications Programming Concepts.


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]