OpenNSL API Guide and Reference Manual
Welcome
OpenNSL Documentation
API Reference
Files
File List
Globals
include
opennsl
vxlanX.h
Go to the documentation of this file.
1
4
/*****************************************************************************
5
*
6
* This software is governed by the Broadcom Advanced Switch APIs license.
7
* This license is set out in the
8
* https://github.com/Broadcom-Switch/OpenNSL/Legal/LICENSE-Adv file.
9
*
10
* Copyright 2015-2016 Broadcom Corporation. All rights reserved.
11
*
12
***************************************************************************/
16
#ifndef __OPENNSL_VXLANX_H__
17
#define __OPENNSL_VXLANX_H__
18
19
#if defined(INCLUDE_L3)
20
21
#include <
opennsl/types.h
>
22
#include <
opennsl/l3.h
>
23
#include <
opennsl/tunnel.h
>
24
#include <
opennsl/vlan.h
>
25
26
#if defined(INCLUDE_L3)
27
#define OPENNSL_VXLAN_VPN_ELINE 0x00000001
28
#define OPENNSL_VXLAN_VPN_ELAN 0x00000002
29
#define OPENNSL_VXLAN_VPN_WITH_ID 0x00000004
30
#define OPENNSL_VXLAN_VPN_WITH_VPNID 0x00000008
31
#define OPENNSL_VXLAN_VPN_SERVICE_TAGGED 0x00000010
32
#define OPENNSL_VXLAN_VPN_SERVICE_VLAN_DELETE 0x00000080
33
#endif
34
#if defined(INCLUDE_L3)
35
#endif
36
#if defined(INCLUDE_L3)
37
#endif
38
#if defined(INCLUDE_L3)
39
40
typedef
struct
opennsl_vxlan_vpn_config_s
{
41
uint32
flags
;
42
opennsl_vpn_t
vpn
;
43
uint32
vnid
;
44
uint8
pkt_pri
;
45
uint8
pkt_cfi
;
46
uint16
egress_service_tpid
;
47
opennsl_vlan_t
egress_service_vlan
;
48
opennsl_multicast_t
broadcast_group
;
49
opennsl_multicast_t
unknown_unicast_group
;
50
opennsl_multicast_t
unknown_multicast_group
;
51
opennsl_vlan_protocol_packet_ctrl_t
protocol_pkt
;
52
opennsl_vlan_t
vlan
;
53
opennsl_gport_t
match_port_class
;
54
opennsl_vlan_t
default_vlan
;
55
}
opennsl_vxlan_vpn_config_t
;
56
/* __doxy_func_body_end__ */
57
#endif
58
59
#if defined(INCLUDE_L3)
60
/***************************************************************************/
69
extern
void
opennsl_vxlan_vpn_config_t_init
(
70
opennsl_vxlan_vpn_config_t
*info)
LIB_DLL_EXPORTED
;
71
#endif
72
73
#if defined(INCLUDE_L3)
74
/***************************************************************************/
91
extern
int
opennsl_vxlan_vpn_create
(
92
int
unit,
93
opennsl_vxlan_vpn_config_t
*info)
LIB_DLL_EXPORTED
;
94
#endif
95
96
#if defined(INCLUDE_L3)
97
/***************************************************************************/
113
extern
int
opennsl_vxlan_vpn_destroy
(
114
int
unit,
115
opennsl_vpn_t
l2vpn)
LIB_DLL_EXPORTED
;
116
#endif
117
118
#if defined(INCLUDE_L3)
119
/***************************************************************************/
134
extern
int
opennsl_vxlan_vpn_destroy_all
(
135
int
unit)
LIB_DLL_EXPORTED
;
136
#endif
137
138
#if defined(INCLUDE_L3)
139
/***************************************************************************/
150
extern
int
opennsl_vxlan_vpn_get
(
151
int
unit,
152
opennsl_vpn_t
l2vpn,
153
opennsl_vxlan_vpn_config_t
*info)
LIB_DLL_EXPORTED
;
154
#endif
155
156
#if defined(INCLUDE_L3)
157
typedef
int(*
opennsl_vxlan_vpn_traverse_cb
)(
158
int
unit,
159
opennsl_vxlan_vpn_config_t
*info,
160
void
*user_data);
161
#endif
162
163
#if defined(INCLUDE_L3)
164
/***************************************************************************/
177
extern
int
opennsl_vxlan_vpn_traverse
(
178
int
unit,
179
opennsl_vxlan_vpn_traverse_cb
cb,
180
void
*user_data)
LIB_DLL_EXPORTED
;
181
#endif
182
183
#if defined(INCLUDE_L3)
184
185
typedef
enum
opennsl_vxlan_port_match_e
{
186
OPENNSL_VXLAN_PORT_MATCH_INVALID
= 0,
187
OPENNSL_VXLAN_PORT_MATCH_NONE
= 1,
188
OPENNSL_VXLAN_PORT_MATCH_PORT
= 2,
189
OPENNSL_VXLAN_PORT_MATCH_PORT_VLAN
= 3,
190
OPENNSL_VXLAN_PORT_MATCH_VN_ID
= 7,
191
}
opennsl_vxlan_port_match_t
;
192
/* __doxy_func_body_end__ */
193
#endif
194
195
#if defined(INCLUDE_L3)
196
#define OPENNSL_VXLAN_PORT_WITH_ID (1 << 0)
198
#define OPENNSL_VXLAN_PORT_NETWORK (1 << 2)
200
#define OPENNSL_VXLAN_PORT_EGRESS_TUNNEL (1 << 7)
202
#define OPENNSL_VXLAN_PORT_SERVICE_TAGGED (1 << 8)
203
#define OPENNSL_VXLAN_PORT_MULTICAST (1 << 19)
205
#endif
206
#if defined(INCLUDE_L3)
207
208
typedef
struct
opennsl_vxlan_port_s
{
209
opennsl_gport_t
vxlan_port_id
;
210
uint32
flags
;
211
uint32
reserved1
;
212
uint16
int_pri
;
213
uint8
pkt_pri
;
214
uint8
pkt_cfi
;
215
uint16
egress_service_tpid
;
216
opennsl_vlan_t
egress_service_vlan
;
217
uint16
mtu
;
218
opennsl_gport_t
match_port
;
219
opennsl_vxlan_port_match_t
criteria
;
220
opennsl_vlan_t
match_vlan
;
221
opennsl_vlan_t
match_inner_vlan
;
222
opennsl_gport_t
egress_tunnel_id
;
223
opennsl_gport_t
match_tunnel_id
;
224
opennsl_if_t
egress_if
;
225
opennsl_switch_network_group_t
network_group_id
;
227
uint32
reserved2
;
228
int
reserved3
;
229
uint8
reserved4
;
230
uint8
reserved5
;
231
}
opennsl_vxlan_port_t
;
232
/* __doxy_func_body_end__ */
233
#endif
234
235
#if defined(INCLUDE_L3)
236
/***************************************************************************/
245
extern
void
opennsl_vxlan_port_t_init
(
246
opennsl_vxlan_port_t
*vxlan_port)
LIB_DLL_EXPORTED
;
247
#endif
248
249
#if defined(INCLUDE_L3)
250
/***************************************************************************/
259
extern
int
opennsl_vxlan_init
(
260
int
unit)
LIB_DLL_EXPORTED
;
261
#endif
262
263
#if defined(INCLUDE_L3)
264
/***************************************************************************/
273
extern
int
opennsl_vxlan_cleanup
(
274
int
unit)
LIB_DLL_EXPORTED
;
275
#endif
276
277
#if defined(INCLUDE_L3)
278
/***************************************************************************/
309
extern
int
opennsl_vxlan_port_add
(
310
int
unit,
311
opennsl_vpn_t
l2vpn,
312
opennsl_vxlan_port_t
*vxlan_port)
LIB_DLL_EXPORTED
;
313
#endif
314
315
#if defined(INCLUDE_L3)
316
/***************************************************************************/
336
extern
int
opennsl_vxlan_port_delete
(
337
int
unit,
338
opennsl_vpn_t
l2vpn,
339
opennsl_gport_t
vxlan_port_id)
LIB_DLL_EXPORTED
;
340
#endif
341
342
#if defined(INCLUDE_L3)
343
/***************************************************************************/
362
extern
int
opennsl_vxlan_port_delete_all
(
363
int
unit,
364
opennsl_vpn_t
l2vpn)
LIB_DLL_EXPORTED
;
365
#endif
366
367
#if defined(INCLUDE_L3)
368
/***************************************************************************/
379
extern
int
opennsl_vxlan_port_get
(
380
int
unit,
381
opennsl_vpn_t
l2vpn,
382
opennsl_vxlan_port_t
*vxlan_port)
LIB_DLL_EXPORTED
;
383
#endif
384
385
#if defined(INCLUDE_L3)
386
/***************************************************************************/
401
extern
int
opennsl_vxlan_port_get_all
(
402
int
unit,
403
opennsl_vpn_t
l2vpn,
404
int
port_max,
405
opennsl_vxlan_port_t
*port_array,
406
int
*port_count)
LIB_DLL_EXPORTED
;
407
#endif
408
409
#if defined(INCLUDE_L3)
410
/***************************************************************************/
425
extern
int
opennsl_vxlan_tunnel_initiator_create
(
426
int
unit,
427
opennsl_tunnel_initiator_t
*info)
LIB_DLL_EXPORTED
;
428
#endif
429
430
#if defined(INCLUDE_L3)
431
/***************************************************************************/
441
extern
int
opennsl_vxlan_tunnel_initiator_destroy
(
442
int
unit,
443
opennsl_gport_t
vxlan_tunnel_id)
LIB_DLL_EXPORTED
;
444
#endif
445
446
#if defined(INCLUDE_L3)
447
/***************************************************************************/
457
extern
int
opennsl_vxlan_tunnel_initiator_get
(
458
int
unit,
459
opennsl_tunnel_initiator_t
*info)
LIB_DLL_EXPORTED
;
460
#endif
461
462
#if defined(INCLUDE_L3)
463
/***************************************************************************/
476
extern
int
opennsl_vxlan_tunnel_initiator_traverse
(
477
int
unit,
478
opennsl_tunnel_initiator_traverse_cb
cb,
479
void
*user_data)
LIB_DLL_EXPORTED
;
480
#endif
481
482
#if defined(INCLUDE_L3)
483
/***************************************************************************/
493
extern
int
opennsl_vxlan_tunnel_terminator_create
(
494
int
unit,
495
opennsl_tunnel_terminator_t
*info)
LIB_DLL_EXPORTED
;
496
#endif
497
498
#if defined(INCLUDE_L3)
499
/***************************************************************************/
511
extern
int
opennsl_vxlan_tunnel_terminator_update
(
512
int
unit,
513
opennsl_tunnel_terminator_t
*info)
LIB_DLL_EXPORTED
;
514
#endif
515
516
#if defined(INCLUDE_L3)
517
/***************************************************************************/
527
extern
int
opennsl_vxlan_tunnel_terminator_destroy
(
528
int
unit,
529
opennsl_gport_t
vxlan_tunnel_id)
LIB_DLL_EXPORTED
;
530
#endif
531
532
#if defined(INCLUDE_L3)
533
/***************************************************************************/
543
extern
int
opennsl_vxlan_tunnel_terminator_get
(
544
int
unit,
545
opennsl_tunnel_terminator_t
*info)
LIB_DLL_EXPORTED
;
546
#endif
547
548
#if defined(INCLUDE_L3)
549
/***************************************************************************/
562
extern
int
opennsl_vxlan_tunnel_terminator_traverse
(
563
int
unit,
564
opennsl_tunnel_terminator_traverse_cb
cb,
565
void
*user_data)
LIB_DLL_EXPORTED
;
566
#endif
567
569
typedef
enum
opennsl_vxlan_stat_e
{
570
opennslVxlanInPackets
= 0,
571
opennslVxlanOutPackets
= 1,
572
opennslVxlanInBytes
= 2,
573
opennslVxlanOutBytes
= 3
574
}
opennsl_vxlan_stat_t
;
575
/* __doxy_func_body_end__ */
576
577
/***************************************************************************/
597
extern
int
opennsl_vxlan_stat_attach
(
598
int
unit,
599
opennsl_gport_t
port
,
600
opennsl_vpn_t
vpn,
601
uint32
stat_counter_id)
LIB_DLL_EXPORTED
;
602
603
/***************************************************************************/
616
extern
int
opennsl_vxlan_stat_detach
(
617
int
unit,
618
opennsl_gport_t
port
,
619
opennsl_vpn_t
vpn)
LIB_DLL_EXPORTED
;
620
621
/***************************************************************************/
638
extern
int
opennsl_vxlan_stat_counter_get
(
639
int
unit,
640
opennsl_gport_t
port
,
641
opennsl_vpn_t
vpn,
642
opennsl_vxlan_stat_t
stat,
643
uint32
num_entries,
644
uint32
*counter_indexes,
645
opennsl_stat_value_t
*counter_values)
LIB_DLL_EXPORTED
;
646
647
/***************************************************************************/
664
extern
int
opennsl_vxlan_stat_counter_sync_get
(
665
int
unit,
666
opennsl_gport_t
port
,
667
opennsl_vpn_t
vpn,
668
opennsl_vxlan_stat_t
stat,
669
uint32
num_entries,
670
uint32
*counter_indexes,
671
opennsl_stat_value_t
*counter_values)
LIB_DLL_EXPORTED
;
672
673
/***************************************************************************/
690
extern
int
opennsl_vxlan_stat_counter_set
(
691
int
unit,
692
opennsl_gport_t
port
,
693
opennsl_vpn_t
vpn,
694
opennsl_vxlan_stat_t
stat,
695
uint32
num_entries,
696
uint32
*counter_indexes,
697
opennsl_stat_value_t
*counter_values)
LIB_DLL_EXPORTED
;
698
699
/***************************************************************************/
714
extern
int
opennsl_vxlan_stat_id_get
(
715
int
unit,
716
opennsl_gport_t
port
,
717
opennsl_vpn_t
vpn,
718
opennsl_vxlan_stat_t
stat,
719
uint32
*stat_counter_id)
LIB_DLL_EXPORTED
;
720
721
/***************************************************************************/
736
extern
int
opennsl_vxlan_stat_enable_set
(
737
int
unit,
738
opennsl_gport_t
port
,
739
opennsl_vpn_t
vpn,
740
int
enable)
LIB_DLL_EXPORTED
;
741
742
#if defined(INCLUDE_L3)
743
typedef
int(*
opennsl_vxlan_port_traverse_cb
)(
744
int
unit,
745
opennsl_vxlan_port_t
*info,
746
void
*user_data);
747
#endif
748
749
#if defined(INCLUDE_L3)
750
/***************************************************************************/
763
extern
int
opennsl_vxlan_port_traverse
(
764
int
unit,
765
opennsl_vxlan_port_traverse_cb
cb,
766
void
*user_data)
LIB_DLL_EXPORTED
;
767
#endif
768
769
#if defined(INCLUDE_L3)
770
#endif
771
#endif
/* defined(INCLUDE_L3) */
772
773
#endif
/* __OPENNSL_VXLANX_H__ */
774
© 2016-17 by Broadcom Limited. All rights reserved.