Solstice X.25 9.2 Administration Guide

Statistics


Note -

The command x25stat returns more complete statistics than those returned by the procedure shown below.


To get the same statistics as those returned by hdlcstate in SunNet X.25 7.0, your program should run the HDLC_STATS ioctl call as follows:


int fid, error;
 struct hdlc_stats_req hsr;
 struct hdlc_stats *hdlc_stats;

 hdlc_stats = &hsr.he;
 error = ioctl(fid, HDLC_STATS, (caddr_t) &hsr);
 /* results are in structure pointed to by hdlc_stats */

The hdlc_stats is of type struct hdlc_stats shown below:


struct hdlc_stats {
       u_short        hs_state;     /* hdlc state */
       u_short        hs_sentsabms; /* sabms sent */
       struct ss_dstats hs_data;    /* data stats */
       struct ss_estats hs_errors;  /* error stats */

The value hs_sentsabmns is the cumulative total of SABMS that were transmitted, including retry attempts. The field hs_state can be any one of the following:


#define HDLCLINK_DOWN 0 /* initial state */
#define HDLCLINK_SABM 1 /* SABM outstanding
#define HDLCLINK_FMR 2  /* FRMR outstanding */
#define HDLCLINK_DISC 3 /* DISC outstanding */
#define HDLCLINK_UP   4 /* information transfer state */

The structures ss_dstats and ssestats are defined in the file <sundev/syncstat.h> as follows:


struct ss_dstats {
      long ssd_spack;    /* input packets */
      long ssd_opack;    /* output packets */
      long ssd_ichar;    /* input bytes */
      long ssd_ochar;    /* output bytes */
 ];

 struct ss_estats {
      long sse_abort;    /* abort received */
      long sse_crc;      /* CRC error */
      long sse_overrun;  /* receiver overrun */
      long sse_underrun; /* xmitter underrun */

Their values correspond to the Total bytes and Errors lines of the hdlcstate display.