HP X.25/9000 Programmer's Guide
80 Chapter5
Receiving and Transmitting Out-of-band Information
Transmitting Out-of-band Events
diag Indicates the cause and diagnostic codes to be sent.
err On successful completion,
err
is set to 0. Otherwise, a value of –1 is
returned and
errno
is set to indicate the error.
The ioctl(X25_WR_USER_DATA) Call
The ioctl(X25_WR_USER_DATA) call is used to write data to the user
data fields in CLEAR REQUEST, CALL REQUEST, and CALL
ACCEPTED packets. Call acceptance must be in effect beforethe call can
be used on a CALL ACCEPTED packet. You can use this call in any of
the following three situations:
• Before issuing a connect() call (to write call user data to the CALL
REQUEST packet).
• Before issuing an ioctl(X25_SEND_CALL_ACEPT)call when
call-accept approval is in effect on the listen() socket (to write call
user data to the CALL ACCEPTED packet).
• Before issuing a close() call (to write clear user data to the CLEAR
REQUEST packet, when the fast select facility must be in effect), or
shutdown() with the
how
parameter set to 1 or 2.
NOTE The call user data field in CALL REQUEST and CALL ACCEPTED
packets can be up to 16 bytes unless the fast select facility is specified.
When the fast select facility is specified, the call user data field in CALL
REQUEST and CALL ACCEPTED packets and the clear user data field
of a CLEAR REQUEST packet can contain up to 128 bytes of data.
The ioctl(X25_RD_USER_DATA) call cannot be used to read data
previously written with the ioctl(X25_WR_USER_DATA) call.
Syntax for ioctl(X25_WR_USER_DATA)
The ioctl(X25_WR_USER_DATA) call and its parameters are described
below.
#include <x25/x25ioctls.h>
#include <x25/x25str.h>
/* define X25_MAX_CU_LEN 126
* struct x25_userdata {
* u_char x25_cud_len;
36960-90061.bk Page 80 Friday, November 10, 2000 3:42 PM










