Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.11.1.2
openapi_dot1as.h
Go to the documentation of this file.
1 
9 /**********************************************************************
10 *
11 * Copyright 2020-2022 Broadcom.
12 *
13 * Licensed under the Apache License, Version 2.0 (the "License");
14 * you may not use this file except in compliance with the License.
15 * You may obtain a copy of the License at
16 *
17 * http://www.apache.org/licenses/LICENSE-2.0
18 *
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS,
21 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
24 *
25 ***********************************************************************
26 *
27 * @filename openapi_dot1as.h
28 *
29 * @purpose This code implements the OpEN 801AS (dot1as) API(s)
30 *
31 * @component OPEN
32 *
33 * @create 04/08/2020
34 *
35 * @end
36 *
37 *********************************************************************/
38 #ifndef OPENAPI_DOT1AS_H_INCLUDED
39 #define OPENAPI_DOT1AS_H_INCLUDED
40 
41 #include "openapi_common.h"
42 
44 #define OPEN_DOT1AS_MIN_PRIORITY_VALUE 0
45 #define OPEN_DOT1AS_MAX_PRIORITY_VALUE 255
46 
48 #define OPEN_DOT1AS_MIN_PDELAY_THRESHOLD 0
49 #define OPEN_DOT1AS_MAX_PDELAY_THRESHOLD 1000000000
52 #define OPEN_DOT1AS_MIN_ALLOWED_RESP_LOST 0
53 #define OPEN_DOT1AS_MAX_ALLOWED_RESP_LOST 65535
54 
60 #define OPEN_DOT1AS_PDU_TX_INTL_LOG2_MAX 5
61 #define OPEN_DOT1AS_PDU_TX_INTL_LOG2_MIN -5
64 #define OPEN_DOT1AS_MIN_PDU_RX_TIMEOUT 2
65 #define OPEN_DOT1AS_MAX_PDU_RX_TIMEOUT 255
66 
68 #define OPEN_DOT1AS_CLOCK_ID_LEN 8
69 typedef struct
70 {
71  uint8_t id[OPEN_DOT1AS_CLOCK_ID_LEN];
73 
75 typedef enum
76 {
80 
82 typedef enum
83 {
89 
91 typedef enum
92 {
93  OPEN_DOT1AS_INITIAL_SYNC_TX_INTERVAL = 0,
94  OPEN_DOT1AS_CURRENT_SYNC_TX_INTERVAL,
95  OPEN_DOT1AS_INITIAL_ANNOUNCE_TX_INTERVAL,
96  OPEN_DOT1AS_CURRENT_ANNOUNCE_TX_INTERVAL,
97  OPEN_DOT1AS_INITIAL_PDELAY_TX_INTERVAL,
98  OPEN_DOT1AS_CURRENT_PDELAY_TX_INTERVAL,
99  OPEN_DOT1AS_SYNC_RX_TIMEOUT,
100  OPEN_DOT1AS_ANNOUNCE_RX_TIMEOUT,
101  OPEN_DOT1AS_PDELAY_RX_TIMEOUT,
102  OPEN_DOT1AS_SYNC_RX_TIMEOUT_INTERVAL,
103 } OPEN_DOT1AS_INTF_INTERVAL_t;
104 
106 typedef enum
107 {
108  OPEN_DOT1AS_SYNC_TX_COUNT = 1,
109  OPEN_DOT1AS_SYNC_RX_COUNT,
110  OPEN_DOT1AS_FOLLOWUP_TX_COUNT,
111  OPEN_DOT1AS_FOLLOWUP_RX_COUNT,
112  OPEN_DOT1AS_ANNOUNCE_TX_COUNT,
113  OPEN_DOT1AS_ANNOUNCE_RX_COUNT,
114  OPEN_DOT1AS_PDELAY_REQ_TX_COUNT,
115  OPEN_DOT1AS_PDELAY_REQ_RX_COUNT,
116  OPEN_DOT1AS_PDELAY_RESP_TX_COUNT,
117  OPEN_DOT1AS_PDELAY_RESP_RX_COUNT,
118  OPEN_DOT1AS_PDELAY_RESP_FOLLOWUP_TX_COUNT,
119  OPEN_DOT1AS_PDELAY_RESP_FOLLOWUP_RX_COUNT,
120  OPEN_DOT1AS_SIGNALING_TX_COUNT,
121  OPEN_DOT1AS_SIGNALING_RX_COUNT,
122  OPEN_DOT1AS_SYNC_RX_TIMEOUTS,
123  OPEN_DOT1AS_SYNC_RX_DISCARDS,
124  OPEN_DOT1AS_ANNOUNCE_RX_TIMEOUTS,
125  OPEN_DOT1AS_ANNOUNCE_RX_DISCARDS,
126  OPEN_DOT1AS_PDELAY_RX_TIMEOUTS,
127  OPEN_DOT1AS_PDELAY_RX_DISCARDS,
128  OPEN_DOT1AS_BAD_HEADER_COUNT,
129  OPEN_DOT1AS_PTP_DISCARD_COUNT,
130  OPEN_DOT1AS_PDELAY_LOST_RESP_EXCEEDED,
131  OPEN_DOT1AS_COUNTER_LAST
132 
133 } OPEN_DOT1AS_COUNTER_TYPE_t;
134 
136 typedef enum
137 {
138  OPEN_DOT1AS_GM_CHANGE_EVENT,
139  OPEN_DOT1AS_GM_PHASE_CHANGE_EVENT,
140  OPEN_DOT1AS_GM_FREQ_CHANGE_EVENT,
141 } OPEN_DOT1AS_GM_EVENT_TYPE_t;
142 
143 /*************************************************************************/
161  OPEN_CONTROL_t *adminMode);
162 
163 /*************************************************************************/
181  OPEN_CONTROL_t adminMode);
182 
183 /*************************************************************************/
199 
200 /*************************************************************************/
216 
217 /*************************************************************************/
233  OPEN_DOT1AS_CLOCK_IDENTITY_t *bestClockId);
234 
235 /*************************************************************************/
252  OPEN_DOT1AS_CLOCK_PRIORITY_t clockPriorityType,
253  uint8_t *clockPriority);
254 
255 /*************************************************************************/
271  uint16_t *bestClkSteps);
272 
273 /*************************************************************************/
289  OPEN_DOT1AS_CLOCK_IDENTITY_t *bridgeClkId);
290 
291 /*************************************************************************/
309  OPEN_DOT1AS_CLOCK_PRIORITY_t clockPriorityType,
310  uint32_t *clockPriority);
311 
312 /*************************************************************************/
331  OPEN_DOT1AS_CLOCK_PRIORITY_t clockPriorityType,
332  uint32_t clockPriority);
333 
334 /*************************************************************************/
350 open_error_t openapiDot1asGrandmasterChangeCountGet(openapiClientHandle_t *client_handle, uint32_t *gmChangeCount);
351 
352 /*************************************************************************/
372  OPEN_DOT1AS_GM_EVENT_TYPE_t gmEventType,
373  uint32_t *timeStamp);
374 
375 /*************************************************************************/
394  uint32_t intfNum,
395  OPEN_CONTROL_t *adminMode);
396 
397 /*************************************************************************/
416  uint32_t intfNum,
417  OPEN_CONTROL_t adminMode);
418 
419 /*************************************************************************/
437  uint32_t intfNum,
438  OPEN_BOOL_t *isCapable);
439 
440 /*************************************************************************/
459  uint32_t intfNum,
460  OPEN_BOOL_t *isMeasuringPdelay);
461 
462 /*************************************************************************/
479  uint32_t intfNum, uint32_t *pDelay);
480 
481 /*************************************************************************/
498  uint32_t intfNum,
499  OPEN_DOT1AS_PORT_ROLE_t *intfRole);
500 
501 /*************************************************************************/
517 open_error_t openapiDot1asIntfPdelayThresholdGet(openapiClientHandle_t *client_handle, uint32_t intfNum, uint32_t *threshold);
518 
519 /*************************************************************************/
535 open_error_t openapiDot1asIntfPdelayThresholdSet(openapiClientHandle_t *client_handle, uint32_t intfNum, uint32_t threshold);
536 
537 /*************************************************************************/
555 open_error_t openapiDot1asIntfAllowedLostRespGet(openapiClientHandle_t *client_handle, uint32_t intfNum, uint32_t *numAllowedLostResp);
556 
557 /*************************************************************************/
575 open_error_t openapiDot1asIntfAllowedLostRespSet(openapiClientHandle_t *client_handle, uint32_t intfNum, uint32_t numAllowedLostResp);
576 
577 /*************************************************************************/
595  uint32_t intfNum,
596  uint32_t *rateRatio);
597 
598 /*************************************************************************/
617 open_error_t openapiDot1asIntfIntervalGet(openapiClientHandle_t *client_handle, uint32_t intfNum, OPEN_DOT1AS_INTF_INTERVAL_t intervalType, int32_t *interval);
618 
619 /*************************************************************************/
635 open_error_t openapiDot1asIntfIntervalSet(openapiClientHandle_t *client_handle, uint32_t intfNum, OPEN_DOT1AS_INTF_INTERVAL_t intervalType, int32_t interval);
636 
637 /*************************************************************************/
658  uint32_t intfNum,
659  OPEN_DOT1AS_COUNTER_TYPE_t CounterType,
660  uint32_t *counterValue);
661 
662 /*************************************************************************/
678  uint32_t intfNum);
679 
680 
681 #endif /* OPENAPI_DOT1AS_H_INCLUDED */
682 
open_error_t openapiDot1asIntfIsCapableGet(openapiClientHandle_t *client_handle, uint32_t intfNum, OPEN_BOOL_t *isCapable)
Check if the given interface 802.1AS capable (as determined by the peer delay mechanism.
open_error_t openapiDot1asGrandmasterCapableGet(openapiClientHandle_t *client_handle, OPEN_BOOL_t *grandmasterCapable)
Check if this bridge is capable of being a grandmaster.
open_error_t openapiDot1asBridgeClkIdGet(openapiClientHandle_t *client_handle, OPEN_DOT1AS_CLOCK_IDENTITY_t *bridgeClkId)
Get the clock identity of this bridge.
open_error_t openapiDot1asIntfPdelayGet(openapiClientHandle_t *client_handle, uint32_t intfNum, uint32_t *pDelay)
Get the propagation delay on the given interface.
open_error_t openapiDot1asIntfStatsReset(openapiClientHandle_t *client_handle, uint32_t intfNum)
Reset 802.1AS counters for the given interface.
open_error_t openapiDot1asIntfIntervalGet(openapiClientHandle_t *client_handle, uint32_t intfNum, OPEN_DOT1AS_INTF_INTERVAL_t intervalType, int32_t *interval)
Get the given interval on the given interface.
open_error_t openapiDot1asIntfStatsGet(openapiClientHandle_t *client_handle, uint32_t intfNum, OPEN_DOT1AS_COUNTER_TYPE_t CounterType, uint32_t *counterValue)
Get the requested 802.1AS counter for the given interface.
#define OPEN_DOT1AS_CLOCK_ID_LEN
Length of clock identify - 8 octets.
open_error_t
OPEN uses these enumerators to indicate the error codes.
open_error_t openapiDot1asModeSet(openapiClientHandle_t *client_handle, OPEN_CONTROL_t adminMode)
Set the 802.1AS global admin mode.
open_error_t openapiDot1asIntfIsMeasuringPdelayGet(openapiClientHandle_t *client_handle, uint32_t intfNum, OPEN_BOOL_t *isMeasuringPdelay)
This "measuring peer delay" property, which is set to TRUE if the given interface is receiving PDELAY...
open_error_t openapiDot1asIntfModeGet(openapiClientHandle_t *client_handle, uint32_t intfNum, OPEN_CONTROL_t *adminMode)
Get the 802.1AS admin mode for the given interface.
open_error_t openapiDot1asIntfNeighborRateRatioGet(openapiClientHandle_t *client_handle, uint32_t intfNum, uint32_t *rateRatio)
Get the neighbor rate ratio on the given interface (as computed by the pdelay mechanism) (extensible ...
OPEN_DOT1AS_PORT_ROLE_t
open_error_t openapiDot1asModeGet(openapiClientHandle_t *client_handle, OPEN_CONTROL_t *adminMode)
Get the 802.1AS global admin mode.
open_error_t openapiDot1asIntfPdelayThresholdGet(openapiClientHandle_t *client_handle, uint32_t intfNum, uint32_t *threshold)
Get the propagation delay threshold on the given interface.
open_error_t openapiDot1asBridgePriorityGet(openapiClientHandle_t *client_handle, OPEN_DOT1AS_CLOCK_PRIORITY_t clockPriorityType, uint32_t *clockPriority)
Get the priority1/2 value of the local clock.
open_error_t openapiDot1asBridgePrioritySet(openapiClientHandle_t *client_handle, OPEN_DOT1AS_CLOCK_PRIORITY_t clockPriorityType, uint32_t clockPriority)
Set the priority1/2 value of the local clock.
open_error_t openapiDot1asBestClkIdGet(openapiClientHandle_t *client_handle, OPEN_DOT1AS_CLOCK_IDENTITY_t *bestClockId)
Get the Best clock identity as detected by this 801AS protocol.
open_error_t openapiDot1asIntfAllowedLostRespSet(openapiClientHandle_t *client_handle, uint32_t intfNum, uint32_t numAllowedLostResp)
Set the number of Pdelay_Req messages for which a valid response is not received, on which a port is ...
open_error_t openapiDot1asIntfPdelayThresholdSet(openapiClientHandle_t *client_handle, uint32_t intfNum, uint32_t threshold)
Set the propagation delay threshold on the given interface.
OPEN_CONTROL_t
OPEN uses these enumerators to indicate enable or disable for a given config or status parameter...
open_error_t openapiDot1asGrandmasterChangeCountGet(openapiClientHandle_t *client_handle, uint32_t *gmChangeCount)
Get the number of times the grandmaster has changed.
open_error_t openapiDot1asIntfModeSet(openapiClientHandle_t *client_handle, uint32_t intfNum, OPEN_CONTROL_t adminMode)
Set the 802.1AS admin mode for the given interface.
open_error_t openapiDot1asEventTimestampGet(openapiClientHandle_t *client_handle, OPEN_DOT1AS_GM_EVENT_TYPE_t gmEventType, uint32_t *timeStamp)
Get the timestamp of the given event.
OPEN_BOOL_t
OPEN uses these enumerators to indicate true or false for a given config or status parameter...
OPEN_DOT1AS_CLOCK_PRIORITY_t
open_error_t openapiDot1asIntfAllowedLostRespGet(openapiClientHandle_t *client_handle, uint32_t intfNum, uint32_t *numAllowedLostResp)
Get the number of Pdelay_Req messages for which a valid response is not received, on which a port is ...
open_error_t openapiDot1asBestClkStepsGet(openapiClientHandle_t *client_handle, uint16_t *bestClkSteps)
Get the steps to Best clock as detected by this protocol.
open_error_t openapiDot1asBestClkPriorityGet(openapiClientHandle_t *client_handle, OPEN_DOT1AS_CLOCK_PRIORITY_t clockPriorityType, uint8_t *clockPriority)
Get the priority 1/2 value of Best clock in the 802.1AS domain.
open_error_t openapiDot1asIntfRoleGet(openapiClientHandle_t *client_handle, uint32_t intfNum, OPEN_DOT1AS_PORT_ROLE_t *intfRole)
Get the 802.1AS role of the given interface.
open_error_t openapiDot1asIntfIntervalSet(openapiClientHandle_t *client_handle, uint32_t intfNum, OPEN_DOT1AS_INTF_INTERVAL_t intervalType, int32_t interval)
Set the given interval on the given interface.
open_error_t openapiDot1asIsGrandmasterPresentGet(openapiClientHandle_t *client_handle, OPEN_BOOL_t *grandmasterPresent)
Check if there is a Grand Master elected in the 802.1AS domain.