Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.6.0.3
Macros | Enumerations | Functions
Provide An External API To Applications In Other Processes [OPENAPI_PBVLAN]

Macros

#define OPENAPI_PBVLAN_MAX_CONFIGURABLE_PROTOCOLS   16
 Maximum number of protocols which could be added to the PBVLAN group. More...
 
#define OPENAPI_PBVLAN_MAX_GROUP_NAME   16
 Maximum length of the PBVLAN group name. More...
 
#define OPENAPI_PBVLAN_MAX_NUM_GROUPS   128
 Maximum ID of the PBVLAN group. More...
 
#define OPENAPI_PBVLAN_MIN_GROUP_NAME   1
 Minumum length of the PBVLAN group name. More...
 
#define OPENAPI_PBVLAN_MIN_NUM_GROUPS   1
 Minumum ID of the PBVLAN group. More...
 

Enumerations

enum  OPENAPI_PBVLAN_PROT_TYPE_t { OPENAPI_PBVLAN_STR_PROT_TYPE = 0, OPENAPI_PBVLAN_NUM_PROT_TYPE = 1 }
 Protocol type indicates type of the protocol format. More...
 

Functions

open_error_t openapiPbVlanGroupCreate (openapiClientHandle_t *client_handle, uint32_t groupId)
 Create a Protocol-Based VLAN group. More...
 
open_error_t openapiPbVlanGroupDelete (openapiClientHandle_t *client_handle, uint32_t groupId)
 Delete a Protocol-Based VLAN group. More...
 
open_error_t openapiPbVlanGroupGetFirst (openapiClientHandle_t *client_handle, uint32_t *groupId)
 Get the ID of the first created Protocol-Based VLAN group. More...
 
open_error_t openapiPbVlanGroupGetNext (openapiClientHandle_t *client_handle, uint32_t groupId, uint32_t *nextGroupId)
 Get the ID of the next created Protocol-Based VLAN group. More...
 
open_error_t openapiPbVlanGroupIdGet (openapiClientHandle_t *client_handle, open_buffdesc *groupName, uint32_t *groupId)
 Get the group ID of the Protocol-Based VLAN group with specified name. More...
 
open_error_t openapiPbVlanGroupNameGet (openapiClientHandle_t *client_handle, uint32_t groupId, open_buffdesc *groupName)
 Get the group name of the specified Protocol-Based VLAN group. More...
 
open_error_t openapiPbVlanGroupNameSet (openapiClientHandle_t *client_handle, uint32_t groupId, open_buffdesc *groupName)
 Set the group name of the specified Protocol-Based VLAN group. More...
 
open_error_t openapiPbVlanGroupPortAdd (openapiClientHandle_t *client_handle, uint32_t groupId, uint32_t ifNum)
 Add an interface to the specified Protocol-Based VLAN group. More...
 
open_error_t openapiPbVlanGroupPortDelete (openapiClientHandle_t *client_handle, uint32_t groupId, uint32_t ifNum)
 Delete an interfcae from the specified Protocol-Based VLAN group. More...
 
open_error_t openapiPbVlanGroupPortGetNext (openapiClientHandle_t *client_handle, uint32_t groupId, uint32_t ifNum, uint32_t *nextIfNum)
 Get the next configured interface of the Protocol-Based VLAN group. More...
 
open_error_t openapiPbVlanGroupProtocolAdd (openapiClientHandle_t *client_handle, uint32_t groupId, uint32_t prot, OPENAPI_PBVLAN_PROT_TYPE_t protType)
 Add a protocol to the specified Protocol-Based VLAN group. More...
 
open_error_t openapiPbVlanGroupProtocolDelete (openapiClientHandle_t *client_handle, uint32_t groupId, uint32_t prot)
 Delete a protocol from the specified Protocol-Based VLAN group. More...
 
open_error_t openapiPbVlanGroupProtocolGet (openapiClientHandle_t *client_handle, uint32_t groupId, open_buffdesc *protList)
 Get the comma separated list with all configured protocols of the Protocol-Based VLAN group. More...
 
