Programming Interfaces Guide

straddr.so Library

Name–to–address translation files for the straddr.so library are created by the system administrator. The system administrator also maintains these translation files. The straddr.so files are /etc/net/transport-name/hosts and /etc/net/transport-name/services. transport-name is the local name of the transport that accepts string addresses, which is specified in the network ID field of the /etc/netconfig file. For example, the host file for ticlts would be /etc/net/ticlts/hosts, and the service file for ticlts would be /etc/net/ticlts/services.

Most string addresses do not distinguish between host and service. However, separating the string into a host part and a service part is consistent with other transports. The /etc/net/transport-name/hosts file contains a text string that is assumed to be the host address, followed by the host name:

joyluckaddr

joyluck

carpediemaddr

carpediem

thehopaddr

thehop

pongoaddr

pongo

Because loopback transports cannot go outside the containing host, listing other hosts makes no sense.

The /etc/net/transport-name/services file contains service names followed by strings that identify the service address:


rpcbind	rpc
listen	serve

The routines create the full-string address by concatenating the host address, a period (.), and the service address. For example, the address of the listen service on pongo is pongoaddr.serve.

When an application requests the address of a service on a particular host on a transport that uses this library, the host name must be in /etc/net/transport/hosts. The service name must be in /etc/net/transport/services. If either name is missing, the name-to-address translation fails.