HP X.25/9000 Programmer's Guide
Chapter 6 107
Extended Features
Getting Programmatic Diagnostics and Status Information
down.
X25_RD_HOSTAD
R
Definition for the request.
addr Indicates the X.25 interface name.
x25_family
must be set to
AF_CCITT.
x25ifname
must be set to a name string (with “\0” at the
end). The address is returned in x25hostl() and
x25hostlen
.
x25ifname
can be an empty string, but this is only advisable when there
is only one interface on the system; the interface address returned is
unpredictable when there are several interfaces.
error Set to 0 if the call was successful. Otherwise, it contains –1 and
errno
contains the cause of the error.
A programming example is shown below.
/* Get X.25 parameters used for binding an address */
result = ioctl( call_soc, X25_RD_HOSTADR, &locl_addr);
if (result == -1) {
perror(”ioctl(X25_RD_HOSTADR) call”);
exit(1);
}
The ioctl (X25_GET_IFSTATE) Call
The ioctl(X25_GET_IFSTATE) call returns the interface state.
Syntax for ioctl (X25_GET_IFSTATE)
#include <x25/x25ioctls.h>
#include <x25/x25str.h>
#include <x25/x25.h>
/*
* Define data structure for X25_GET_IFSTATE
*/
/* struct x25_state_str {
* char ifname[X25_MAX_IFNAMELEN+1];/* Name of X.25
interface to use */
* int ifstate; /* Status of the X.25 interface */
* };
*/
int error;
int sd;
struct x25_state_str state_str;
36960-90061.bk Page 107 Friday, November 10, 2000 3:42 PM










