Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.11.1.2
Enumerations | Functions
This Code Implements The OpEN LoopProtect API [OPENAPI_LOOP_PROTECT]

Enumerations

enum  OPEN_LOOP_PROTECT_PORT_ACTION_t { OPEN_LOOP_PROTECT_ACTION_LOGMSG = 0, OPEN_LOOP_PROTECT_ACTION_SHUTDOWN, OPEN_LOOP_PROTECT_ACTION_LOGMSG_SHUTDOWN }
 

Functions

open_error_t openapiLoopProtectAdminModeGet (openapiClientHandle_t *client_handle, OPEN_CONTROL_t *adminMode)
 Gets the LoopProtection global mode. More...
 
open_error_t openapiLoopProtectAdminModeSet (openapiClientHandle_t *client_handle, OPEN_CONTROL_t adminMode)
 Sets the LoopProtection global mode. More...
 
open_error_t openapiLoopProtectAllStatsClear (openapiClientHandle_t *client_handle)
 Clears the statistics for all interfaces. More...
 
open_error_t openapiLoopProtectDisableTimerGet (openapiClientHandle_t *client_handle, uint32_t *val)
 Gets the disable duration for the port. More...
 
open_error_t openapiLoopProtectDisableTimerSet (openapiClientHandle_t *client_handle, uint32_t val)
 Sets the disable duration for the port. More...
 
open_error_t openapiLoopProtectIsLoopDetected (openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_BOOL_t *status)
 Gets the status of loop on the specified interface. More...
 
open_error_t openapiLoopProtectIsPortDisabled (openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_BOOL_t *status)
 Gets the port status. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
open_error_t openapiLoopProtectPortAdminModeGet (openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_CONTROL_t *mode)
 Gets the loop protection admin mode for the interface. More...
 
open_error_t openapiLoopProtectPortAdminModeSet (openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_CONTROL_t mode)
 Sets the loop protection admin mode for the interface. More...
 
open_error_t openapiLoopProtectPortloopDetectCountGet (openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *loopCount)
 Gets the loop Count for the specified interface. More...
 
open_error_t openapiLoopProtectPortPacketRxCountGet (openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *count)
 Gets the receive loop count for the specified interface. More...
 
open_error_t openapiLoopProtectPortPacketTxCountGet (openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *count)
 Gets the transmit loop count for the specified interface. More...
 
open_error_t openapiLoopProtectPortStatsClear (openapiClientHandle_t *client_handle, uint32_t ifNum)
 Clears statistics of the specified interface. More...
 
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. More...
 
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. More...
 
open_error_t openapiLoopProtectPortTxModeSet (openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_CONTROL_t mode)
 Sets the transmission mode for the LoopProtection PDU's. More...
 
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. More...
 
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. More...
 
open_error_t openapiLoopProtectTxTimerGet (openapiClientHandle_t *client_handle, uint32_t *timerVal)
 Gets the transmission timer for the LoopProtection PDU's. More...
 
open_error_t openapiLoopProtectTxTimerSet (openapiClientHandle_t *client_handle, uint32_t timerVal)
 Sets the transmission timer for the LoopProtection PDU's. More...
 
open_error_t openapiLoopProtectValidIntfFirstGet (openapiClientHandle_t *client_handle, uint32_t *ifNum)
 Gets the first interface that is valid for loop protection. More...
 
open_error_t openapiLoopProtectValidIntfNextGet (openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *nextIfNum)
 Gets the next interface that is valid for loop protection. More...
 

Detailed Description

Function Documentation

open_error_t openapiLoopProtectAdminModeGet ( openapiClientHandle_t client_handle,
OPEN_CONTROL_t adminMode 
)

Gets the LoopProtection global mode.

Parameters
[in]client_handleClient handle from registration API
[out]adminModeLoopProtection global admin mode
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
OPEN_E_UNAVAILFeature not available

OpEN API Version: 1.25

Examples:
loop_protect_example.c.
open_error_t openapiLoopProtectAdminModeSet ( openapiClientHandle_t client_handle,
OPEN_CONTROL_t  adminMode 
)

Sets the LoopProtection global mode.

Parameters
[in]client_handleClient handle from registration API
[in]adminModeLoopProtection global admin mode
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
OPEN_E_UNAVAILFeature not available
Note
Calling this API will change the running configuration of the switch

OpEN API Version: 1.25

Examples:
loop_protect_example.c.
open_error_t openapiLoopProtectAllStatsClear ( openapiClientHandle_t client_handle)

Clears the statistics for all interfaces.

Parameters
[in]client_handleClient handle from registration API
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
OPEN_E_UNAVAILFeature not available

OpEN API Version: 1.25

