This document provides a brief description of the dot1as OpEN APIs. It provides the following services:
- Get the 802.1AS global admin mode.
- Set the 802.1AS global admin mode.
- Check if there is a Grand Master elected in the 802.1AS domain.
- Check if this bridge is capable of being a grandmaster.
- Get the Best clock identity as detected by this 801AS protocol.
- Get the priority1/2 value of Best clock in the 802.1AS domain.
- Get the steps to Best clock as detected by this protocol.
- Get the clock identity of this bridge.
- Get the priority1/2 value of the local clock.
- Set the priority1/2 value of the local clock.
- Get the number of times the grandmaster has changed.
- Get the timestamp of the given event.
- Get the 802.1AS admin mode for the given interface.
- Set the 802.1AS admin mode for the given interface.
- Check if the given interface 802.1AS capable (as determined by the peer delay mechanism.
- Get the 'isMeasuringPdelay' property, which is set to TRUE if the given interface is receiving PDELAY response messages from other end of the link.
- Get the propagation delay on the given interface.
- Get the 802.1AS role of the given interface.
- Get the propagation delay threshold on the given interface.
- Set the propagation delay threshold on the given interface.
- Get the number of Pdelay_Req messages for which a valid response is not received, on which a port is considered to not be exchanging peer delay messages with its neighbor.
- Set the number of Pdelay_Req messages for which a valid response is not received, on which a port is considered to not be exchanging peer delay messages with its neighbor.
- Get the neighbor rate ratio on the given interface (as computed by the pdelay mechanism) (extensible version).
- Get the given interval on the given interface.
- Set the given interval on the given interface.
- Get the requested 802.1AS counter for the given interface.
- Reset 802.1AS counters for the given interface.
Example C Application dot1as_example
Initialization
In the main function, the sample application initializes the OpEN API RPC service by calling openapiClientRegister() and waits for the RPC service in switchdrvr to start. A Client Handle is returned by openapiClientRegister() which is used while invoking the OpEN APIs. The application then exercises the associated OpEN APIs and logs informational and/or error messages on the console. The example application runs to its completion and exits.
dot1as_example
dot1as_example.c is a sample application that demonstrates the use of OpEN's dot1as APIs. dot1as_example is started from the command line and can be used to exercise the various APIs by specifying arguments on the command line.
Sample Output
- Usage: ./dot1as_example <test#> <arg1> <arg2> ...
- Test 1: Get the 802.1AS global admin mode: dot1as_example 1 <adminMode>
- Test 2: Set the 802.1AS global admin mode: dot1as_example 2 <adminMode>
- Test 3: Check if there is a Grand Master elected in the 802.1AS domain: dot1as_example 3 <grandmasterPresent>
- Test 4: Check if this bridge is capable of being a grandmaster: dot1as_example 4 <grandmasterCapable>
- Test 5: Get the Best clock identity as detected by this 801AS protocol: dot1as_example 5 <bestClockId>
- Test 6: Get the priority1/2 value of Best clock in the 802.1AS domain: dot1as_example 6 <clockPriorityType><clockPriority>
- Test 7: Get the steps to Best clock as detected by this protocol: dot1as_example 7 <bestClkSteps>
- Test 8: Get the clock identity of this bridge: dot1as_example 8 <bridgeClkId>
- Test 9: Get the priority1/2 value of the local clock: dot1as_example 9 <clockPriorityType><clockPriority>
- Test 10: Set the priority1/2 value of the local clock: dot1as_example 10 <clockPriorityType><clockPriority>
- Test 11: Get the number of times the grandmaster has changed: dot1as_example 11 <gmChangeCount>
- Test 12: Get the timestamp of the given event: dot1as_example 12 <gmEventType><timeStamp>
- Test 13: Get the 802.1AS admin mode for the given interface: dot1as_example 13 <intfNum><adminMode>
- Test 14: Set the 802.1AS admin mode for the given interface: dot1as_example 14 <intfNum><adminMode>
- Test 15: Check if the given interface 802.1AS capable (as determined by the peer delay mechanism: dot1as_example 15 <intfNum><isCapable>
- Test 16: Get the 'isMeasuringPdelay' property, which is set to TRUE if the given interface is receiving PDELAY response messages from other end of the link: dot1as_example 16 <intfNum><isMeasuringPdelay>
- Test 17: Get the propagation delay on the given interface: dot1as_example 17 <intfNum><pDelay>
- Test 18: Get the 802.1AS role of the given interface: dot1as_example 18 <intfNum><intfRole>
- Test 19: Get the propagation delay threshold on the given interface: dot1as_example 19 <intfNum><threshold>
- Test 20: Set the propagation delay threshold on the given interface: dot1as_example 20 <intfNum><threshold>
- Test 21: Get the number of Pdelay_Req messages for which a valid response is not received, on which a port is considered to not be exchanging peer delay messages with its neighbor: dot1as_example 21 <intfNum><numAllowedLostResp>
- Test 22: Set the number of Pdelay_Req messages for which a valid response is not received, on which a port is considered to not be exchanging peer delay messages with its neighbor: dot1as_example 22 <intfNum><numAllowedLostResp>
- Test 23: Get the neighbor rate ratio on the given interface (as computed by the pdelay mechanism) (extensible version): dot1as_example 23 <intfNum><rateRatio>
- Test 24: Get the given interval on the given interface: dot1as_example 24 <intfNum><intervalType><interval>
- Test 25: Set the given interval on the given interface: dot1as_example 25 <intfNum><intervalType><interval>
- Test 26: Get the requested 802.1AS counter for the given interface: dot1as_example 26 <intfNum><counterType><counterValue>
- Test 27: Reset 802.1AS counters for the given interface: dot1as_example 27 <intfNum>
- Test 28: Run API sanity checks: dot1as_example 28
dot1as CLI/API Cross Reference
show dot1as interface <intf> | openapiDot1asIntfPdelayThresholdGet()
openapiDot1asIntfPdelayThresholdSet()
openapiDot1asIntfAllowedLostRespGet()
openapiDot1asIntfNeighborRateRatioGet()
openapiDot1asIntfIntervalGet() show dot1as statistics <intf_num> | openapiDot1asIntfStatsGet()
dot1as | openapiDot1asModeSet()
openapiDot1asIntfModeSet() dot1as priority | openapiDot1asBridgeProritySet() dot1as interval announce | openapiDot1asIntfIntervalSet() dot1as interval sync | openapiDot1asIntfIntervalSet() dot1as interval pdelay | openapiDot1asIntfIntervalSet() dot1as timeout announce | openapiDot1asIntfIntervalSet() dot1as timeout sync | openapiDot1asIntfIntervalSet() dot1as timeout pdelay | openapiDot1asIntfIntervalSet() dot1as pdelaythreshhold | openapiDot1asIntfPdelayThresholdSet() dot1as allowedLostResp | openapiDot1asIntfAllowedLostRespSet() clear dot1as statistics | openapiDot1asIntfStatsReset()