HP X.25/9000 Programmer's Guide
12 Chapter2
X.25 Addressing
Preparing Address Variables
Preparing Address Variables
All addressing information for both the client and server is contained in
the x25addrstr structure. This structure is defined in the include file
x25/x25addrstr.h. It is used by the client in the connect() system call
and by the server in the bind() system call. How the client and server
use these calls is described in Chapter 3 , “Establishing and Terminating
a Socket Connection.”
The x25addrstr structure consists of the following declarations:
struct x25addrstr {
unsigned short x25_family;
unsigned char x25hostlen;
unsigned char x25pidlen;
unsigned char x25pid[8];
unsigned char x25_host[16];
char x25ifname[13];
} /* x25addrstr */
x25_family Specifies the address family (which must be set to AF_CCITT) defined in
the sys/socket.h include file.
x25hostlen Specifies the length in bytes of the numeric string in the X.121 address
specified in the
x25_host
field (range: 0 to 15, including subaddress
digits).
x25pidlen Specifies the length in bytes of the character string that describes the
protocol ID data in the
x25pid
field described below. This field is not
used in connect() system calls and must be set to 0. The protocol ID
must be explicitly set in the user data field by the application (range: 0 to
8). Set this field to 0 in a bind() system call if protocol IDs are not used
in your application.
x25pid[8] Specifies the protocol ID data in a bind() system call. The protocol ID
data is located in the call-user data field of the CALL INDICATION
packet. See “Addressing Options for Servers” below.
x25_host[16] Specifies a destination X.121 address in a connect() system call with a
decimal string (digits 0-9). In a bind() system call, this field specifies the
range of X.121 addresses that it will receive with a decimal string and
(optionally) with wildcard characters (“?” and “*”). See “Addressing
36960-90061.bk Page 12 Friday, November 10, 2000 3:42 PM










