NMS_GR303GetDS1Status

Retrieves DS1 link status information collected for a specified DS1 link.

Prototype

NMS_GR303_RESULT_T NMS_GR303GetDS1Status ( NMS_GR303_INTERFACE_ID_T interfaceId, NMS_GR303_DS1_LOCATION_T ds1_loc, NMS_GR303_DS1_STATUS_T *ds1_status)

Argument

Description

interfaceId

Interface ID of a provisioned interface.

ds1_loc

DS1 link for which the NMS GR303 library returns status information. The DS1 location structure is defined as follows:

typedef union _NMS_GR303_DS1_LOCATION_T
{
    struct {
    DWORD boardNb;
    DWORD trunkNb;
    } CG;
}   NMS_GR303_DS1_LOCATION_T;

See the Details section for field descriptions.

ds1_status

Pointer to a buffer to receive the following status structure:

typedef struct {
   DWORD Size;
   NMS_GR303_DS1_STATUSMASK_T StatusMask;
   DWORD Slips;
   DWORD Es;
   DWORD Ses;
   DWORD Uas;
   DWORD LineErrors;
   DWORD FrameErrors;
   DWORD ElaspedTime;
}  NMS_GR303_DS1_STATUS_T;

See the Details section for field descriptions.


Return values

Return value

Description

SUCCESS

 

NMSGR303_INTERNAL_FAILURE

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

NMSGR303_INVALID_DS1

Specified DS1 link has no HDLC channels provisioned on it.

NMSGR303_INVALID_INTERFACE_ID

Specified interface is not provisioned.

NMSGR303_INVALID_PARMS

Specified ds1_status buffer pointer is NULL.

NMSGR303_NOT_INITIALIZED

NMS GR303 library was not initialized with NMS_GR303Initialize.


Details

NMS_GR303GetDS1Status returns status information associated with a specified DS1 link. For the NMS GR303 library to obtain the status information, the interface must be provisioned (with NMS_GR303ProvisionInterface) and the DS1 link must contain at least one HDLC channel that was configured on the specified interface. The application provides the following information in the NMS_GR303_DS1_LOCATION_T structure:

Field

Description

boardNb

Logical board number of the board where the DS1 link is located (as defined by NMS OAM).

trunkNb

Logical trunk number associated with the DS1 link (as defined by NMS OAM).


The GR303 library returns link status information in a NMS_GR303_DS1_STATUS_T structure that provides the following information:

Field

Description

Size

Size of the structure.

StatusMask

Current DS1 status bit mask. This can combine the following values:

NMSGR303_DS1_LOS
Loss of signal.

NMSGR303_DS1_LOF
Loss of frame.

NMSGR303_DS1_AIS
Alarm indication signal.

NMSGR303_DS1_RAI
Remote alarm indicator.

Slips

Number of slips.

Es

Number of errored seconds.

Ses

Number of severely errored seconds.

Uas

Number of unavailable seconds.

LineErrors

Number of line code violations.

FrameErrors

Number of frame bit errors and CRC errors.

ElaspedTime

Seconds since counters started, representing the duration of the observation time (in seconds).

Note: All status fields provide counts of particular events that occur during the ElaspedTime interval.


The ElaspedTime parameter in the NMS_GR303_DS1_STATUS_T structure specifies the duration of the observation in seconds. All other status information represents counters of particular events. These events occur with an interval specified by ElaspedTime parameter.

Applications can use the & operator to extract bits in the StatusMask parameter (in the NMS_GR303_DS1_STATUS_T structure) to find out the current DS1 link condition. The following bit masks are defined:

Bit mask

Definition

Description

0x1

NMSGR303_DS1_LOS

Loss of signal.

0x2

NMSGR303_DS1_LOF

Loss of frame.

0x4

NMSGR303_DS1_AIS

Alarm indication signal.

0x8

NMSGR303_DS1_RAI

Remote alarm indication.


See also

NMS_GR303GetChannelStatistics, NMS_GR303ResetDS1Status

Example

void  GetDS1Status( void )
{
       NMS_GR303_RESULT_T         NmsResult;
       DWORD                      InterfaceId;
       NMS_GR303_DS1_LOCATION_T   DS1Location;
       NMS_GR303_DS1_STATUS_T     DS1Status = {0};

       printf("NMS_GR303GetDS1Status:\n");

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

       printf("Enter DS1 location:\n");

       GetDS1LocationNMS( &DS1Location );
       NmsResult = NMS_GR303GetDS1Status(InterfaceId,
                                         DS1Location,
                                         &DS1Status);

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

       if (NmsResult == NMSGR303_SUCCESS)
       {
        printf("StatusMask  LOS=%i, LOF=%i AIS=%i RAI=%i\n", 
                  (DS1Status.StatusMask & NMSGR303_DS1_LOS) ? 1 : 0),
                  ((DS1Status.StatusMask & NMSGR303_DS1_LOF) ? 1 : 0),
                  ((DS1Status.StatusMask & NMSGR303_DS1_AIS) ? 1 : 0),
                  ((DS1Status.StatusMask & NMSGR303_DS1_RAI) ? 1 : 0));
        printf("Slips           =%i\n",   DS1Status.Slips);
        printf("Es              =%i\n",   DS1Status.Es);
        printf("Ses             =%i\n",   DS1Status.Ses);
        printf("Uas             =%i\n",   DS1Status.Uas);
        printf("LineErrors      =%i\n",   DS1Status.LineErrors);
        printf("FrameErrors     =%i\n",   DS1Status.FrameErrors);
        printf("ElaspedTime     =%i\n",   DS1Status.ElaspedTime);
       }
}