NMS_GR303GetChannelStatistics

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)

Argument

Description

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

See the Details section for field descriptions.

channel_stat

Pointer to an application statistics buffer to receive the 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;

See the Details section for field descriptions.


Return values

Return value

Description

NMSGR303_SUCCESS

 

NMSGR303_INTERNAL_FAILURE

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

NMSGR303_INVALID_CHANNEL

Specified HDLC channel is not provisioned on this interface.

NMSGR303_INVALID_INTERFACE_ID

Specified interface is not provisioned.

NMSGR303_INVALID_PARMS

channel_stat buffer pointer is NULL.

NMSGR303_NOT_INITIALIZED

NMS GR303 library was not initialized with NMS_GR303Initialize.


Details

NMS_GR303GetChannelStatistics 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 NMS_GR303_CHANNEL_LOCATION_T structure provides the following information:

Field

Description

boardNb

Logical board number where an HDLC instance is located (as defined by NMS OAM).

trunkNb

Logical trunk number associated with the HDLC instance (as defined by NMS OAM).

timeslotNb

Physical timeslot number associated with the HDLC instance.


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 and CG 6500C boards).

FifoOverruns

FIFO overrun count (not supported on CG 6100C and CG 6500C boards).

Aborts

Receive abort count.

CrcErrors

Receive CRC errors count.

NonAlignedOctets

Non-aligned octets count (not supported on CG 6100C and CG 6500C boards).

BufferOverflows

Buffer overflows count (not supported on CG 6100C and CG 6500C boards).

MaxFrameLengthViolCnt1

Not supported.


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 and CG 6500C boards).

FifoOverruns

FIFO overrun count (not supported on CG 6100C and CG 6500C boards).


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

}