OpenNSL API Guide and Reference Manual
vlan.h
Go to the documentation of this file.
1 
4 /*****************************************************************************
5  *
6  * (C) Copyright Broadcom Corporation 2013-2016
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  *
11  * You may obtain a copy of the License at
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  ***************************************************************************/
24 #ifndef __OPENNSL_VLAN_H__
25 #define __OPENNSL_VLAN_H__
26 
27 #include <opennsl/types.h>
28 #include <opennsl/port.h>
29 
31 typedef struct opennsl_vlan_data_s {
36 /* __doxy_func_body_end__ */
37 
38 #ifndef OPENNSL_HIDE_DISPATCHABLE
39 
40 /***************************************************************************/
59 extern int opennsl_vlan_create(
60  int unit,
62 
63 /***************************************************************************/
77 extern int opennsl_vlan_destroy(
78  int unit,
80 
81 /***************************************************************************/
90 extern int opennsl_vlan_destroy_all(
91  int unit) LIB_DLL_EXPORTED ;
92 
93 /***************************************************************************/
111 extern int opennsl_vlan_port_add(
112  int unit,
113  opennsl_vlan_t vid,
114  opennsl_pbmp_t pbmp,
116 
117 /***************************************************************************/
131 extern int opennsl_vlan_port_remove(
132  int unit,
133  opennsl_vlan_t vid,
135 
136 /***************************************************************************/
149 extern int opennsl_vlan_port_get(
150  int unit,
151  opennsl_vlan_t vid,
152  opennsl_pbmp_t *pbmp,
154 
155 #endif /* OPENNSL_HIDE_DISPATCHABLE */
156 
157 #ifndef OPENNSL_HIDE_DISPATCHABLE
158 
159 /***************************************************************************/
198 extern int opennsl_vlan_gport_add(
199  int unit,
200  opennsl_vlan_t vlan,
202  int flags) LIB_DLL_EXPORTED ;
203 
204 /***************************************************************************/
219 extern int opennsl_vlan_gport_delete(
220  int unit,
221  opennsl_vlan_t vlan,
223 
224 /***************************************************************************/
236  int unit,
238 
239 /***************************************************************************/
255 extern int opennsl_vlan_gport_get(
256  int unit,
257  opennsl_vlan_t vlan,
259  int *flags) LIB_DLL_EXPORTED ;
260 
261 /***************************************************************************/
282 extern int opennsl_vlan_list(
283  int unit,
284  opennsl_vlan_data_t **listp,
285  int *countp) LIB_DLL_EXPORTED ;
286 
287 /***************************************************************************/
300 extern int opennsl_vlan_list_destroy(
301  int unit,
302  opennsl_vlan_data_t *list,
303  int count) LIB_DLL_EXPORTED ;
304 
305 /***************************************************************************/
315 extern int opennsl_vlan_default_get(
316  int unit,
317  opennsl_vlan_t *vid_ptr) LIB_DLL_EXPORTED ;
318 
319 /***************************************************************************/
330 extern int opennsl_vlan_default_set(
331  int unit,
333 
334 #endif /* OPENNSL_HIDE_DISPATCHABLE */
335 
336 /***************************************************************************/
364 
365 #ifndef OPENNSL_HIDE_DISPATCHABLE
366 
367 /***************************************************************************/
407  int unit,
408  int port_class,
409  opennsl_vlan_t outer_vlan,
410  opennsl_vlan_t inner_vlan,
412 
413 /***************************************************************************/
431  int unit,
432  int port_class,
433  opennsl_vlan_t outer_vlan,
434  opennsl_vlan_t inner_vlan,
436 
437 #endif /* OPENNSL_HIDE_DISPATCHABLE */
438 
452 /* __doxy_func_body_end__ */
453 
454 #ifndef OPENNSL_HIDE_DISPATCHABLE
455 
456 /***************************************************************************/
470 extern int opennsl_vlan_control_set(
471  int unit,
473  int arg) LIB_DLL_EXPORTED ;
474 
475 #endif /* OPENNSL_HIDE_DISPATCHABLE */
476 
484 /* __doxy_func_body_end__ */
485 
486 #ifndef OPENNSL_HIDE_DISPATCHABLE
487 
488 /***************************************************************************/
518  int unit,
519  int port,
521  int arg) LIB_DLL_EXPORTED ;
522 
523 #endif /* OPENNSL_HIDE_DISPATCHABLE */
524 
532 /* __doxy_func_body_end__ */
533 
540 /* __doxy_func_body_end__ */
541 
548 /* __doxy_func_body_end__ */
549 
556 /* __doxy_func_body_end__ */
557 
558 #define OPENNSL_VLAN_PROTO_PKT_TOCPU_ENABLE 0x00000001
559 #define OPENNSL_VLAN_PROTO_PKT_FORWARD_ENABLE 0x00000002
560 #define OPENNSL_VLAN_PROTO_PKT_DROP_ENABLE 0x00000004
561 #define OPENNSL_VLAN_PROTO_PKT_FLOOD_ENABLE 0x00000008
562 #define OPENNSL_VLAN_LEARN_DISABLE 0x00000001
563 #ifndef OPENNSL_HIDE_DISPATCHABLE
564 
565 #endif /* OPENNSL_HIDE_DISPATCHABLE */
566 
568 typedef enum opennsl_vlan_stat_e {
623 /* __doxy_func_body_end__ */
624 
625 #ifndef OPENNSL_HIDE_DISPATCHABLE
626 
627 /***************************************************************************/
644 extern int opennsl_vlan_stat_get(
645  int unit,
646  opennsl_vlan_t vlan,
647  opennsl_cos_t cos,
648  opennsl_vlan_stat_t stat,
649  uint64 *val) LIB_DLL_EXPORTED ;
650 
651 /***************************************************************************/
668 extern int opennsl_vlan_stat_set(
669  int unit,
670  opennsl_vlan_t vlan,
671  opennsl_cos_t cos,
672  opennsl_vlan_stat_t stat,
673  uint64 val) LIB_DLL_EXPORTED ;
674 
675 #endif /* OPENNSL_HIDE_DISPATCHABLE */
676 
677 #define OPENNSL_VLAN_PORT_REPLACE 0x00000001
679 #define OPENNSL_VLAN_PORT_WITH_ID 0x00000002
681 #define OPENNSL_VLAN_PORT_INNER_VLAN_PRESERVE 0x00000004
684 #define OPENNSL_VLAN_PORT_OUTER_VLAN_PRESERVE 0x00000100
688 typedef enum opennsl_vlan_port_match_e {
694 /* __doxy_func_body_end__ */
695 
697 typedef struct opennsl_vlan_port_s {
709 /* __doxy_func_body_end__ */
710 
711 /***************************************************************************/
720 extern void opennsl_vlan_port_t_init(
722 
723 #ifndef OPENNSL_HIDE_DISPATCHABLE
724 
725 /***************************************************************************/
743 extern int opennsl_vlan_port_create(
744  int unit,
746 
747 /***************************************************************************/
757 extern int opennsl_vlan_port_destroy(
758  int unit,
760 
761 /***************************************************************************/
775 extern int opennsl_vlan_port_find(
776  int unit,
778 
779 #endif /* OPENNSL_HIDE_DISPATCHABLE */
780 
781 #if defined(INCLUDE_L3)
782 #endif
783 #if defined(INCLUDE_L3)
784 #endif
785 #include <opennsl/vlanX.h>
786 #endif /* __OPENNSL_VLAN_H__ */
787