OpenNSL API Guide and Reference Manual
Welcome
OpenNSL Documentation
API Reference
Files
File List
Globals
include
opennsl
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
{
32
opennsl_vlan_t
vlan_tag
;
33
opennsl_pbmp_t
port_bitmap
;
34
opennsl_pbmp_t
ut_port_bitmap
;
35
}
opennsl_vlan_data_t
;
36
/* __doxy_func_body_end__ */
37
38
#ifndef OPENNSL_HIDE_DISPATCHABLE
39
40
/***************************************************************************/
59
extern
int
opennsl_vlan_create
(
60
int
unit,
61
opennsl_vlan_t
vid)
LIB_DLL_EXPORTED
;
62
63
/***************************************************************************/
77
extern
int
opennsl_vlan_destroy
(
78
int
unit,
79
opennsl_vlan_t
vid)
LIB_DLL_EXPORTED
;
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,
115
opennsl_pbmp_t
ubmp)
LIB_DLL_EXPORTED
;
116
117
/***************************************************************************/
131
extern
int
opennsl_vlan_port_remove
(
132
int
unit,
133
opennsl_vlan_t
vid,
134
opennsl_pbmp_t
pbmp)
LIB_DLL_EXPORTED
;
135
136
/***************************************************************************/
149
extern
int
opennsl_vlan_port_get
(
150
int
unit,
151
opennsl_vlan_t
vid,
152
opennsl_pbmp_t
*pbmp,
153
opennsl_pbmp_t
*ubmp)
LIB_DLL_EXPORTED
;
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,
201
opennsl_gport_t
port
,
202
int
flags)
LIB_DLL_EXPORTED
;
203
204
/***************************************************************************/
219
extern
int
opennsl_vlan_gport_delete
(
220
int
unit,
221
opennsl_vlan_t
vlan,
222
opennsl_gport_t
port
)
LIB_DLL_EXPORTED
;
223
224
/***************************************************************************/
235
extern
int
opennsl_vlan_gport_delete_all
(
236
int
unit,
237
opennsl_vlan_t
vlan)
LIB_DLL_EXPORTED
;
238
239
/***************************************************************************/
255
extern
int
opennsl_vlan_gport_get
(
256
int
unit,
257
opennsl_vlan_t
vlan,
258
opennsl_gport_t
port
,
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,
332
opennsl_vlan_t
vid)
LIB_DLL_EXPORTED
;
333
334
#endif
/* OPENNSL_HIDE_DISPATCHABLE */
335
336
/***************************************************************************/
362
extern
void
opennsl_vlan_action_set_t_init
(
363
opennsl_vlan_action_set_t
*action)
LIB_DLL_EXPORTED
;
364
365
#ifndef OPENNSL_HIDE_DISPATCHABLE
366
367
/***************************************************************************/
406
extern
int
opennsl_vlan_translate_egress_action_add
(
407
int
unit,
408
int
port_class,
409
opennsl_vlan_t
outer_vlan,
410
opennsl_vlan_t
inner_vlan,
411
opennsl_vlan_action_set_t
*action)
LIB_DLL_EXPORTED
;
412
413
/***************************************************************************/
430
extern
int
opennsl_vlan_translate_egress_action_get
(
431
int
unit,
432
int
port_class,
433
opennsl_vlan_t
outer_vlan,
434
opennsl_vlan_t
inner_vlan,
435
opennsl_vlan_action_set_t
*action)
LIB_DLL_EXPORTED
;
436
437
#endif
/* OPENNSL_HIDE_DISPATCHABLE */
438
440
typedef
enum
opennsl_vlan_control_e
{
441
opennslVlanDropUnknown
= 0,
443
opennslVlanShared
= 3,
444
opennslVlanSharedID
= 4,
445
opennslVlanTranslate
= 5,
446
opennslVlanIgnorePktTag
= 6,
448
opennslVlanMemberMismatchToCpu
= 21
451
}
opennsl_vlan_control_t
;
452
/* __doxy_func_body_end__ */
453
454
#ifndef OPENNSL_HIDE_DISPATCHABLE
455
456
/***************************************************************************/
470
extern
int
opennsl_vlan_control_set
(
471
int
unit,
472
opennsl_vlan_control_t
type,
473
int
arg)
LIB_DLL_EXPORTED
;
474
475
#endif
/* OPENNSL_HIDE_DISPATCHABLE */
476
478
typedef
enum
opennsl_vlan_control_port_e
{
479
opennslVlanTranslateIngressEnable
= 2,
480
opennslVlanTranslateIngressMissDrop
= 4,
481
opennslVlanTranslateEgressEnable
= 5,
482
opennslVlanTranslateEgressMissDrop
= 6,
483
}
opennsl_vlan_control_port_t
;
484
/* __doxy_func_body_end__ */
485
486
#ifndef OPENNSL_HIDE_DISPATCHABLE
487
488
/***************************************************************************/
517
extern
int
opennsl_vlan_control_port_set
(
518
int
unit,
519
int
port
,
520
opennsl_vlan_control_port_t
type,
521
int
arg)
LIB_DLL_EXPORTED
;
522
523
#endif
/* OPENNSL_HIDE_DISPATCHABLE */
524
526
typedef
enum
opennsl_vlan_mcast_flood_e
{
527
OPENNSL_VLAN_MCAST_FLOOD_ALL
=
_SHR_PORT_MCAST_FLOOD_ALL
,
528
OPENNSL_VLAN_MCAST_FLOOD_UNKNOWN
=
_SHR_PORT_MCAST_FLOOD_UNKNOWN
,
529
OPENNSL_VLAN_MCAST_FLOOD_NONE
=
_SHR_PORT_MCAST_FLOOD_NONE
,
530
OPENNSL_VLAN_MCAST_FLOOD_COUNT
=
_SHR_PORT_MCAST_FLOOD_COUNT
531
}
opennsl_vlan_mcast_flood_t
;
532
/* __doxy_func_body_end__ */
533
535
typedef
enum
opennsl_vlan_forward_e
{
536
opennslVlanForwardBridging
= 0,
537
opennslVlanForwardSingleCrossConnect
= 1,
538
opennslVlanForwardDoubleCrossConnect
= 2
539
}
opennsl_vlan_forward_t
;
540
/* __doxy_func_body_end__ */
541
543
typedef
enum
opennsl_vlan_urpf_mode_e
{
544
opennslVlanUrpfDisable
= 0,
545
opennslVlanUrpfLoose
= 1,
546
opennslVlanUrpfStrict
= 2
547
}
opennsl_vlan_urpf_mode_t
;
548
/* __doxy_func_body_end__ */
549
551
typedef
enum
opennsl_vlan_vp_mc_ctrl_e
{
552
opennslVlanVPMcControlAuto
= 0,
553
opennslVlanVPMcControlEnable
= 1,
554
opennslVlanVPMcControlDisable
= 2
555
}
opennsl_vlan_vp_mc_ctrl_t
;
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
{
569
opennslVlanStatPackets
= 0,
572
opennslVlanStatIngressPackets
=
opennslVlanStatPackets
,
573
opennslVlanStatBytes
= 1,
576
opennslVlanStatIngressBytes
=
opennslVlanStatBytes
,
577
opennslVlanStatEgressPackets
= 2,
578
opennslVlanStatEgressBytes
= 3,
579
opennslVlanStatForwardedPackets
= 4,
581
opennslVlanStatForwardedBytes
= 5,
583
opennslVlanStatDropPackets
= 6,
585
opennslVlanStatDropBytes
= 7,
587
opennslVlanStatUnicastPackets
= 8,
589
opennslVlanStatUnicastBytes
= 9,
591
opennslVlanStatUnicastDropPackets
= 10,
593
opennslVlanStatUnicastDropBytes
= 11,
594
opennslVlanStatNonUnicastPackets
= 12,
596
opennslVlanStatNonUnicastBytes
= 13,
598
opennslVlanStatNonUnicastDropPackets
= 14,
600
opennslVlanStatNonUnicastDropBytes
= 15,
602
opennslVlanStatL3Packets
= 16,
604
opennslVlanStatL3Bytes
= 17,
606
opennslVlanStatL3DropPackets
= 18,
608
opennslVlanStatL3DropBytes
= 19,
610
opennslVlanStatFloodPackets
= 20,
612
opennslVlanStatFloodBytes
= 21,
613
opennslVlanStatFloodDropPackets
= 22,
614
opennslVlanStatFloodDropBytes
= 23,
615
opennslVlanStatGreenPackets
= 24,
616
opennslVlanStatGreenBytes
= 25,
617
opennslVlanStatYellowPackets
= 26,
618
opennslVlanStatYellowBytes
= 27,
619
opennslVlanStatRedPackets
= 28,
620
opennslVlanStatRedBytes
= 29,
621
opennslVlanStatCount
= 30
622
}
opennsl_vlan_stat_t
;
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 {
689
OPENNSL_VLAN_PORT_MATCH_INVALID
= 0,
690
OPENNSL_VLAN_PORT_MATCH_NONE
= 1,
691
OPENNSL_VLAN_PORT_MATCH_PORT
= 2,
692
OPENNSL_VLAN_PORT_MATCH_PORT_VLAN
= 3,
693
}
opennsl_vlan_port_match_t
;
694
/* __doxy_func_body_end__ */
695
697
typedef
struct
opennsl_vlan_port_s
{
698
opennsl_vlan_port_match_t
criteria
;
699
uint32
flags
;
700
opennsl_vlan_t
vsi
;
702
opennsl_vlan_t
match_vlan
;
703
opennsl_vlan_t
match_inner_vlan
;
704
opennsl_gport_t
port
;
706
opennsl_vlan_t
egress_vlan
;
707
opennsl_gport_t
vlan_port_id
;
708
}
opennsl_vlan_port_t
;
709
/* __doxy_func_body_end__ */
710
711
/***************************************************************************/
720
extern
void
opennsl_vlan_port_t_init
(
721
opennsl_vlan_port_t
*vlan_port)
LIB_DLL_EXPORTED
;
722
723
#ifndef OPENNSL_HIDE_DISPATCHABLE
724
725
/***************************************************************************/
743
extern
int
opennsl_vlan_port_create
(
744
int
unit,
745
opennsl_vlan_port_t
*vlan_port)
LIB_DLL_EXPORTED
;
746
747
/***************************************************************************/
757
extern
int
opennsl_vlan_port_destroy
(
758
int
unit,
759
opennsl_gport_t
gport)
LIB_DLL_EXPORTED
;
760
761
/***************************************************************************/
775
extern
int
opennsl_vlan_port_find
(
776
int
unit,
777
opennsl_vlan_port_t
*vlan_port)
LIB_DLL_EXPORTED
;
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
© 2016-17 by Broadcom Limited. All rights reserved.