Network Interface Guide

How Transport Selection Works

The transport selection component is built around:

The NETPATH variable is set by the user; it contains an ordered list of transport identifiers. The transport identifiers match the netconfig network ID field and are links to records in the netconfig(4) file. The netconfig(4) file is described in "/etc/netconfig File". The network selection interface is a set of access routines for the network-configuration database.

One set of library routines accesses only the /etc/netconfig entries identified by the NETPATH environment variable:

setnetpath(3NSL)Initializes the search of NETPATH
getnetpath(3NSL)Returns a pointer to the netconfig(4) entry that corresponds to the next component of the NETPATH variable
endnetpath(3NSL)Releases the database pointer to elements in the NETPATH variable when processing is complete

These routines are described in "NETPATH Access to netconfig(4) Data" and in getnetpath(3NSL). They let the user influence the selection of transports used by the application.

To avoid user influence on transport selection, use the routines that access the netconfig(4) database directly. These routines are described in "Accessing netconfig(4)" and in getnetconfig(3NSL):

setnetconfig(3NSL) Initializes the record pointer to the first index in the database
getnetconfig(3NSL)Returns a pointer to the current record in the netconfig(4) database and increments the pointer to the next record
endnetconfig(3NSL) Releases the database pointer when processing is complete

The following two routines manipulate netconfig(4) entries and the data structures they represent. These routines are described in "Accessing netconfig(4)":

getnetconfigent(3NSL)Returns a pointer to the struct netconfig structure corresponding to netid
freenetconfigent(3NSL)Frees the structure returned by getnetconfigent(3NSL)