NMS_V5GetChannelStatistics

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)

Argument

Description

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

See the Details section for field descriptions.

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;
} CHANNEL_STATISTICS_RECEIVE_T;

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

See the Details section for field descriptions.


Return values

Return value

Description

NMSV5_SUCCESS

 

NMSV5_INTERNAL_FAILURE

Internal failure. Refer to the trace log for more information.

NMSV5_INVALID_CHANNEL

Specified HDLC channel is not provisioned on the specified interface.

NMSV5_INVALID_INTERFACE_ID

Specified interface is not provisioned.

NMSV5_INVALID_PARMS

channel_stat buffer is NULL.

NMSV5_NOT_INITIALIZED

NMS V5 library was not initialized with NMS_V5Initialize.


Details

NMS_V5GetChannelStatistics 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:

Field

Description

Octets

Bytes received count.

Frames

Frames received count.

Drops

Frames dropped count. Not supported on CG 6100C or CG 6500C boards.

FifoOverruns

FIFO overrun count. Not supported on CG 6100C or CG 6500C boards.

Aborts

Receive abort count.

CrcErrors

Receive CRC errors count.

NonAlignedOctets

Non-aligned octets count. Not supported on CG 6100C or CG 6500C boards.

BufferOverflows

Buffer overflows count. Not supported on CG 6100C or CG 6500C boards.


CHANNEL_STATISTICS_TRANSMIT_T returns the following information:

Field

Description

Octets

Bytes transmitted count.

Frames

Frames transmitted count.

Drops

Frames dropped count.

FifoUnderruns

FIFO underrun count. Not supported on CG 6100C or CG 6500C boards.

FifoOverruns

FIFO overrun count. Not supported on CG 6100C or CG 6500C boards.


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);
    }
}