Manual Page Result
0
Command: internet | Section: 3 | Source: UNIX v10 | File: internet.3
INTERNET(3X) INTERNET(3X)
NAME
in_host, in_ntoa, in_address, in_service - internet networking func-
tions
SYNOPSIS
#include <sys/inet/in.h>
char *in_host(hostaddr)
in_addr hostaddr;
char *in_ntoa(hostaddr)
in_addr hostaddr;
in_addr in_address(hostname)
char *hostname;
struct in_service *in_service(name, proto, port)
char *name, *proto;
unsigned long port;
DESCRIPTION
These routines are loaded by the -lin option of ld(1).
Internet addresses, type in_addr, are 32-bit quantities global to the
network. The ASCII representation of an in_addr can be either a host
name or of the form b1.b2.b3.b4, where each `bx' is the value of the
x'th byte of the address in decimal. Since host names are considered
local `aliases' for internet addresses, the host-to-address mapping is
subjective.
In_address maps an internet host name to an address and returns 0 if
the name is not found in the host table.
In_host maps an internet address into a host name. If the host is not
found in the host table, the ASCII representation of the address is re-
turned.
In_ntoa maps an internet address to its ASCII numeric format.
In_service returns the closest match to name in the services file. If
either name or port are 0, they will match any name or port. If proto
is (char *)0, the tcp protocol is assumed.
FILES
/usr/inet/lib/hosts mapping between host names and addresses
/usr/inet/lib/networks mapping between network names and addresses
/usr/inet/lib/services database of services
/usr/inet/lib/hosts.equiv machines with common administration
SEE ALSO
ipc(3), tcp(3), udp(3)
BUGS
The mappings between internet addresses and names is arbitrary at best.
The hosts file may contain many addresses for each name and/or many
names for each address. In_address and in_host each start at the be-
ginning of the file and search sequentially for a match. Therefore,
in_addr(in_host(addr)) == addr is not necessarily true.
INTERNET(3X)