Examples:
loop_protect_example.c.
open_error_t openapiLoopProtectDisableTimerGet ( openapiClientHandle_t client_handle,
uint32_t *  val 
)

Gets the disable duration for the port.

Parameters
[in]client_handleClient handle from registration API
[out]valDisable duration in seconds
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
OPEN_E_UNAVAILFeature not available

OpEN API Version: 1.25

Examples:
loop_protect_example.c.
open_error_t openapiLoopProtectDisableTimerSet ( openapiClientHandle_t client_handle,
uint32_t  val 
)

Sets the disable duration for the port.

Parameters
[in]client_handleClient handle from registration API
[in]valDisable duration in seconds
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
OPEN_E_UNAVAILFeature not available
Note
Calling this API will change the running configuration of the switch

OpEN API Version: 1.25

Examples:
loop_protect_example.c.
open_error_t openapiLoopProtectIsLoopDetected ( openapiClientHandle_t client_handle,
uint32_t  ifNum,
OPEN_BOOL_t status 
)

Gets the status of loop on the specified interface.

Parameters
[in]client_handleClient handle from registration API
[in]ifNumInterface number
[out]statusLoop status
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
OPEN_E_UNAVAILFeature not available

OpEN API Version: 1.25

Examples:
loop_protect_example.c.
open_error_t openapiLoopProtectIsPortDisabled ( openapiClientHandle_t client_handle,
uint32_t  ifNum,
OPEN_BOOL_t status 
)

Gets the port status.

whether port is in D-Disable state due to loop protection.

Parameters
[in]client_handleClient handle from registration API
[in]ifNumInterface number
[out]statusPort status
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
OPEN_E_UNAVAILFeature not available

OpEN API Version: 1.25

Examples:
loop_protect_example.c.
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.

Parameters
[in]client_handleClient handle from registration API
[in]ifNumInterface number
[out]statusPort status
Return values
OPEN_E_NONEOn success.
OPEN_E_PARAMInvalid argument.
OPEN_E_UNAVAILFeature not available

OpEN API Version: 1.25

Examples:
loop_protect_example.c.
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.

Parameters
[in]client_handleClient handle from registration API
[out]valMaximum number of PDU's
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
OPEN_E_UNAVAILFeature not available

OpEN API Version: 1.25

Examples:
loop_protect_example.c.
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.

Parameters
[in]client_handleClient handle from registration API
[in]valMaximum number of PDU's
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
OPEN_E_UNAVAILFeature not available
Note
Calling this API will change the running configuration of the switch

OpEN API Version: 1.25

Examples:
loop_protect_example.c.
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.

Parameters
[in]client_handleClient handle from registration API
[in]ifNumInterface number
[out]modePort action configured on the port
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
OPEN_E_UNAVAILFeature not available

OpEN API Version: 1.25

Examples:
loop_protect_example.c.
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.

Parameters
[in]client_handleClient handle from registration API
[in]ifNumInterface number
[in]modePort action to be configured on the port
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
OPEN_E_UNAVAILFeature not available
Note
Calling this API will change the running configuration of the switch

OpEN API Version: 1.25

Examples:
loop_protect_example.c.
open_error_t openapiLoopProtectPortAdminModeGet ( openapiClientHandle_t client_handle,
uint32_t  ifNum,
OPEN_CONTROL_t mode 
)

Gets the loop protection admin mode for the interface.

Parameters
[in]client_handleClient handle from registration API
[in]ifNumInterface number
[out]modeInterface admin mode
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
OPEN_E_UNAVAILFeature not available

OpEN API Version: 1.25

Examples:
loop_protect_example.c.
open_error_t openapiLoopProtectPortAdminModeSet ( openapiClientHandle_t client_handle,
uint32_t  ifNum,
OPEN_CONTROL_t  mode 
)

Sets the loop protection admin mode for the interface.

Parameters
[in]client_handleClient handle from registration API
[in]ifNumInterface number
[in]modeInterface admin mode
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
OPEN_E_UNAVAILFeature not available
Note
Calling this API will change the running configuration of the switch

OpEN API Version: 1.25

Examples:
loop_protect_example.c.
open_error_t openapiLoopProtectPortloopDetectCountGet ( openapiClientHandle_t client_handle,
uint32_t  ifNum,
uint32_t *  loopCount 
)

Gets the loop Count for the specified interface.

Parameters
[in]client_handleClient handle from registration API
[in]ifNumInterface number
[out]loopCountLoop count value
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
OPEN_E_UNAVAILFeature not available

OpEN API Version: 1.25

Examples:
loop_protect_example.c.
open_error_t openapiLoopProtectPortPacketRxCountGet ( openapiClientHandle_t client_handle,
uint32_t  ifNum,
uint32_t *  count 
)