open_error_t openapiPbVlanGroupProtocolGetNext (openapiClientHandle_t *client_handle, uint32_t groupId, uint32_t prot, uint32_t *nextProt)
 Get the next configured protocol of the Protocol-Based VLAN group. More...
 
open_error_t openapiPbVlanGroupVlanIDAdd (openapiClientHandle_t *client_handle, uint32_t groupId, uint32_t vlanId)
 Add a VLAN to the specified Protocol-Based VLAN group. More...
 
open_error_t openapiPbVlanGroupVlanIDDelete (openapiClientHandle_t *client_handle, uint32_t groupId, uint32_t vlanId)
 Delete a VLAN from the specified Protocol-Based VLAN group. More...
 
open_error_t openapiPbVlanGroupVlanIDGet (openapiClientHandle_t *client_handle, uint32_t groupId, uint32_t *vlanId)
 Get the VLAN ID of the Protocol-Based VLAN group. More...
 
open_error_t openapiPbVlanIntfValidate (openapiClientHandle_t *client_handle, uint32_t ifNum)
 Check whether specified interface is valid for the Protocol-Based VLAN configuration. More...
 

Detailed Description

Macro Definition Documentation

#define OPENAPI_PBVLAN_MAX_CONFIGURABLE_PROTOCOLS   16

Maximum number of protocols which could be added to the PBVLAN group.

Definition at line 52 of file openapi_pbvlan.h.

#define OPENAPI_PBVLAN_MAX_GROUP_NAME   16

Maximum length of the PBVLAN group name.

Definition at line 51 of file openapi_pbvlan.h.

#define OPENAPI_PBVLAN_MAX_NUM_GROUPS   128

Maximum ID of the PBVLAN group.

Definition at line 49 of file openapi_pbvlan.h.

#define OPENAPI_PBVLAN_MIN_GROUP_NAME   1

Minumum length of the PBVLAN group name.

Definition at line 50 of file openapi_pbvlan.h.

#define OPENAPI_PBVLAN_MIN_NUM_GROUPS   1

Minumum ID of the PBVLAN group.

Definition at line 48 of file openapi_pbvlan.h.

Enumeration Type Documentation

Protocol type indicates type of the protocol format.

Enumerator
OPENAPI_PBVLAN_STR_PROT_TYPE 

if protocol was given as string

OPENAPI_PBVLAN_NUM_PROT_TYPE 

if protocol was given as number (or hex)

Definition at line 55 of file openapi_pbvlan.h.

Function Documentation

open_error_t openapiPbVlanGroupCreate ( openapiClientHandle_t client_handle,
uint32_t  groupId 
)

Create a Protocol-Based VLAN group.

Parameters
[in]client_handleClient handle from registration API
[in]groupIdProtocol-Based VLAN group ID:
-Minimum value OPENAPI_PBVLAN_MIN_NUM_GROUPS
-Maximum value OPENAPI_PBVLAN_MAX_NUM_GROUPS
Return values
OPEN_E_NONEif the group is created successfully.
OPEN_E_FAILif failed to create the group.
OPEN_E_EXISTSif the group with specified ID is already configured.
OPEN_E_PARAMif invalid parameter is passed.
Note
Calling this API will change the running configuration of the switch.

OpEN API Version: 1.11

Examples:
pbvlan_example.c.
open_error_t openapiPbVlanGroupDelete ( openapiClientHandle_t client_handle,
uint32_t  groupId 
)

Delete a Protocol-Based VLAN group.

Parameters
[in]client_handleClient handle from registration API
[in]groupIdProtocol-Based VLAN group ID:
-Minimum value OPENAPI_PBVLAN_MIN_NUM_GROUPS
-Maximum value OPENAPI_PBVLAN_MAX_NUM_GROUPS
Return values
OPEN_E_NONEif the group is deleted successfully.
OPEN_E_FAILif failed to delete the group.
OPEN_E_NOT_FOUNDif the group with specified ID is not found.
OPEN_E_PARAMif invalid parameter is passed.
Note
Calling this API will change the running configuration of the switch.

OpEN API Version: 1.11

Examples:
pbvlan_example.c.
open_error_t openapiPbVlanGroupGetFirst ( openapiClientHandle_t client_handle,
uint32_t *  groupId 
)

