HP X.25/9000 Programmer's Guide

84 Chapter5
Receiving and Transmitting Out-of-band Information
Transmitting Out-of-band Events
}
if (userdata.x25_cud_len == 0)
break;
for (i = 0; i < userdata.x25_cud_len; i++)
clear_udata[clear_ndata++] =
userdata.x25_cu_data[i];
}
else break;
}
/*
* If error = 0 at this point all of the clear data is now
in “clear_udata”.
* “clear_ndata” gives the number of bytes of data.
*/
Resetting a Virtual Circuit
This section describes how to send RESET packets. A RESET packet
clears all data on a connection, including any inbound data queued but
not yet read, while maintaining the virtual circuit. The user application
must be prepared to handle RESET packets as the handling of RESET
packets at the application level is not defined by X.25. RESET packets
can be generated by the X.25 subsystem, by the application processes on
either side of the VC, or by the network provider.
To send a RESET packet, set a cause code and diagnostic code with the
ioctl(X25_WR_CAUSE_DIAG) call from within the application, then issue
a RESET packet with the ioctl(X25_RESET_VC). The
ioctl(X25_WR_CAUSE_DIAG) call is described above under “Clearing a
switched virtual circuit.
The ioctl(X25_RESET_VC) Call
The ioctl(X25_RESET_VC) call sends a RESET REQUEST packet over
the virtual circuit.
NOTE A VC cannot be reset before a connection is established, or after a
connection has been cleared.
When a user application resets a circuit and blocking I/O is in effect, the
application is blocked until a RESET CONFIRMATION packet is
received.
36960-90061.bk Page 84 Friday, November 10, 2000 3:42 PM