Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.6.0.3
Virtual LAN (VLAN)

VLAN's allow a network manager to logically segment a LAN into different broadcast domains. It allows simplified administration of the network with enhanced performance, reduced cost and greater security. Switchport configuration simplifies the VLAN-related setup of a port that is used to provide network connectivity to an external device (Access Port) or interconnect switch devices (Trunk Port), while still supporting traditional port setup (General Port). Private VLANs extend this concept to restrict layer 2 communication among endpoints while allowing access to certain network resources by categorizing an interface as either a host port, promiscuous port, promiscuous trunk, or isolated trunk.

VLAN OpEN API

This document provides a brief description of the VLAN OpEN API. The VLAN OpEN API allows processes outside of the ICOS main process (switchdrvr) access to VLAN Management services. It provides the following services:

All 'Set' operations would affect the Switch behavior and configuration.

Example C Application vlan_example

Initialization

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.

vlan_example

vlan_example.c is a sample application that demonstrates the use of the VLAN OpEN APIs. The vlan_example is started from the command line. It exercises all the VLAN OpEN APIs with appropriate arguments to manage the VLAN component in the ICOS main process (switchdrvr).

Example Python Application vlan_example

In addition to vlan_example.c, a python implementation has also been provided for demonstration purposes. This python vlan_example.py script essentially duplicates the vlan_example.c implementation.

Example Ruby Application vlan_example

In addition to vlan_example.c, a ruby implementation has also been provided for demonstration purposes. This ruby vlan_example.rb application essentially duplicates the vlan_example.c implementation.

Example C Application switchport_config_example

switchport_config_example

switchport_config_example.c is a sample application that demonstrates the use of the switchport related OpEN API functions. The switchport_config_example is started from the command line. It creates several VLANs to demonstrate how to set/get native VLAN, access VLAN, and allowed VLAN lists.

Example C Application pvlan_example

pvlan_example

pvlan_example.c is a sample application that demonstrates the use of the Private VLAN OpEN API functions. The pvlan_example is started from the command line. It shows several aspects of previously-created Private VLAN configuration information for a specified interface.

Usage: pvlan_example <test#> <interface> <arg1> <arg2> ...

Note: For best results, please configure private VLANs in the switch prior to running this example.

VLAN CLI/API Cross Reference

CLI Command OpEN API Reference
(Vlan)#
vlan <vlan-id>
openapiVlanCreate()
openapiVlanNextGet()
(Vlan)#
no vlan <vlan-id>
openapiVlanDelete()
(Vlan)#
vlan name <vlan-id> <name>
openapiVlanNameSet()
openapiVlanNameGet()
(Interface-Config Mode)#
vlan participation <exclude | include | auto> <vlan-id>
openapiVlanIfParticipationSet()
openapiVlanIfParticipationGet()
(Interface-Config Mode)#
vlan pvid <vlan-id>
openapiVlanIfPvidSet()
openapiVlanIfPvidGet()
(Interface-Config Mode)#
vlan tagging <vlan-id>
openapiVlanIfTaggingSet()
openapiVlanIfTaggingGet()
(Interface-Config Mode)#
vlan acceptFrame <admituntaggedonly> | <all> | <vlanonly>
openapiVlanIfAcceptFrameTypeSet()
openapiVlanIfAcceptFrameTypeGet()
(Priv-User Mode)#
show vlan
openapiVlanIsStatic()
(Config)#
[no]switchport mode private-vlan [host|promiscuous]
openapiDot1qSwPortModeSet()
(Config)#
[no]switchport access vlan <vlan-id>
openapiDot1qSwPortAccessVlanSet()
(Config)#
[no]switchport trunk native vlan <vlan-id>
openapiDot1qSwPortTrunkNativeVlanSet()
(Config)#
[no]vlan participation {exclude|include|auto} <1-4094>
openapiDot1qSwPortTrunkAllowedVlanListSet()
(Priv-User Mode)#
show vlan port {<slot/port> | all}
openapiDot1qSwPortModeGet()
(Priv-User Mode)#
show interfaces switchport access <interface-id>
openapiDot1qSwPortAccessVlanGet()
(Priv-User Mode)#
show interfaces switchport trunk <interface-id>
openapiDot1qSwPortTrunkNativeVlanGet()
(Priv-User Mode)#
show interfaces switchport {<interface-id> <groupid>}
openapiDot1qSwPortTrunkAllowedVlanListGet()
openapiDot1qSwPortForbiddenVlanListGet()
openapiDot1qSwPortUntaggedVlanListGet()
openapiDot1qSwPortTaggedVlanListGet()
openapiDot1qSwPortDynamicallyAddedVlanListGet()
(Priv-User-Mode)#
show interface ethernet <interface-id> switchport
openapiPvlanIntfModeGet()
openapiPvlanIntfHostAssocGet()
openapiPvlanIntfPromiscAssocGet()
openapiPvlanIntfOperAssocGet()
openapiPvlanIntfPromiscTrunkAssocNextGet()
openapiPvlanIntfIsolatedTrunkAssocNextGet()
openapiPvlanIntfTrunkNativeVlanGet()
openapiPvlanIntfTrunkAllowedVlanListGet()
(Vlan-Config Mode)#
private-vlan {primary|isolated|community}
openapiDot1qPrivateVlanEnable()
openapiDot1qPrivateVlanGet()
(Vlan-Config Mode)#
private-vlan association <vlan-id-list>
openapiDot1qApiPrivateVlanAssocAdd()
openapiDot1qPrivateVlanAssociationGet()
openapiDot1qApiPrivateVlanAssocRemove()
(Interface-Config Mode)#
switchport private-vlan host-association <vlan-id> <vlan-id>
openapiDot1qIntfPVlanHostAssocSet()
openapiDot1qPVlanIntfHostAssocGet()
openapiDot1qPVlanIntfHostAssocRemove

(Interface-Config Mode)#
switchport private-vlan mapping <vlan-id> {<vlan-list> | {add | remove <vlan-list>}}