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


NMS_V5GetChannelStatistics

Description

Returns the statistics collected for a particular HDLC channel provisioned on an interface.

Prototype

NMS_V5_RESULT_T NMS_V5GetChannelStatistics
(NMS_V5_INTERFACE_ID_T interfaceId,
NMS_V5_CHANNEL_LOCATION_T channel_loc,
NMS_V5_CHANNEL_STATISTICS_T *channel_stat)

interfaceId Interface ID of a provisioned interface.

channel_loc HDLC channel location for which to obtain statistics as specified in the following structure:

        typedef union _NMS_V5_CHANNEL_LOCATION_T
        {
          struct {
          DWORD  boardNb;
          DWORD  trunkNb;
          DWORD  timeslotNb;          
        } CG;        
}NMS_V5_CHANNEL_LOCATION_T
channel_stat Pointer to an application-provided buffer to receive the following structure:

  typedef struct {
    DWORD Size; 
    CHANNEL_STATISTICS_RECEIVE_T chan_stat_rx;
    CHANNEL_STATISTICS_TRANSMIT_T chan_stat_tx;
  } NMS_V5_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

None.

Details

This function returns statistics for the provisioned HDLC channel. Applications can only obtain statistics for HDLC channels that are configured on the active variant of the specified interface.

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.

MaxFrameLengthViolCnt

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 overrun count.

FifoOverruns

Fifo overrun count.

See Also

NMS_V5GetE1Status, NMS_V5ResetChannelStatistics

Example

void  GetChannelStatistics( void )
{
    NMS_V5_RESULT_T              NmsResult;
    DWORD                        InterfaceId;
    NMS_V5_CHANNEL_STATISTICS_T  Statistics;
    NMS_V5_CHANNEL_LOCATION_T    ChannelLocation;

    printf("NMS_V5GetChannelStatistics:\n");

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

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

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

    printf ("NMS_V5GetChannelStatistics: 
             Result=%s\n",PRINT_RESULT(NmsResult));
}

  if (NmsResult == NMSV5_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 20 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.