Get the ID of the first created Protocol-Based VLAN group.

Parameters
[in]client_handleClient handle from registration API
[out]groupIdProtocol-Based VLAN group ID
Return values
OPEN_E_NONEif the ID of the first group is returned.
OPEN_E_FAILif failed to get the ID of the first group.
OPEN_E_PARAMif invalid parameter is passed.

OpEN API Version: 1.11

Examples:
pbvlan_example.c.
open_error_t openapiPbVlanGroupGetNext ( openapiClientHandle_t client_handle,
uint32_t  groupId,
uint32_t *  nextGroupId 
)

Get the ID of the next created Protocol-Based VLAN group.

Parameters
[in]client_handleClient handle from registration API
[in]groupIdProtocol-Based VLAN group ID:
-Minimum value OPENAPI_PBVLAN_MIN_NUM_GROUPS
-Maximum value OPENAPI_PBVLAN_MAX_NUM_GROUPS
[out]nextGroupIdProtocol-Based VLAN group ID
Return values
OPEN_E_NONEif the ID of the next group is returned.
OPEN_E_FAILif failed to get the ID of the next group.
OPEN_E_NOT_FOUNDif the group with specified ID is not found.
OPEN_E_PARAMif invalid parameter is passed.

OpEN API Version: 1.11

Examples:
pbvlan_example.c.
open_error_t openapiPbVlanGroupIdGet ( openapiClientHandle_t client_handle,
open_buffdesc groupName,
uint32_t *  groupId 
)

Get the group ID of the Protocol-Based VLAN group with specified name.

Parameters
[in]client_handleClient handle from registration API
[in]groupNameBuffer descriptor with group name:
-Minimum length OPENAPI_PBVLAN_MIN_GROUP_NAME
-Maximum length OPENAPI_PBVLAN_MAX_GROUP_NAME
[out]groupIdProtocol-Based VLAN group ID
Return values
OPEN_E_NONEif the group ID for the group with specified name is returned.
OPEN_E_FAILif failed to get the group ID for the group with specified name or group with specified name does not exist.
OPEN_E_PARAMif invalid parameter is passed.

OpEN API Version: 1.11

Examples:
pbvlan_example.c.
open_error_t openapiPbVlanGroupNameGet ( openapiClientHandle_t client_handle,
uint32_t  groupId,
open_buffdesc groupName 
)

Get the group name of the specified Protocol-Based VLAN group.

Parameters
[in]client_handleClient handle from registration API
[in]groupIdProtocol-Based VLAN group ID:
-Minimum value OPENAPI_PBVLAN_MIN_NUM_GROUPS
-Maximum value OPENAPI_PBVLAN_MAX_NUM_GROUPS
[out]groupNameBuffer descriptor with group name:
-Minimum allowed value of buffer length is OPENAPI_PBVLAN_MAX_GROUP_NAME
Return values
OPEN_E_NONEif the group name for the specified group is returned.
OPEN_E_FAILif failed to get the group name for the specified group.
OPEN_E_NOT_FOUNDif the group with specified ID is not found.
OPEN_E_PARAMif invalid parameter is passed.

OpEN API Version: 1.11

Examples:
pbvlan_example.c.
open_error_t openapiPbVlanGroupNameSet ( openapiClientHandle_t client_handle,
uint32_t  groupId,
open_buffdesc groupName 
)

Set the group name of the specified Protocol-Based VLAN group.

Parameters
[in]client_handleClient handle from registration API
[in]groupIdProtocol-Based VLAN group ID:
-Minimum value OPENAPI_PBVLAN_MIN_NUM_GROUPS
-Maximum value OPENAPI_PBVLAN_MAX_NUM_GROUPS
[in]groupNameBuffer descriptor with group name:
-Minimum length OPENAPI_PBVLAN_MIN_GROUP_NAME
-Maximum length OPENAPI_PBVLAN_MAX_GROUP_NAME
Return values
OPEN_E_NONEif the group name for the specified group is set successfully.
OPEN_E_FAILif failed to set the group name for the specified group.
OPEN_E_NOT_FOUNDif the group with specified ID is not found.
OPEN_E_PARAMif invalid parameter is passed.
Note
Calling this API will change the running configuration of the switch

