Transport Interfaces Programming Guide

straddr.so Library

Name-to-address translation files for the library are created and maintained by the system administrator. 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 (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.

Even though most string addresses do not distinguish between host and service, 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. For example:


joyluckaddr	joyluck
carpediemaddr	carpediem
thehopaddr	thehop
pongoaddr	pongo

For loopback transports, it makes no sense to list other hosts because the service cannot go outside the containing host.

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


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, and the service name must be in /etc/net/transport/services. If either is missing, the name-to-address translation fails.