Open Ethernet Networking (OpEN) API Guide and Reference Manual
3.6.0.3
|
This document provides a brief description of the Protocol-Based VLAN OpEN APIs. It provides the following services:
All 'Create', 'Add', 'Delete' and 'Set' operations would affect the Switch behavior and configuration.
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.
pbvlan_example.c is a sample application that demonstrates the use of the Protocol-Based VLAN OpEN API. pbvlan_example.c is started from the command line and creates Protocol-Based VLAN group with group ID 10. After all tests this group will be deleted from the switch. The example continues to test the ability to set and get the available global attributes. The following is a list and sequence of these tests:
# ./pbvlan_example
ICOS version = 4.29.5.48
The new Protocol-Based VLAN group with specified ID (10) has successfully been created. (result = 0)
ID of the first created Protocol-Based VLAN group is 10. (result = 0)
Failed to get ID of the next Protocol-Based VLAN group. (result = -26)
The name (new_name) of the Protocol-Based VLAN group with specified ID (10) has successfully been set. (result = 0)
The name of the Protocol-Based VLAN group with specified ID (10) is new_name. (result = 0)
The ID of the Protocol-Based VLAN group with specified name (new_name) is 10. (result = 0)
The VLAN (10) has successfully been added to the Protocol-Based VLAN group with specified ID (10). (result = 0)
The VLAN ID of the Protocol-Based VLAN group with specified ID (10) is 10. (result = 0)
The VLAN (10) has successfully been deleted from the Protocol-Based VLAN group with specified ID (10). (result = 0)
The protocol (2184) has successfully been added to the Protocol-Based VLAN group with specified ID (10). (result = 0)
The list of protocols of the Protocol-Based VLAN group with specified ID (10) is 0x0888. (result = 0)
The protocol (2184) has successfully been deleted from the Protocol-Based VLAN group with specified ID (10). (result = 0)
The interface (1) could be used for the Protocol-Based VLAN configuration.. (result = 0)
The interface (1) has successfully been added to the Protocol-Based VLAN group with specified ID (10). (result = 0)
The first interface number of the Protocol-Based VLAN group with specified ID (10) is 1. (result = 0)
The interface (1) has successfully been deleted from the Protocol-Based VLAN group with specified ID (10). (result = 0)
Protocol-Based VLAN group with specified ID (10) has successfully been deleted. (result = 0)
Press enter to continue...
In addition to pbvlan_example.c, a python implementation has also been provided for demonstration purposes. This python pbvlan_example.py script essentially duplicates the pbvlan_example.c implementation.
CLI Command | OpEN API Reference ---------— | ----------— (Priv-User Mode)#
show port protocol <groupid>|all | openapiPbVlanGroupGetFirst()
openapiPbVlanGroupGetNext()
openapiPbVlanGroupNameGet()
openapiPbVlanGroupVlanIDGet()
openapiPbVlanGroupProtocolGet()
openapiPbVlanGroupProtocolGetNext()
openapiPbVlanGroupPortGetNext() (Config Mode)#
[no] vlan protocol group add protocol <groupid> ethertype <protocol-list|arp|ip|ipx> | openapiPbVlanGroupProtocolAdd()
openapiPbVlanGroupProtocolDelete() (Config Mode)#
[no] vlan protocol group name <groupid> <groupname> | openapiPbVlanGroupNameSet() (Vlan Mode)#
[no] protocol group <groupid> <vlanid>| openapiPbVlanGroupVlanIDAdd()
openapiPbVlanGroupVlanIDDelete() (Interface Mode)#
[no] protocol vlan group <groupid> | openapiPbVlanGroupPortAdd()
openapiPbVlanGroupPortDelete()