Oracle® Solaris 11.2 Programming Interfaces Guide

Exit Print View

Updated: July 2014
 
 

Name-to-Address Mapping

Name-to-address mapping enables an application to obtain the address of a service on a specified host independent of the transport used. Name-to-address mapping consists of the following interfaces:

netdir_getbyname(3NSL)

Maps the host and service name to a set of addresses

netdir_getbyaddr(3NSL)

Maps addresses into host and service names

netdir_free(3NSL)

Frees structures allocated by the name-to-address translation routines

taddr2uaddr(3NSL)

Translates an address and returns a transport-independent character representation of the address

uaddr2taddr(3NSL)

The universal address is translated into a netbuf structure

netdir_options(3NSL)

Interfaces to transport-specific capabilities such as the broadcast address and reserved port facilities of TCP and UDP

netdir_perror(3NSL)

Displays a message stating why one of the routines that map name-to-address failed on stderr.

netdir_sperror(3NSL)

Returns a string containing the error message stating why one of the routines that map name-to-address failed.

The first argument of each routine points to a netconfig(4) structure that describes a transport. The routine uses the array of directory-lookup library paths in the netconfig(4) structure to call each path until the translation succeeds.

The name-to-address libraries are described in Table 10–1. The routines that are described in Using the Name-to-Address Mapping Routines are defined in the netdir(3NSL) man page.


Note - The following libraries no longer exist in the Oracle Solaris environment: tcpip.so, switch.so, and nis.so. For more information on this change, see the nsswitch.conf(4) man page and the NOTES section of the gethostbyname(3NSL) man page.
Table 10-1  Name-to-Address Libraries
Library
Transport Family
Description
-
inet
The name-to-address mapping for networks of the protocol family inet is provided by the name service switch based on the entries for hosts and services in the file nsswitch.conf(4). For networks of other families, the dash indicates a nonfunctional name-to-address mapping.