DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Network services

The name-to-address mapping libraries

Files for each of the libraries must be created and maintained by the system administrator.

The tcpip.so library

The routines in this dynamic library create addresses from the /etc/hosts and /etc/services files available with the TCP/IP package. The /etc/hosts file contains two fields, the machine's IP address and the machine name. For example:

#IP address         machine name(s)
#
192.11.108.01       bilbo
192.11.108.16       elvis
192.11.103.2        wombat
The /etc/services file contains two fields, a service name and a port number with one of two protocol specifications, either tcp or udp. For example:
#service name port number
#
rpcbind             111/udp
rpcbind             111/tcp
login               513/tcp
listen              1025/tcp
When an application uses this library to request the address of a service on a particular host, the host name must appear in the /etc/hosts file and the service name must appear in the /etc/services file. If one or the other does not appear, an error will be returned by the name-to-address mapping routines.

The straddr.so library

The routines in this dynamic library create addresses from files that have the same format as the tcpip.so files described above. The straddr.so files are /etc/net/transport/hosts and /etc/net/transport/services. transport is the local name of the transport provider that accepts string addresses (specified in the ``network ID'' field of the /etc/netconfig file). For example, the host file for starlan would be /etc/net/starlan/hosts, and the service file for starlan would be /etc/net/starlan/services. For starlandg, the files would be /etc/net/starlandg/hosts and /etc/net/starlandg/services.

Even though most string addresses do not distinguish between host and service, separating the string into a host part and a service part provides consistency with other transport providers. The /etc/net/transport/hosts file will therefore contain a string that is considered to be the machine address, followed by the machine name. For example:

#machine addr   machine name
#
bilboaddr       bilbo
elvisaddr       elvis
frodoaddr       frodo

Sample /etc/net/transport/hosts File

The /etc/net/transport/services file contains service names followed by strings identifying the service ports. For example:

#service name  service port
#
rpcbind        rpc
listen         serve

Sample /etc/net/transport/services File

The routines create the full string address by combining the host address and the service port, separating the two with a ``.''. For example, the address of the listen service on bilbo would be bilboaddr.serve, and the address of the rpcbind service on bilbo would be bilboaddr.rpc.

When an application requests the address of a service on a particular host on a transport provider that uses this library, the host name must appear in /etc/net/transport/hosts and the service name must appear in /etc/net/transport/services. If one or the other does not appear, the name-to-address mapping routines will return an error.


© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005