Gets the receive loop count for the specified interface.

Parameters
[in]client_handleClient handle from registration API
[in]ifNumInterface number
[out]countReceive loop count
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
OPEN_E_UNAVAILFeature not available

OpEN API Version: 1.25

Examples:
loop_protect_example.c.
open_error_t openapiLoopProtectPortPacketTxCountGet ( openapiClientHandle_t client_handle,
uint32_t  ifNum,
uint32_t *  count 
)

Gets the transmit loop count for the specified interface.

Parameters
[in]client_handleClient handle from registration API
[in]ifNumInterface number
[out]countTransmit loop count
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
OPEN_E_UNAVAILFeature not available

OpEN API Version: 1.25

Examples:
loop_protect_example.c.
open_error_t openapiLoopProtectPortStatsClear ( openapiClientHandle_t client_handle,
uint32_t  ifNum 
)

Clears statistics of the specified interface.

Parameters
[in]client_handleClient handle from registration API
[in]ifNumInterface number
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
OPEN_E_UNAVAILFeature not available

OpEN API Version: 1.25

Examples:
loop_protect_example.c.
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.

Parameters
[in]client_handleClient handle from registration API
[in]ifNumInterface number
[out]timeValTime value
[in]needUtcFlag L7_TRUE for UTC time and L7_FALSE for raw time
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
OPEN_E_UNAVAILFeature not available

OpEN API Version: 1.25

Examples:
loop_protect_example.c.
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.

Parameters
[in]client_handleClient handle from registration API
[in]ifNumInterface number
[out]modeTransmit mode
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
OPEN_E_UNAVAILFeature not available

OpEN API Version: 1.25

Examples:
loop_protect_example.c.
open_error_t openapiLoopProtectPortTxModeSet ( openapiClientHandle_t client_handle,
uint32_t  ifNum,
OPEN_CONTROL_t  mode 
)

Sets the transmission mode for the LoopProtection PDU's.

Parameters
[in]client_handleClient handle from registration API
[in]ifNumInterface number
[in]modeTransmit mode
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
OPEN_E_UNAVAILFeature not available
Note
Calling this API will change the running configuration of the switch

OpEN API Version: 1.25

Examples:
loop_protect_example.c.
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.

Parameters
[in]client_handleClient handle from registration API
[in]ifNumInterface number
[out]tpidTPID value
[out]vlanIdVLAN ID
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
OPEN_E_UNAVAILFeature not available

OpEN API Version: 1.25

Examples:
loop_protect_example.c.
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.

Parameters
[in]client_handleClient handle from registration API
[in]ifNumInterface number
[in]tpidTPID value
[in]vlanIdVLAN ID
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
OPEN_E_UNAVAILFeature not available
Note
Calling this API will change the running configuration of the switch

OpEN API Version: 1.25

Examples:
loop_protect_example.c.
open_error_t openapiLoopProtectTxTimerGet ( openapiClientHandle_t client_handle,
uint32_t *  timerVal 
)

Gets the transmission timer for the LoopProtection PDU's.

Parameters
[in]client_handleClient handle from registration API
[out]timerValTimer value
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
OPEN_E_UNAVAILFeature not available

OpEN API Version: 1.25

Examples:
loop_protect_example.c.
open_error_t openapiLoopProtectTxTimerSet ( openapiClientHandle_t client_handle,
uint32_t  timerVal 
)

Sets the transmission timer for the LoopProtection PDU's.

Parameters
[in]client_handleClient handle from registration API
[in]timerValTimer value
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
OPEN_E_UNAVAILFeature not available
Note
Calling this API will change the running configuration of the switch

OpEN API Version: 1.25

Examples:
loop_protect_example.c.
open_error_t openapiLoopProtectValidIntfFirstGet ( openapiClientHandle_t client_handle,
uint32_t *  ifNum 
)

Gets the first interface that is valid for loop protection.

Parameters
[in]client_handleClient handle from registration API
[out]ifNumInterface number
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
OPEN_E_UNAVAILFeature not available

OpEN API Version: 1.25

Examples:
loop_protect_example.c.
open_error_t openapiLoopProtectValidIntfNextGet ( openapiClientHandle_t client_handle,
uint32_t  ifNum,
uint32_t *  nextIfNum 
)

Gets the next interface that is valid for loop protection.

Parameters
[in]client_handleClient handle from registration API
[in]ifNumInterface number
[out]nextIfNumNext valid interface number
Return values
OPEN_E_NONEOn success.
OPEN_E_FAILOn failure.
OPEN_E_PARAMInvalid argument.
OPEN_E_UNAVAILFeature not available

OpEN API Version: 1.25

Examples:
loop_protect_example.c.