This ioctl is used to retrieve per-virtual circuit state and statistics, for all virtual circuits currently active over all configured links.
The vcstatsf structure, defined in x25_control.h, takes this format:
struct vcstatsf { int first_ent; /* Where to start search */ unsigned char num_ent /* Number entries returned */ struct pervcinfo vc; /* Data buffer, extendable by*/ /* malloc overlay*/ };
The members of the vcstatsf structure are:
Table 7-12 vcstatsf fields
Member |
Description |
---|---|
first_ent |
Informs the X.25 multiplexor where to start or restart the table read. On return, it is set to point the next entry. |
num_ent |
Indicates the number of virtual circuit entries returned in the vc member. |
vc |
This is either a single pervcinfo structure or an array of pervcinfo structures, of size MAX_VC_ENTRIES, each containing the state and statistics of an individual virtual circuit. If a single pervcinfo structure is used, and num_ent is not 0, and statistics are returned of the virtual circuit specified in the lci member of the pervcinfo structure, with a link identifier specified using xu_ident. If a single pervcinfo structure is used, and num_ent is 0, the number of open virtual circuits is returned in first_ent. If an array of pervcinfo structures is used, and num_ent is set to 0, statistics are returned for the Logical Channel Number set using the lci member. If an array of pervcinfo structures is used, and num_ent is set to 1, statistics are returned for all virtual circuits on the link specified using xu_ident. If an array of pervcinfo structures is used, and num_ent is set to MAX_VC_ENTRIES, statistics are returned for all virtual circuits on all links. |
The contents of the pervcinfo structure are:
struct pervcinfo { struct xaddrf rem_addr; /* = called for outward calls */ /* = caller for inward calls */ uint32_t xu_ident; /* link id */ uint32_t process_id; /* effective user id */ unsigned short lci; /* Logical Channel Identifier */ unsigned char xstate; /* VC state */ unsigned char xtag; /* VC check record */ unsigned char ampvc; /* =1 if a PVC */ unsigned char call_direction; /* DIRECTION_xxx (see mib) */ unsigned char domain; /* was in 8.0, not in R7. Put it back */ uint32_t perVC_stats[perVCstat_size]; /* Per-VC statistics array */ /* * move these to the end, so that the first bit of the struct is * identical to the 8.0 one */ unsigned char vctype; /* what _is_ this? */ struct xaddrf loc_addr; /* = caller for outward calls */ /* = called for inward calls */ uint32_t start_time; /* time the VC was created */ };
xstate contains the state of the VC. Possible states and meanings are:
Table 7-13 xstate summary
Entry |
Description |
---|---|
Idle |
Record is not in use |
AskingNRS |
CR is being validated by NRS |
P1 |
VC state is READY |
P2 |
VC in DTE CALL REQUEST |
P3 |
VC in DXE INCOMING CALL |
P5 |
VC in CALL COLLISION |
DataTransfer |
VC in P4 (see xflags |
DXEbusy |
VC in P4, DXE sent RNR |
D2 |
VC in DTE RESET REQUEST |
D2pending |
Wanting buffer for RESET |
WtgRCU |
Waiting U RSC to int.err. |
WtgRCN |
Waiting X.25 RSC for user |
WtgRCNpending |
Buffer reqd to enter state |
P4pending |
Buffer reqd for X.25 RSC |
pRESUonly |
Buffer for user rst only |
RESUonly |
User only being reset |
pDTransfer |
Buffer for RSC to user |
WRCUpending |
Buffer reqd internal RST |
DXErpending |
Buffer reqd RST indication |
DXEresetting |
Waiting U RSC to X.25 RI |
P6 |
VC in DTE CLEAR REQUEST |
P6pending |
Wanting buffer for CLEAR |
WUcpending |
Buffer reqd DI no netconn |
WUNcpending |
Buffer reqd internal DI |
DXEcpending |
Buffer reqd CLR REQ->User |
DXEcfpending |
Buffer reqd CLC to User |
perVC_stats contains statistics counts, as follows:
Table 7-14 perVC_stats summary
Entry |
Description |
---|---|
cll_in_v |
Calls received and indicated |
cll_out_v |
Calls sent |
caa_in_v |
Call established for outgoing |
caa_out_v |
Call established for incoming |
dt_in_v |
Data packets received |
dt_out_v |
Data packets sent |
ed_in_v |
Interrupts received |
ed_out_v |
Interrupts sent |
rnr_in_v |
Receiver not ready received |
rnr_out_v |
Receiver not ready sent |
rr_in_v |
Receiver ready rvcd |
rr_out_v |
Receiver ready sent |
rst_in_v |
Resets received |
rst_out_v |
Resets sent |
rsc_in_v |
Restart confirms received |
rsc_out_v |
Restart confirms sent |
clr_in_v |
Clears received |
clr_out_v |
Clears sent |
clc_in_v |
Clear confirms received |
clc_out_v |
Clear confirms sent |