Table of Contents Index NMS Glossary Previous Page Next Page (Page 4 of 32 in this chapter) Version


NMS_GR303GetChannelStatistics

Description

Retrieves HDLC channel statistics for a specified HDLC channel on an active provisioned interface.

Prototype

NMS_GR303_RESULT_T NMS_GR303GetChannelStatistics
(NMS_GR303_INTERFACE_ID_T interfaceId,
NMS_GR303_CHANNEL_LOCATION_T channel_loc,

NMS_GR303_CHANNEL_STATISTICS_T *channel_stat)

interfaceId Interface ID of a provisioned interface.

channel_loc HDLC channel location for which you want to obtain the statistics.

      typedef union _NMS_GR303_CHANNEL_LOCATION_T
      {
       struct {
       DWORD  boardNb;
       DWORD  trunkNb;
       DWORD  timeslotNb;          
       } CG;        
}NMS_GR303_CHANNEL_LOCATION_T
channel_stat Pointer to an application statistics buffer to receive following structure for channel transmit and receive statistics:

      typedef struct {
       DWORD Size;  /* Size of structure   */
       CHANNEL_STATISTICS_RECEIVE_T  chan_stat_rx;
       CHANNEL_STATISTICS_TRANSMIT_T chan_stat_tx; 
      } NMS_GR303_CHANNEL_STATISTICS_T;

      typedef struct {
       DWORD Octets;          
       DWORD Frames;        
       DWORD Drops;          
       DWORD FifoOverruns;   
       DWORD Aborts;          
       DWORD CrcErrors;       
       DWORD NonAlignedOctets;
       DWORD BufferOverflows; 
       DWORD MaxFrameLengthViolCnt1; 
      } CHANNEL_STATISTICS_RECEIVE_T;


      typedef struct {
       DWORD Octets;      
       DWORD Frames;       
       DWORD Drops;       
       DWORD FifoUnderruns; 
       DWORD FifoOverruns; 
      } CHANNEL_STATISTICS_TRANSMIT_T;

Return Values

Events

Details

This function returns channel statistics for a specified HDLC channel within a NMS_GR303_CHANNEL_STATISTICS_T structure. Applications can only obtain statistics for HDLC channels that have been provisioned (with NMS_GR303ProvisionInterface) or added (with NMS_GR303ModifyChannelLocation).

The information in the NMS_GR303_CHANNEL_LOCATION_T structure includes the following:
Parameter

Description

boardNb

Logical board number where an HDLC instance is located.

trunkNb

Logical trunk number associated with the HDLC instance.

timeslotNb

Physical timeslot number associated with the HDLC instance.

CHANNEL_STATISTICS_RECEIVE_T returns the following information:
Value

Description

Octets

Bytes received count.

Frames

Frames received count.

Drops

Frames dropped count.

FifoOverruns

FIFO overrun count.

Aborts

Receive abort count.

CrcErrors

Receive CRC errors count.

NonAlignedOctets

Non-Aligned octets count.

BufferOverflows

Buffer overflows count.

MaxFrameLengthViolCnt1

Frames larger than maximum size count.

CHANNEL_STATISTICS_TRANSMIT_T returns the following information:
Value

Description

Octets

Bytes transmitted count.

Frames

Frames transmitted count.

Drops

Frames dropped count.

FifoUnderruns

FIFO underrun count.

FifoOverruns

FIFO overrun count.

See Also

NMS_GR303GetDS1Status, NMS_GR303ResetChannelStatistics

Example

void  GetChannelStatistics( void )
{
 NMS_GR303_RESULT_T        NmsResult;
 DWORD        InterfaceId;
 NMS_GR303_CHANNEL_STATISTICS_T        Statistics;
 NMS_GR303_CHANNEL_LOCATION_T        ChannelLocation;



 printf("NMS_GR303GetChannelStatistics:\n");

 /* Get parameters */
 promptdw_nodft("Enter interfaceId", &InterfaceId);

 printf("Enter channel location:\n");
 GetChannelLocationNMS( &ChannelLocation );

 NmsResult = NMS_GR303GetChannelStatistics (InterfaceId,
               ChannelLocation,
               &Statistics);

 printf ("NMS_GR303GetChannelStatistics: 
Result=%s\n",PRINT_RESULT(NmsResult));
if (NmsResult == NMSGR303_SUCCESS) { printf("TxOctets =%i\n", Statistics.chan_stat_tx.Octets); printf("TxFrames =%i\n", Statistics.chan_stat_tx.Frames); printf("TxDrops =%i\n", Statistics.chan_stat_tx.Drops); printf("TxUnderrun =%i\n", Statistics.chan_stat_tx.FifoUnderruns); printf("TxOverrun =%i\n", Statistics.chan_stat_tx.FifoOverruns); printf("RxOctets =%i\n", Statistics.chan_stat_rx.Octets); printf("RxFrames =%i\n", Statistics.chan_stat_rx.Frames); printf("RxDrops =%i\n", Statistics.chan_stat_rx.Drops); printf("RxOverrun =%i\n", Statistics.chan_stat_rx.FifoOverruns); printf("RxAbort =%i\n", Statistics.chan_stat_rx.Aborts); printf("RxCrcError =%i\n", Statistics.chan_stat_rx.CrcErrors); printf("RxNonAligned =%i\n",
Statistics.chan_stat_rx.NonAlignedOctets);
printf("RxBufferOverflow=%i\n",
Statistics.chan_stat_rx.BufferOverflows);
printf("RxMaxFrameCnt=%i\n",
Statistics.chan_stat_rx.MaxFrameLengthViolCnt);
} }


Table of Contents Index NMS Glossary Previous Page Next Page (Page 4 of 32 in this chapter) Version


Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2001, NMS Communications Corporation. All rights reserved.