OpEN API Version: 1.11

Examples:
pbvlan_example.c.
open_error_t openapiPbVlanGroupPortAdd ( openapiClientHandle_t client_handle,
uint32_t  groupId,
uint32_t  ifNum 
)

Add an interface to the specified Protocol-Based VLAN group.

Parameters
[in]client_handleClient handle from registration API
[in]groupIdProtocol-Based VLAN group ID:
-Minimum value OPENAPI_PBVLAN_MIN_NUM_GROUPS
-Maximum value OPENAPI_PBVLAN_MAX_NUM_GROUPS
[in]ifNumNumber of the interface to be added to the group,
-only physical and LAG interfaces are allowed:
-Minimum value 1
-Maximum value openapiMaxInterfaceCountGet()
Return values
OPEN_E_NONEif interface is added to the group successfully.
OPEN_E_FAILif failed to add interface to the group.
OPEN_E_NOT_FOUNDif the group with specified ID is not found.
OPEN_E_PARAMif invalid parameter is passed.
Note
Calling this API will change the running configuration of the switch.

OpEN API Version: 1.11

Examples:
pbvlan_example.c.
open_error_t openapiPbVlanGroupPortDelete ( openapiClientHandle_t client_handle,
uint32_t  groupId,
uint32_t  ifNum 
)

Delete an interfcae from the specified Protocol-Based VLAN group.

Parameters
[in]client_handleClient handle from registration API
[in]groupIdProtocol-Based VLAN group ID:
-Minimum value OPENAPI_PBVLAN_MIN_NUM_GROUPS
-Maximum value OPENAPI_PBVLAN_MAX_NUM_GROUPS
[in]ifNumNumber of the interface to be deleted from the group,
-only physical and LAG interfaces are allowed:
-Minimum value 1
-Maximum value openapiMaxInterfaceCountGet()
Return values
OPEN_E_NONEif interface is deleted from the group successfully.
OPEN_E_FAILif failed to delete interface from the group.
OPEN_E_NOT_FOUNDif the group with specified ID is not found.
OPEN_E_ERRORif specified interface is not assigned to the specified group.
OPEN_E_PARAMif invalid parameter is passed.
Note
Calling this API will change the running configuration of the switch.

OpEN API Version: 1.11

Examples:
pbvlan_example.c.
open_error_t openapiPbVlanGroupPortGetNext ( openapiClientHandle_t client_handle,
uint32_t  groupId,
uint32_t  ifNum,
uint32_t *  nextIfNum 
)

Get the next configured interface of the Protocol-Based VLAN group.

Parameters
[in]client_handleClient handle from registration API
[in]groupIdProtocol-Based VLAN group ID:
-Minimum value OPENAPI_PBVLAN_MIN_NUM_GROUPS
-Maximum value OPENAPI_PBVLAN_MAX_NUM_GROUPS
[in]ifNumNumber of the interface to be deleted from the group,
-only physical and LAG interfaces are allowed:
-Minimum value 1
-Maximum value openapiMaxInterfaceCountGet()
[out]nextIfNumNumber of the next configured interface
Return values
OPEN_E_NONEif next configured interface is returned.
OPEN_E_FAILif failed to get next configured interface.
OPEN_E_NOT_FOUNDif the group with specified ID is not found.
OPEN_E_ERRORif specified interface is not assigned to the specified group.
OPEN_E_PARAMif invalid parameter is passed.
Note
The value of 'ifNum' should be zero (0) when trying to find the first interface of the group.

OpEN API Version: 1.11

Examples:
pbvlan_example.c.
open_error_t openapiPbVlanGroupProtocolAdd ( openapiClientHandle_t client_handle,
uint32_t  groupId,
uint32_t  prot,
OPENAPI_PBVLAN_PROT_TYPE_t  protType 
)

Add a protocol to the specified Protocol-Based VLAN group.

