Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.11.1.2
openapi_loop_protect.h
Go to the documentation of this file.
1 
9 /**********************************************************************
10 *
11 * Copyright 2022-2023 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_loop_protect.h
28 *
29 * @purpose This code implements the OpEN LoopProtect API
30 *
31 * @component OPEN
32 *
33 * @create 12/23/2022
34 *
35 * @end
36 *
37 *********************************************************************/
38 #ifndef OPENAPI_LOOP_PROTECT_H_INCLUDED
39 #define OPENAPI_LOOP_PROTECT_H_INCLUDED
40 
41 #include "openapi_common.h"
42 
43 typedef enum
44 {
45  OPEN_LOOP_PROTECT_ACTION_LOGMSG = 0,
46  OPEN_LOOP_PROTECT_ACTION_SHUTDOWN,
47  OPEN_LOOP_PROTECT_ACTION_LOGMSG_SHUTDOWN
48 } OPEN_LOOP_PROTECT_PORT_ACTION_t;
49 
50 /*************************************************************************/
67  OPEN_CONTROL_t adminMode);
68 
69 /*************************************************************************/
85  OPEN_CONTROL_t *adminMode);
86 
87 /*************************************************************************/
104  uint32_t timerVal);
105 
106 /*************************************************************************/
122  uint32_t *timerVal);
123 
124 /*************************************************************************/
142  uint32_t val);
143 
144 /*************************************************************************/
161  uint32_t *val);
162 
163 /*************************************************************************/
181  uint32_t ifNum, OPEN_CONTROL_t mode);
182 
183 /*************************************************************************/
200  uint32_t ifNum, OPEN_CONTROL_t *mode);
201 
202 /*************************************************************************/
219  uint32_t val);
220 
221 /*************************************************************************/
237  uint32_t *val);
238 
239 /*************************************************************************/
257  uint32_t ifNum, OPEN_CONTROL_t mode);
258 
259 /*************************************************************************/
276  uint32_t ifNum, OPEN_CONTROL_t *mode);
277 
278 /*************************************************************************/
296  uint32_t ifNum,
297  OPEN_LOOP_PROTECT_PORT_ACTION_t mode);
298 
299 /*************************************************************************/
316  uint32_t ifNum,
317  OPEN_LOOP_PROTECT_PORT_ACTION_t *mode);
318 
319 /*************************************************************************/
339  uint32_t ifNum, uint32_t tpid,
340  uint32_t vlanId);
341 
342 /*************************************************************************/
361  uint32_t ifNum, uint32_t *tpid,
362  uint32_t *vlanId);
363 
364 /*************************************************************************/
380  uint32_t ifNum);
381 
382 /*************************************************************************/
397 
398 /*************************************************************************/
415  uint32_t ifNum,
416  uint32_t *loopCount);
417 
418 /*************************************************************************/
435  uint32_t ifNum, OPEN_BOOL_t *status);
436 
437 /*************************************************************************/
455  uint32_t ifNum, OPEN_BOOL_t *status);
456 
457 /*************************************************************************/
476  uint32_t ifNum,
477  uint32_t *timeVal,
478  OPEN_BOOL_t needUtc);
479 
480 /*************************************************************************/
497  uint32_t ifNum, uint32_t *count);
498 
499 /*************************************************************************/
516  uint32_t ifNum, uint32_t *count);
517 
518 /*************************************************************************/
535  uint32_t ifNum, OPEN_BOOL_t *status);
536 
537 /*************************************************************************/
553  uint32_t *ifNum);
554 
555 /*************************************************************************/
572  uint32_t ifNum, uint32_t *nextIfNum);
573 
574 #endif /* OPENAPI_LOOP_PROTECT_H_INCLUDED */
575 
open_error_t openapiLoopProtectPortloopDetectCountGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *loopCount)
Gets the loop Count for the specified interface.
open_error_t openapiLoopProtectPortPacketRxCountGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *count)
Gets the receive loop count for the specified interface.
open_error_t openapiLoopProtectPortAdminModeGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_CONTROL_t *mode)
Gets the loop protection admin mode for the interface.
open_error_t openapiLoopProtectPortTxModeSet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_CONTROL_t mode)
Sets the transmission mode for the LoopProtection PDU's.
open_error_t openapiLoopProtectDisableTimerGet(openapiClientHandle_t *client_handle, uint32_t *val)
Gets the disable duration for the port.
open_error_t openapiLoopProtectPortPacketTxCountGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *count)
Gets the transmit loop count for the specified interface.
open_error_t openapiLoopProtectValidIntfFirstGet(openapiClientHandle_t *client_handle, uint32_t *ifNum)
Gets the first interface that is valid for loop protection.
open_error_t
OPEN uses these enumerators to indicate the error codes.
open_error_t openapiLoopProtectMaxPduReceiveSet(openapiClientHandle_t *client_handle, uint32_t val)
Sets the maximum number of PDU's to be received on a port before action is taken. ...
open_error_t openapiLoopProtectIsPortDisabled(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_BOOL_t *status)
Gets the port status.
open_error_t openapiLoopProtectMaxPduReceiveGet(openapiClientHandle_t *client_handle, uint32_t *val)
Gets the maximum number of PDU's to be received on a port before action is taken. ...
open_error_t openapiLoopProtectTxTimerGet(openapiClientHandle_t *client_handle, uint32_t *timerVal)
Gets the transmission timer for the LoopProtection PDU's.
open_error_t openapiLoopProtectTxTimerSet(openapiClientHandle_t *client_handle, uint32_t timerVal)
Sets the transmission timer for the LoopProtection PDU's.
open_error_t openapiLoopProtectAdminModeSet(openapiClientHandle_t *client_handle, OPEN_CONTROL_t adminMode)
Sets the LoopProtection global mode.
open_error_t openapiLoopProtectAllStatsClear(openapiClientHandle_t *client_handle)
Clears the statistics for all interfaces.
open_error_t openapiLoopProtectPortAdminModeSet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_CONTROL_t mode)
Sets the loop protection admin mode for the interface.
open_error_t openapiLoopProtectPortVlanPropertiesSet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t tpid, uint32_t vlanId)
Sets the VLAN ID and the TPID to be used for detecting a loop on the specified interface.
open_error_t openapiLoopProtectDisableTimerSet(openapiClientHandle_t *client_handle, uint32_t val)
Sets the disable duration for the port.
OPEN_CONTROL_t
OPEN uses these enumerators to indicate enable or disable for a given config or status parameter...
open_error_t openapiLoopProtectAdminModeGet(openapiClientHandle_t *client_handle, OPEN_CONTROL_t *adminMode)
Gets the LoopProtection global mode.
open_error_t openapiLoopProtectPortVlanPropertiesGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *tpid, uint32_t *vlanId)
Gets the VLAN ID and the TPID used for detecting a loop on the specified interface.
OPEN_BOOL_t
OPEN uses these enumerators to indicate true or false for a given config or status parameter...
open_error_t openapiLoopProtectPortStatsClear(openapiClientHandle_t *client_handle, uint32_t ifNum)
Clears statistics of the specified interface.
open_error_t openapiLoopProtectValidIntfNextGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *nextIfNum)
Gets the next interface that is valid for loop protection.
open_error_t openapiLoopProtectPortTimeSinceLastLoopGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *timeVal, OPEN_BOOL_t needUtc)
Gets the time since last loop occured for the specified interface.
open_error_t openapiLoopProtectPortTxModeGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_CONTROL_t *mode)
Gets the transmission timer Mode for the LoopProtection PDU's.
open_error_t openapiLoopProtectIsLoopDetected(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_BOOL_t *status)
Gets the status of loop on the specified interface.
open_error_t openapiLoopProtectPortActionGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_LOOP_PROTECT_PORT_ACTION_t *mode)
Gets the port action for the the specified interface.
open_error_t openapiLoopProtectIsValidIntf(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_BOOL_t *status)
Gets the status of an interface whether port is valid for configuration for loop protection.
open_error_t openapiLoopProtectPortActionSet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_LOOP_PROTECT_PORT_ACTION_t mode)
Sets the port action for the the specified interface.