[Top] [Prev] [Next]

cs

cs - connection server daemon

Synopsis

cs

Description

The connection server daemon, cs, is started by the cs command. The daemon monitors requests for interpretation of host names written by application programs to /net/cs, the interface file. After writing the request, the application reads that same file to obtain the response from the cs daemon.

The current implementation uses the hosting system's facilities for name-to-address and other conversions.

Request Format

Requests must be strings in the form:

	net!machine!service

Each component of the request is required.
net

The net component defines the network to be used (e.g., "tcp", "udp").

The special value "net" can be supplied to request the most expedient network. Currently, "net" is synonymous with "tcp".

machine

The machine component can be any of the following

numeric internet address

Used verbatim.

hostname

Converted to network address.

symbolic server name of the form $server

Converted to hostname by reference to the connection server database file /services/cs/db.

The hostname returned is then converted to an network address.

*

No machine name is converted. Other conversions (e.g., "net" and named services) are still done.

service

A service name or port number.

numeric port value

Used verbatim.

Service name

Converted to a port number.

Response Format

The application can obtain the converted address by reading the /net/cs interface file. The response will consist of two fields of the form:

	/net/net/clone			ipaddr!portno

The first field is the name of the file to open to reserve a connection on Inferno's IP device. The second field can be used to construct a "connect" message for the ctl file returned by the open of clone.

Note

The service name to port number conversion is controlled by a <services> file. The location of that file is platform dependent:
/etc/services

Unix-hosted systems.

Windows\services

Windows-hosted systems

Caveats

Applications that use a single file descriptor for both reading and writing should take care to reset the file offset to 0 between writing the request and reading the response. Otherwise, a truncated response will be read. Applications using buffered I/O should flush after resetting the offset.

Sometimes a hostname will resolve into several network addresses. The connection server provides all. Each read of /net/cs delivers one. The connection server caches this information until read; consequently, the application is obliged to read /net/cs in a loop until the end-of-file condition is reached. That means that all available addresses have been obtained and the daemon's cache (for this request) is empty.

See Also
cs

Starting the connection server daemon.

seek

Managing file offset.

srv

Interface to host's functions for name-to-address and service-to-portnumber conversions

ip

See description of clone file, ctl file, and "connect iaddr" message for the IP device.

Format Specifications

Description of connection server data base.



[Top] [Prev] [Next]

infernosupport@lucent.com
Copyright © 1996,Lucent Technologies, Inc. All rights reserved.