|
|
1.1 root 1: /*
2: ** Channel conversation statistics
3: */
4:
5: #ifdef PSTATISTICS
6:
7: struct Pstatistics
8: {
9: # ifdef PSTATSDESC
10: char * descp;
11: # endif
12: long count;
13: };
14:
15: enum
16: {
17: badhdr
18: ,badsize, badcrc
19: ,outseq, busy, rdup
20: ,lostack, badack, badnak
21: ,nakpkt, timopkt
22: ,badcntl, badxst
23: ,rpkts, xpkts
24: ,rbytes, xbytes
25: ,rcbytes, xcbytes
26: ,nstats
27: };
28:
29: #define PS_BADHDR (int)badhdr /* Header inconsistent */
30: #define PS_BADSIZE (int)badsize /* Packet size too large */
31: #define PS_BADCRC (int)badcrc /* CRC error */
32: #define PS_OUTSEQ (int)outseq /* Packet out of sequence */
33: #define PS_BUSY (int)busy /* Data receiver busy */
34: #define PS_RDUP (int)rdup /* Duplicate packet received */
35: #define PS_LOSTACK (int)lostack /* ACK for packet lost */
36: #define PS_BADACK (int)badack /* ACK for non-existent packet */
37: #define PS_BADNAK (int)badnak /* NAK for non-existent packet */
38: #define PS_NAKPKT (int)nakpkt /* Retransmitted by NAK */
39: #define PS_TIMOPKT (int)timopkt /* Retransmitted by timeout */
40: #define PS_BADCNTL (int)badcntl /* Unrecognised control code */
41: #define PS_BADXST (int)badxst /* State/acknowledge out of sync */
42: #define PS_RPKTS (int)rpkts /* Packets received */
43: #define PS_XPKTS (int)xpkts /* Packets transmitted */
44: #define PS_RBYTES (int)rbytes /* Bytes received */
45: #define PS_XBYTES (int)xbytes /* Bytes transmitted */
46: #define PS_RCBYTES (int)rcbytes /* Control bytes received */
47: #define PS_XCBYTES (int)xcbytes /* Control bytes transmitted */
48: #define PS_NSTATS (int)nstats
49:
50: #ifndef DECLARE
51: extern struct Pstatistics pstats[PS_NSTATS];
52: #else DECLARE
53: struct Pstatistics pstats[PS_NSTATS]
54: #ifdef PSTATSDESC
55: =
56: {
57: {"bad header"}
58: ,{"bad size"}
59: ,{"bad crc"}
60: ,{"out of sequence"}
61: ,{"data receiver busy"}
62: ,{"duplicate packets received"}
63: ,{"lost ack"}
64: ,{"bad ack"}
65: ,{"bad nak"}
66: ,{"retransmitted by NAK"}
67: ,{"retransmitted by timeout"}
68: ,{"bad control"}
69: ,{"bad xstate"}
70: ,{"packets received"}
71: ,{"packets transmitted"}
72: ,{"bytes received"}
73: ,{"bytes transmitted"}
74: ,{"control bytes received"}
75: ,{"control bytes transmitted"}
76: }
77: #endif PSTATSDESC
78: ;
79: #endif DECLARE
80:
81: #define PSTATS(A) pstats[A].count++
82:
83: #else PSTATISTICS
84:
85: #define PSTATS(A)
86:
87: #endif PSTATISTICS
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.