Parameters
[in]client_handleClient handle from registration API
[in]groupIdProtocol-Based VLAN group ID:
-Minimum value OPENAPI_PBVLAN_MIN_NUM_GROUPS
-Maximum value OPENAPI_PBVLAN_MAX_NUM_GROUPS
[in]protProtocol to be added to the group:
-Minimum value OPENAPI_PROTOCOL_HEX_MIN
-Maximum value OPENAPI_PROTOCOL_HEX_MAX
[in]protTypeType of the protocol format:
-OPENAPI_PBVLAN_STR_PROT_TYPE - if protocol was given as string
-OPENAPI_PBVLAN_NUM_PROT_TYPE - if protocol was given as number (or hex)
Return values
OPEN_E_NONEif protocol is added to the group successfully.
OPEN_E_FAILif failed to add protocol to the group.
OPEN_E_NOT_FOUNDif the group with specified ID is not found.
OPEN_E_EXISTSif the procol is already added to the group.
OPEN_E_FULLif max count of protocols were added to the group.
OPEN_E_PARAMif invalid parameter is passed.
Note
Calling this API will change the running configuration of the switch.

OpEN API Version: 1.11

Examples:
pbvlan_example.c.
open_error_t openapiPbVlanGroupProtocolDelete ( openapiClientHandle_t client_handle,
uint32_t  groupId,
uint32_t  prot 
)

Delete a protocol from the specified Protocol-Based VLAN group.

Parameters
[in]client_handleClient handle from registration API
[in]groupIdProtocol-Based VLAN group ID:
-Minimum value OPENAPI_PBVLAN_MIN_NUM_GROUPS
-Maximum value OPENAPI_PBVLAN_MAX_NUM_GROUPS
[in]protProtocol to be deleted from the group:
-Minimum value OPENAPI_PROTOCOL_HEX_MIN
-Maximum value OPENAPI_PROTOCOL_HEX_MAX
Return values
OPEN_E_NONEif protocol is deleted from the group successfully.
OPEN_E_FAILif failed to delete protocol from the group.
OPEN_E_NOT_FOUNDif the group with specified ID is not found.
OPEN_E_ERRORif specified protocol is not assigned to the specified group.
OPEN_E_PARAMif invalid parameter is passed.
Note
Calling this API will change the running configuration of the switch.

OpEN API Version: 1.11

Examples:
pbvlan_example.c.
open_error_t openapiPbVlanGroupProtocolGet ( openapiClientHandle_t client_handle,
uint32_t  groupId,
open_buffdesc protList 
)

Get the comma separated list with all configured protocols of the Protocol-Based VLAN group.

Parameters
[in]client_handleClient handle from registration API
[in]groupIdProtocol-Based VLAN group ID:
-Minimum value OPENAPI_PBVLAN_MIN_NUM_GROUPS
-Maximum value OPENAPI_PBVLAN_MAX_NUM_GROUPS
[out]protListComma separated list of configured protocls:
-Minimum allowed value of buffer length is OPENAPI_MAX_STRING_LENGTH
Return values
OPEN_E_NONEif next configured protocol is returned.
OPEN_E_FAILif failed to get next configured protocol.
OPEN_E_NOT_FOUNDif the group with specified ID is not found.
OPEN_E_PARAMif invalid parameter is passed.

OpEN API Version: 1.11

Examples:
pbvlan_example.c.
open_error_t openapiPbVlanGroupProtocolGetNext ( openapiClientHandle_t client_handle,
uint32_t  groupId,
uint32_t  prot,
uint32_t *  nextProt 
)

Get the next configured protocol of the Protocol-Based VLAN group.

Parameters
[in]client_handleClient handle from registration API
[in]groupIdProtocol-Based VLAN group ID:
-Minimum value OPENAPI_PBVLAN_MIN_NUM_GROUPS
-Maximum value OPENAPI_PBVLAN_MAX_NUM_GROUPS
[in]protConfigured protocol of the group:
-Minimum value OPENAPI_PROTOCOL_HEX_MIN
-Maximum value OPENAPI_PROTOCOL_HEX_MAX
[out]nextProtNext configured protocol of the group
Return values
OPEN_E_NONEif next configured protocol is returned.
OPEN_E_FAILif failed to get next configured protocol.
OPEN_E_NOT_FOUNDif the group with specified ID is not found.
OPEN_E_ERRORif specified protocol is not assigned to the specified group.
OPEN_E_PARAMif invalid parameter is passed.
Note
The value of 'prot' should be zero (0) when trying to find the first protocol of the group.

