DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Developing applications using XTI or TLI

Transport-specific issues

Although XTI is a transport-independent programming interface, some areas that a network program must confront lie outside the scope of XTI. Two such areas are transport addresses and options management. Address formats and available options vary from transport provider to transport provider. While XTI provides a generic mechanism for assigning and retrieving address and options information, it is up to the software developer to code the specific details appropriate to each transport provider. These details will have to be recoded when the program is ported to use a different transport provider.

Similarly, each transport provider protocol structures internal information differently. For example, a transport provider stores network addresses, host ids, and local process ids as integers. The byte order used by the transport protocol need not be the same as that used by the host machine. Consequently, the transport provider may support transport-specific library routines to convert integers from the host format to the transport provider's format and back again. The socket library functions htons and ntohs are two examples of this.

The transport provider may also support various utility functions that are specific to that transport protocol. For example, the TCP/IP protocol encodes network addresses and host ids as four bytes, where each byte is an unsigned integer. However, programs typically denote these addresses as dotted quads (four decimal numbers separated by periods). A utility function is available for use with TCP/IP to convert a dotted quad into the integer encoding.

Each transport provider can also define its own mechanism to allow programs to refer to host ids or local process ids with symbolic names, rather than numbers. The defined mechanism converts the symbolic name into the appropriate numeric value. For example, the TCP/IP protocol defines a file called /etc/services. A server process that is to be known on the network by a certain name can look up that name in this file to determine the local process id (in this case, the port number) it should specify when calling t_bind. Again, a utility function exists to facilitate this lookup.

It is the responsibility of the software developer to include the appropriate transport-specific header files and libraries. These files and libraries define transport-specific address formats and utility functions. To obtain this kind of information, read the appropriate chapter in this Guide that describes how to use XTI or TLI over the specific transport provider you will use in your application


Next topic: Pseudo-code examples
Previous topic: XTI and sockets

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003