HP X.25/9000 Programmer's Guide
104 Chapter6
Extended Features
Getting Programmatic Diagnostics and Status Information
Getting Programmatic Diagnostics and Status
Information
Diagnostic and status information for applications that use X.25
programmatic access can be obtained using the following features:
• Error codes and log messages.
• The ioctl(X25_RD_CTI) call (to get the circuit table index entry
associated with a particular socket).
• The ioctl(X25_RD_LCI) call (to get the logical channel identifier
associated with a particular virtual circuit).
• The ioctl(X25_RD_HOSTADR) call (to get the X.121 address of the
interface).
• The ioctl(X25_GET_IFSTATE) call (to get the condition/state of the
interface).
• Remote and local address information (getpeername(2) and
getsockname(2))
Each feature is described below.
Error Codes and Log Messages
The most commonly used programmatic diagnostic is the value returned
by
errno
. Possible
errno
values returned for each call are listed in the
man pages for the call.
In addition to the error codes returned, X.25 maintains a log which
describes the activities of the interface and all active virtual circuits. For
details on logging, refer to your X.25/9000 User’s Guide.
The ioctl (X25_RD_CTI) Call
The ioctl(X25_RD_CTI) call returns the circuit table index (cti) entry
associated with a particular socket. This identifies one connection
regardless of the interface that is used. The circuit table index entry is a
sub-identification number (sid) which is also logged in strace output
(see your man pages for strace). Once you know the cti entry for a
socket, you can use that information when examining the X.25 log file for
36960-90061.bk Page 104 Friday, November 10, 2000 3:42 PM










