#include <stream.h> #include <netx25/x25_proto.h > struct strbuf ctlb; struct xcanlisf canlis; . . . ctlb.len = sizeof(struct xcanlisf); ctlb.buf = (char *)canlis; putmsg(x25_fd, &ctlb, NULL, 0);
N_Xcanlis is used to cancel an interest in incoming calls.
When used with putmsg, N_Xcanlis is a Listen Cancel Command, when used with getmsg, it is a Listen Cancel Response. Example 6-1 shows how a getmsg can be constructed. The control part of the Listen Command or Response is defined by the xcanlisf structure. There is no data part.
The Cancel Request removes all listen addresses from the stream. There is no way of cancelling a Listen on a particular address, for example, when the use of the stream is about to be changed by the application.
The control part of a Listen Cancel Command or Response message has a format defined in the xcanlisf structure:
struct xcanlisf { unsigned char xl_type; /* Always XL_CTL */ unsigned char xl_command; /* Always N_Xcanlis */ int c_result; /* Result flag */ };
This structure has the following member:
Table 6-15 Listen Cancel Command/Response Parameters
Member |
Description |
---|---|
c_result |
A non-zero value of the c_result flag indicates failure of the operation to cancel a Listen. This may indicate that the Listen was not present or that some connect event is outstanding. The closure of a stream on which there is a Listen also cancels the Listen, but in the case of the cancel command message, the stream remains open. |