OpEN API Version: 1.11

open_error_t openapiPbVlanGroupVlanIDAdd ( openapiClientHandle_t client_handle,
uint32_t  groupId,
uint32_t  vlanId 
)

Add a VLAN to the specified Protocol-Based VLAN group.

Parameters
[in]client_handleClient handle from registration API
[in]groupIdProtocol-Based VLAN group ID:
-Minimum value OPENAPI_PBVLAN_MIN_NUM_GROUPS
-Maximum value OPENAPI_PBVLAN_MAX_NUM_GROUPS
[in]vlanIdVLAN ID to be added:
-Minimum value OPENAPI_DOT1Q_MIN_VLAN_ID
-Maximum value OPENAPI_DOT1Q_MAX_VLAN_ID
Return values
OPEN_E_NONEif VLAN is added to the group successfully.
OPEN_E_FAILif failed to add VLAN to the group.
OPEN_E_NOT_FOUNDif the group with specified ID is not found.
OPEN_E_PARAMif invalid parameter is passed.
Note
Calling this API will change the running configuration of the switch.

OpEN API Version: 1.11

Examples:
pbvlan_example.c.
open_error_t openapiPbVlanGroupVlanIDDelete ( openapiClientHandle_t client_handle,
uint32_t  groupId,
uint32_t  vlanId 
)

Delete a VLAN from the specified Protocol-Based VLAN group.

Parameters
[in]client_handleClient handle from registration API
[in]groupIdProtocol-Based VLAN group ID:
-Minimum value OPENAPI_PBVLAN_MIN_NUM_GROUPS
-Maximum value OPENAPI_PBVLAN_MAX_NUM_GROUPS
[in]vlanIdVLAN ID to be deleted:
-Minimum value OPENAPI_DOT1Q_MIN_VLAN_ID
-Maximum value OPENAPI_DOT1Q_MAX_VLAN_ID
Return values
OPEN_E_NONEif VLAN is deleted from the group successfully.
OPEN_E_FAILif failed to delete VLAN from the group.
OPEN_E_NOT_FOUNDif the group with specified ID is not found.
OPEN_E_ERRORif specified VLAN is not assigned to the specified group.
OPEN_E_PARAMif invalid parameter is passed.
Note
Calling this API will change the running configuration of the switch.

OpEN API Version: 1.11

Examples:
pbvlan_example.c.
open_error_t openapiPbVlanGroupVlanIDGet ( openapiClientHandle_t client_handle,
uint32_t  groupId,
uint32_t *  vlanId 
)

Get the VLAN ID of the Protocol-Based VLAN group.

Parameters
[in]client_handleClient handle from registration API
[in]groupIdProtocol-Based VLAN group ID:
-Minimum value OPENAPI_PBVLAN_MIN_NUM_GROUPS
-Maximum value OPENAPI_PBVLAN_MAX_NUM_GROUPS
[out]vlanIdVLAN ID of to the group
Return values
OPEN_E_NONEif the VLAN ID of the group is returned.
OPEN_E_FAILif failed to VLAN ID of the group with specified ID.
OPEN_E_NOT_FOUNDif the group with specified ID is not found.
OPEN_E_PARAMif invalid parameter is passed.

OpEN API Version: 1.11

Examples:
pbvlan_example.c.
open_error_t openapiPbVlanIntfValidate ( openapiClientHandle_t client_handle,
uint32_t  ifNum 
)

Check whether specified interface is valid for the Protocol-Based VLAN configuration.

Parameters
[in]client_handleClient handle from registration API
[in]ifNumNumber of the interface to be checked
-Minimum value 1
-Maximum value openapiMaxInterfaceCountGet()
Return values
OPEN_E_NONEif an interface could be used for the Protocol-Based VLAN configuration.
OPEN_E_FAILif an interface couldn't be used for the Protocol-Based VLAN configuration.
OPEN_E_PARAMif invalid parameter is passed.

OpEN API Version: 1.11

Examples:
pbvlan_example.c.