Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.6.0.3
openapi_vlan.h
Go to the documentation of this file.
1 
9 /*********************************************************************
10 *
11 * Copyright 2016-2018 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_vlan.h
28 *
29 * @purpose VLAN Configuration and Status
30 *
31 * @component OPEN
32 *
33 * @create 08/29/2012
34 *
35 * @end
36 *
37 **********************************************************************/
38 #ifndef OPENAPI_VLAN_H_INCLUDED
39 #define OPENAPI_VLAN_H_INCLUDED
40 
41 #include <stdio.h>
42 #include <stddef.h>
43 #include <sys/un.h>
44 
45 #include "openapi_common.h"
46 
47 typedef enum
48 {
49  OPEN_DOT1Q_SWPORT_MODE_NONE = 0,
58 
60 #define OPEN_VLAN_LIST_MAX_ENTRIES 4096
61 
62 typedef struct
63 {
64  uint32_t numEntries;
67 
68 typedef enum
69 {
70  OPEN_PRIVATE_VLAN_UNCONFIGURED = 0,
71  OPEN_PRIVATE_VLAN_PRIMARY,
72  OPEN_PRIVATE_VLAN_SECONDARY_ISOLATED,
73  OPEN_PRIVATE_VLAN_SECONDARY_COMMUNITY
74 } OPEN_DOT1Q_PVLAN_TYPE_t;
75 
76 
77 typedef enum
78 {
79  OPEN_PRIVATE_VLAN_UNCONFIGURED_PORT,
80  OPEN_PRIVATE_VLAN_HOST_PORT,
81  OPEN_PRIVATE_VLAN_COMMUNITY_PORT,
82  OPEN_PRIVATE_VLAN_PROMISCOUS_PORT
83 } OPEN_DOT1Q_PVLAN_PORT_TYPE_t;
84 
85 /*****************************************************************/
104  uint32_t vlanNum,
105  uint32_t *nextVlanNum);
106 
107 /*****************************************************************/
121  uint32_t vlanNum);
122 
123 /*****************************************************************/
135 int openapiVlanIsStatic(openapiClientHandle_t *client_handle,
136  uint32_t vlanNum);
137 
138 /*****************************************************************/
155  uint32_t vlanNum);
156 
157 /*****************************************************************/
174  uint32_t vlanNum);
175 
176 /*****************************************************************/
193  uint32_t ifNum,
195 
196 /*****************************************************************/
213  uint32_t ifNum,
215 
216 /*****************************************************************/
233  uint32_t ifNum,
234  uint32_t *vlanNum);
235 
236 /*****************************************************************/
255  uint32_t ifNum,
256  uint32_t vlanNum,
257  OPEN_CONTROL_t *tagging);
258 
259 /*****************************************************************/
278  uint32_t vlanNum,
279  uint32_t ifNum,
280  uint32_t *participating);
281 
282 /*****************************************************************/
300  uint32_t vlanNum,
301  uint32_t *nextVlanNum,
302  uint32_t *delete_pending);
303 
304 /*****************************************************************/
328  uint32_t vlanNum,
329  uint32_t ifNum,
330  OPEN_VLAN_PARTICIPATION_MODE_t participationMode);
331 
332 /*****************************************************************/
354  uint32_t vlanNum,
355  uint32_t ifNum,
356  OPEN_VLAN_PARTICIPATION_MODE_t *participationMode);
357 
358 /*****************************************************************/
379  uint32_t ifNum,
380  uint32_t vlanNum);
381 
382 /*****************************************************************/
404  uint32_t ifNum,
405  uint32_t vlanNum,
406  OPEN_CONTROL_t tagging);
407 
408 /*****************************************************************/
423  uint32_t ifNum,
424  uint32_t *numTrafficClasses);
425 
426 /*****************************************************************/
446  uint32_t ifNum,
447  uint32_t priority);
448 
449 /*****************************************************************/
465  uint32_t ifNum,
466  uint32_t *priority);
467 
468 /*****************************************************************/
483  uint32_t *strLen);
484 
485 /*****************************************************************/
507  uint32_t vlanNum,
508  open_buffdesc *vlanName);
509 
510 /*****************************************************************/
528  uint32_t vlanNum,
529  open_buffdesc *vlanName);
530 
531 /*****************************************************************/
549  uint32_t intf, OPEN_DOT1Q_SWPORT_MODE_t mode);
550 
551 /*****************************************************************/
569  uint32_t intf, OPEN_DOT1Q_SWPORT_MODE_t *mode);
570 
571 /*****************************************************************/
589  uint32_t intf, uint32_t vlanId);
590 
591 /*****************************************************************/
609  uint32_t intf, uint32_t *vlanId);
610 
611 /*****************************************************************/
630  uint32_t intf, uint32_t vlanId);
631 
632 /*****************************************************************/
650  uint32_t intf, uint32_t *vlanId);
651 
652 /*****************************************************************/
669  uint32_t intf,
670  OPEN_VLAN_LIST_t *vidList);
671 
672 /*****************************************************************/
688  uint32_t intf,
689  OPEN_VLAN_LIST_t *vidList);
690 
691 /*****************************************************************/
707  uint32_t intf,
708  OPEN_VLAN_LIST_t *vidList);
709 
710 /*****************************************************************/
726  uint32_t intf,
727  OPEN_VLAN_LIST_t *vidList);
728 
729 /*****************************************************************/
745  uint32_t intf,
746  OPEN_VLAN_LIST_t *vidList);
747 
748 /*****************************************************************/
764  uint32_t intf,
765  OPEN_VLAN_LIST_t *vidList);
766 
767 /*****************************************************************/
789  uint32_t intf,
791 
792 /*****************************************************************/
813  uint32_t intf,
814  uint32_t *primaryVid,
815  uint32_t *secondaryVid);
816 
817 /*****************************************************************/
838  uint32_t intf,
839  uint32_t *primaryVid,
840  OPEN_VLAN_LIST_t *secondaryVidList);
841 
842 /*****************************************************************/
860  uint32_t intf,
861  OPEN_VLAN_LIST_t *operationalVidList);
862 
863 /*****************************************************************/
887  uint32_t intf,
888  uint32_t primaryVid,
889  uint32_t *nextPrimaryVid,
890  OPEN_VLAN_LIST_t *secondaryVidList);
891 
892 /*****************************************************************/
916  uint32_t intf,
917  uint32_t primaryVid,
918  uint32_t *nextPrimaryVid,
919  uint32_t *secondaryVid);
920 
921 /*****************************************************************/
944  uint32_t intf,
945  uint32_t *nativeVid);
946 
947 /*****************************************************************/
966  uint32_t intf,
967  OPEN_VLAN_LIST_t *normalVidList);
968 
969 /*****************************************************************/
986  uint32_t vlanId,
987  OPEN_DOT1Q_PVLAN_TYPE_t pvlanType);
988 
989 /*****************************************************************/
1006  uint32_t vlanId,
1007  OPEN_DOT1Q_PVLAN_TYPE_t *pvlanType);
1008 
1009 /*****************************************************************/
1026  uint32_t vlanId,
1027  OPEN_VLAN_LIST_t vidList);
1028 
1029 /*****************************************************************/
1046  uint32_t vlanId,
1047  OPEN_VLAN_LIST_t vidList);
1048 
1049 /*****************************************************************/
1066  uint32_t vlanId,
1067  OPEN_VLAN_LIST_t *vidList);
1068 
1069 /*****************************************************************/
1087  uint32_t ifNum,
1088  uint32_t primary_vlan,
1089  uint32_t sec_vlan);
1090 
1091 /*****************************************************************/
1107  uint32_t ifNum);
1108 
1109 /*****************************************************************/
1127  uint32_t ifNum,
1128  uint32_t primary_vlan,
1129  OPEN_VLAN_LIST_t vidList);
1130 
1131 /*****************************************************************/
1147  uint32_t ifNum);
1148 
1149 #endif /* OPENAPI_VLAN_H_INCLUDED */
1150 
open_error_t openapiVlanNameLenGet(openapiClientHandle_t *client_handle, uint32_t *strLen)
Gets the VLAN Name string length.
open_error_t openapiPvlanIntfPromiscTrunkAssocNextGet(openapiClientHandle_t *client_handle, uint32_t intf, uint32_t primaryVid, uint32_t *nextPrimaryVid, OPEN_VLAN_LIST_t *secondaryVidList)
Get the next primary VLAN and any associated secondary VLAN(s) for a promiscuous trunk interface in a...
OPEN_DOT1Q_SWPORT_MODE_t
Definition: openapi_vlan.h:47
open_error_t openapiVlanDelete(openapiClientHandle_t *client_handle, uint32_t vlanNum)
Deletes the VLAN with the ID specified on the switch.
uint32_t numEntries
number of valid list entries
Definition: openapi_vlan.h:64
open_error_t openapiDot1qSwPortForbiddenVlanListGet(openapiClientHandle_t *client_handle, uint32_t intf, OPEN_VLAN_LIST_t *vidList)
Get the forbidden VLAN list for the interface when the interface is in general mode.
open_error_t openapiPvlanIntfOperAssocGet(openapiClientHandle_t *client_handle, uint32_t intf, OPEN_VLAN_LIST_t *operationalVidList)
Get the list of operational VLAN(s) for a private VLAN interface.
Switchport general mode.
Definition: openapi_vlan.h:51
open_error_t openapiPvlanIntfTrunkAllowedVlanListGet(openapiClientHandle_t *client_handle, uint32_t intf, OPEN_VLAN_LIST_t *normalVidList)
Get the list of normal VLAN(s) carried by a promiscuous or isolated trunk interface in a private VLAN...
int openapiVlanIsStatic(openapiClientHandle_t *client_handle, uint32_t vlanNum)
Returns whether the VLAN is static.
open_error_t openapiDot1qSwPortTrunkNativeVlanGet(openapiClientHandle_t *client_handle, uint32_t intf, uint32_t *vlanId)
Get the Native VLAN ID for a port when in trunking mode.
open_error_t openapiVlanIfNumTrafficClassesGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *numTrafficClasses)
Gets an interface's number of traffic classes supported.
Switchport access mode.
Definition: openapi_vlan.h:52
open_error_t openapiDot1qPVlanIntfPromiscAssocRemove(openapiClientHandle_t *client_handle, uint32_t ifNum)
Clear VLAN bindings for private VLAN interface.
open_error_t openapiVlanCreatedCheck(openapiClientHandle_t *client_handle, uint32_t vlanNum)
Test if the given VLAN has been configured on the switch.
Switchport private host mode.
Definition: openapi_vlan.h:54
OPEN_DOT1Q_ACCEPT_FRAME_TYPE_t
OPEN uses these enumerators to indicate the types of frames that may be received on this port...
open_error_t
OPEN uses these enumerators to indicate the error codes.
open_error_t openapiVlanNextGet(openapiClientHandle_t *client_handle, uint32_t vlanNum, uint32_t *nextVlanNum)
Gets the next VLAN number that has been configured on the switch.
open_error_t openapiDot1qApiPrivateVlanAssocRemove(openapiClientHandle_t *client_handle, uint32_t vlanId, OPEN_VLAN_LIST_t vidList)
Remove VLAN bindings for private VLAN domain.
open_error_t openapiPvlanIntfHostAssocGet(openapiClientHandle_t *client_handle, uint32_t intf, uint32_t *primaryVid, uint32_t *secondaryVid)
Get the private VLAN association for a host mode interface.
Switchport trunk mode.
Definition: openapi_vlan.h:53
open_error_t openapiDot1qSwPortAccessVlanGet(openapiClientHandle_t *client_handle, uint32_t intf, uint32_t *vlanId)
Get the Access VLAN ID for a port.
open_error_t openapiDot1qSwPortModeSet(openapiClientHandle_t *client_handle, uint32_t intf, OPEN_DOT1Q_SWPORT_MODE_t mode)
Set the Switchport Configuration Mode for a port.
open_error_t openapiDot1qPrivateVlanAssociationGet(openapiClientHandle_t *client_handle, uint32_t vlanId, OPEN_VLAN_LIST_t *vidList)
Get VLAN bindings for private VLAN domain.
Switchport private promisc mode.
Definition: openapi_vlan.h:55
open_error_t openapiVlanNameSet(openapiClientHandle_t *client_handle, uint32_t vlanNum, open_buffdesc *vlanName)
Configures a VLAN Name.
open_error_t openapiVlanIfParticipationGet(openapiClientHandle_t *client_handle, uint32_t vlanNum, uint32_t ifNum, OPEN_VLAN_PARTICIPATION_MODE_t *participationMode)
Gets an interface's configured participation mode for the specified VLAN.
open_error_t openapiVlanCreate(openapiClientHandle_t *client_handle, uint32_t vlanNum)
Creates the VLAN with the ID specified on the switch.
open_error_t openapiDot1qSwPortAccessVlanSet(openapiClientHandle_t *client_handle, uint32_t intf, uint32_t vlanId)
Set the Access VLAN ID for a port.
open_error_t openapiVlanIfTaggingGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t vlanNum, OPEN_CONTROL_t *tagging)
Gets an interface's tagging setting for the specified VLAN.
open_error_t openapiVlanIfParticipationStatusGet(openapiClientHandle_t *client_handle, uint32_t vlanNum, uint32_t ifNum, uint32_t *participating)
Gets an interface's participation status for the specified VLAN.
open_error_t openapiVlanIfTaggingSet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t vlanNum, OPEN_CONTROL_t tagging)
Sets an interface's tagging mode for the given VLAN.
open_error_t openapiDot1qSwPortUntaggedVlanListGet(openapiClientHandle_t *client_handle, uint32_t intf, OPEN_VLAN_LIST_t *vidList)
Get the untagged VLAN list for the interface when the interface is in general mode.
open_error_t openapiDot1qSwPortTrunkNativeVlanSet(openapiClientHandle_t *client_handle, uint32_t intf, uint32_t vlanId)
Set the native VLAN ID for a port when in trunking mode.
open_error_t openapiDot1qSwPortDynamicallyAddedVlanListGet(openapiClientHandle_t *client_handle, uint32_t intf, OPEN_VLAN_LIST_t *vidList)
Get the dynamically added VLAN list for the interface when the interface is in general mode...
open_error_t openapiDot1qSwPortModeGet(openapiClientHandle_t *client_handle, uint32_t intf, OPEN_DOT1Q_SWPORT_MODE_t *mode)
Get the Switchport Configuration Mode for a port.
open_error_t openapiVlanIfPvidGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *vlanNum)
Gets an interface's PVID.
open_error_t openapiDot1qIntfPVlanHostAssocSet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t primary_vlan, uint32_t sec_vlan)
Set VLAN bindings for private VLAN interface.
OPEN_CONTROL_t
OPEN uses these enumerators to indicate enable or disable for a given config or status parameter...
open_error_t openapiVlanIfAcceptFrameTypeSet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_DOT1Q_ACCEPT_FRAME_TYPE_t type)
Set the Acceptable Frame Type configuration for a port.
Switchport private promisc trunk mode.
Definition: openapi_vlan.h:56
open_error_t openapiPvlanIntfTrunkNativeVlanGet(openapiClientHandle_t *client_handle, uint32_t intf, uint32_t *nativeVid)
Get the native VLAN for a promiscuous or isolated trunk interface in a private VLAN.
open_error_t openapiDot1qSwPortTrunkAllowedVlanListSet(openapiClientHandle_t *client_handle, uint32_t intf, OPEN_VLAN_LIST_t *vidList)
Set the list of VLANs allowed on an interface when the interface is in trunking mode.
open_error_t openapiPvlanIntfPromiscAssocGet(openapiClientHandle_t *client_handle, uint32_t intf, uint32_t *primaryVid, OPEN_VLAN_LIST_t *secondaryVidList)
Get the private VLAN association for a promiscuous mode interface.
OPEN_VLAN_PARTICIPATION_MODE_t
OPEN uses these enumerators to indicate the VLAN participation of a given interface.
open_error_t openapiDot1qPrivateVlanGet(openapiClientHandle_t *client_handle, uint32_t vlanId, OPEN_DOT1Q_PVLAN_TYPE_t *pvlanType)
Get the configured private VLAN type.
open_error_t openapiVlanNameGet(openapiClientHandle_t *client_handle, uint32_t vlanNum, open_buffdesc *vlanName)
Gets the VLAN Name.
open_error_t openapiVlanIfPvidSet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t vlanNum)
Sets an interface's VLAN ID (PVID).
open_error_t openapiDot1qPrivateVlanEnable(openapiClientHandle_t *client_handle, uint32_t vlanId, OPEN_DOT1Q_PVLAN_TYPE_t pvlanType)
Setup a VLAN as private VLAN.
open_error_t openapiDot1qPVlanIntfHostAssocRemove(openapiClientHandle_t *client_handle, uint32_t ifNum)
Clear VLAN bindings for private VLAN interface.
open_error_t openapiPvlanIntfModeGet(openapiClientHandle_t *client_handle, uint32_t intf, OPEN_DOT1Q_SWPORT_MODE_t *mode)
Get the private VLAN mode for an interface.
open_error_t openapiVlanIfDefaultUserPrioritySet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t priority)
Sets an interface's default user priority.
open_error_t openapiVlanIfAcceptFrameTypeGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_DOT1Q_ACCEPT_FRAME_TYPE_t *type)
Get the Acceptable Frame Type configuration for a port.
open_error_t openapiDot1qSwPortTrunkAllowedVlanListGet(openapiClientHandle_t *client_handle, uint32_t intf, OPEN_VLAN_LIST_t *vidList)
Get the list of VLANs allowed on an interface when the interface is in trunking mode.
open_error_t openapiVlanIfDefaultUserPriorityGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *priority)
Gets an interface's default user priority.
open_error_t openapiDot1qIntfPVlanPromiscAssocSet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t primary_vlan, OPEN_VLAN_LIST_t vidList)
Set VLAN bindings for private VLAN interface.
open_error_t openapiDot1qSwPortTaggedVlanListGet(openapiClientHandle_t *client_handle, uint32_t intf, OPEN_VLAN_LIST_t *vidList)
Get the tagged VLAN list for the interface when the interface is in general mode. ...
#define OPEN_VLAN_LIST_MAX_ENTRIES
VLAN list.
Definition: openapi_vlan.h:60
open_error_t openapiVlanIfParticipationSet(openapiClientHandle_t *client_handle, uint32_t vlanNum, uint32_t ifNum, OPEN_VLAN_PARTICIPATION_MODE_t participationMode)
Sets an interface's participation mode configuration for the specified VLAN.
open_error_t openapiPvlanIntfIsolatedTrunkAssocNextGet(openapiClientHandle_t *client_handle, uint32_t intf, uint32_t primaryVid, uint32_t *nextPrimaryVid, uint32_t *secondaryVid)
Get the next primary VLAN and any associated secondary VLAN for an isolated trunk interface in a priv...
This is used by applications like gvrp who do not care about the mode.
Definition: openapi_vlan.h:50
open_error_t openapiVlanNextChangedGet(openapiClientHandle_t *client_handle, uint32_t vlanNum, uint32_t *nextVlanNum, uint32_t *delete_pending)
Gets the next VLAN which has a pending change or a pending deletion.
open_error_t openapiDot1qApiPrivateVlanAssocAdd(openapiClientHandle_t *client_handle, uint32_t vlanId, OPEN_VLAN_LIST_t vidList)
Setup a VLAN bindings for private VLAN domain.