#include <stream.h> #include <netx25/x25_proto.h > struct strbuf ctlb; struct xrscf rc; . . . ctlb.len = sizeof(struct xrscf); ctlb.buf = (char *)rc; putmsg(x25_fd, &ctlb, NULL, 0);
N_RC is used to respond to a previous reset. When used in a putmsg it is a Reset Response. In a getmsg it is a Reset Confirm. Example 6-1 shows how a getmsg can be constructed. The control part of the Reset Response or Confirm is defined by the xrscf structure. There is no data part.
The xrscf structure is shown below:
struct xrscf { unsigned char xl_type; /* Always XL_CTL */ unsigned char xl_command; /* Always N_RC */ };
A Reset primitive is an acknowledged service (see the associated structure xrscf). A collision between a Reset Indication and a Reset Request is taken to acknowledge the Reset--no Reset Confirmation is then required before another Reset Request can be sent. Normally, Resets are handled by the application.