Solstice X.25 9.2 Developer's Guide

6.4.13 N_RI--Reset Request/Indication

Synopsis
#include <stream.h>
 #include <netx25/x25_proto.h >

 struct strbuf ctlb;

 struct xrstf reset;
 .
 .
 .
 ctlb.len = sizeof(struct xrstf);
 ctlb.buf = (char *)reset;

 putmsg(x25_fd, &ctlb, NULL, 0);
Description

N_RI is used for resets. When used in a putmsg it is a Reset Request. In a getmsg it is a Reset Indication. Example 6-1 shows how a getmsg can be constructed. The X.25 cause and diagnostic bytes, cause and diag, are presented as well as the CONS originator and reason codes that are mapped from these. Refer to Chapter 9, Error Codes for further information.

For a Reset Request, the user can specify a non-zero cause code. This has no effect for an OSI CONS call; the value is set to zero by the system.

The control part of the Reset Request or Indication is defined by the xrstf structure. There is no data part.

The xrstf structure is shown below:

struct xrstf {
 	unsigned char xl_type; /* Always XL_CTL */
 	unsigned char xl_command; /* Always N_RI */
 	unsigned char originator, /* Originator and Reason mapped */
 			reason, /* from X.25 cause/diag in indications */
 			cause, /* X.25 cause byte */
 			diag; /* X.25 diagnostic byte */
 }; 

Note -

A Reset primitive is an acknowledged service. It must be acknowledged before another Reset can be requested. 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.