Solstice X.25 9.2 Developer's Guide

11.2.2.3 L_GETSTATS--Retrieves Per-Link Statistics

The L_GETSTATS ioctl reads per-link (i.e., per-PPA) statistics from the LAPB driver.

Associated Structures

The lapb_stioc structure is used

/* Ioctl block for L_GETSTATS ioctl */
 struct lapb_stioc {
     uint8           lli_type;      /* Table type = LI_STATS  */
     uint8           lli_spare[3];  /*   (for alignment)   */
     uint32          lli_ppa;       /* PPA    */
     lapbstats_t     lli_stats;     /* Table of stats values  */
 };

The lapbstats_t structure needed for L_GETSTATS is defined as follows:


Example 11-1 lapbstats_t structure

typedef struct lapb2_stats {
  uint32 lapbmonarray[laphstatmax]; /* array of LAPB stats */
 } lapbstats_t;

 /* Statistics table definitions  */
 #define tx_ign              0 /* no. ignored + not sent */
 #define rx_badlen           1 /* bad length frames received */
 #define rx_unknown          2 /* unknown frames received */
 #define t1_exp              3 /* no. of T1 timeouts  */
 #define t4_exp              4 /* no. of T4 timeouts  */
 #define t4_n2_exp           5 /* T4 timeouts after N2 times */

 #define RR_rx_cmd           6 /* RR = Receive Ready  */
 #define RR_rx_rsp           7 /* tx = transmitted  */
 #define RR_tx_cmd           8 /* rx = received  */
 #define RR_tx_rsp           9 /* cmd/rsp = command/response */
 #define RR_tx_cmd_p        10 /* p = p-bit set        */

 #define RNR_rx_cmd         11 /* RNR = Receive Not Ready */
 #define RNR_rx_rsp         12
 #define RNR_tx_cmd         13
 #define RNR_tx_rsp         14
 #define RNR_tx_cmd_p       15

 #define REJ_rx_cmd         16 /* REJ = Reject   */
 #define REJ_rx_rsp         17
 #define REJ_tx_cmd         18
 #define REJ_tx_rsp         19
 #define REJ_tx_cmd_p       20

 #define SABME_rx_cmd       21 /* SABME = Set Asynchronous  */
 #define SABME_tx_cmd       22 /*  Balanced Mode Extended */

 #define DISC_rx_cmd        23 /* DISC = Disconnect  */
 #define DISC_tx_cmd        24

 #define UA_rx_rsp          25 /* UA = Unnumbered   */
 #define UA_tx_rsp          26 /* Acknowledgment  */

 #define DM_rx_rsp          27 /*    */
 #define DM_tx_rsp          28

 #define I_rx_cmd           29 /* I = Information  */
 #define I_tx_cmd           30

 #define FRMR_rx_rsp        31 /* FRMR = Frame Reject  */
 #define FRMR_tx_rsp        32

 #define tx_rtr             33 /* no. of retransmitted frames  */
 #define rx_bad             34 /* erroneous frames received    */
 #define rx_dud             35 /* received and discarded      */
 #define rx_ign             36 /* received and ignored         */

 #define I_rx_rsp           37
 #define I_tx_rsp           38

 #define UI_rx_cmd          39
 #define UI_tx_cmd          40

 #define XID_rx_cmd         41
 #define XID_rx_rsp         42
 #define XID_tx_cmd         43
 #define XID_tx_rsp         44

 #define TEST_rx_cmd        45
 #define TEST_rx_rsp        46
 #define TEST_tx_cmd        47
 #define TEST_tx_rsp        48

 #define llc2statmax        40