OpenNSL API Guide and Reference Manual
Welcome
OpenNSL Documentation
API Reference
Files
File List
Globals
include
opennsl
mirrorX.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_MIRRORX_H__
17
#define __OPENNSL_MIRRORX_H__
18
19
#include <
opennsl/types.h
>
20
#include <
opennsl/pkt.h
>
21
22
#define OPENNSL_MIRROR_DEST_REPLACE (1 << 0)
24
#define OPENNSL_MIRROR_DEST_WITH_ID (1 << 1)
26
#define OPENNSL_MIRROR_DEST_TUNNEL_L2 (1 << 2)
28
#define OPENNSL_MIRROR_DEST_TUNNEL_IP_GRE (1 << 3)
30
#define OPENNSL_MIRROR_DEST_PAYLOAD_UNTAGGED (1 << 4)
32
#define OPENNSL_MIRROR_DEST_TUNNEL_TRILL (1 << 5)
34
#define OPENNSL_MIRROR_DEST_TUNNEL_NIV (1 << 6)
36
#define OPENNSL_MIRROR_DEST_UPDATE_POLICER (1 << 7)
38
#define OPENNSL_MIRROR_DEST_UPDATE_COUNTER (1 << 8)
40
#define OPENNSL_MIRROR_DEST_DEST_MULTICAST (1 << 9)
42
#define OPENNSL_MIRROR_DEST_TUNNEL_WITH_ENCAP_ID (1 << 10)
44
#define OPENNSL_MIRROR_DEST_TUNNEL_RSPAN (1 << 12)
47
#define OPENNSL_MIRROR_DEST_INT_PRI_SET (1 << 13)
50
#define OPENNSL_MIRROR_DEST_TUNNEL_ETAG (1 << 14)
52
#define OPENNSL_MIRROR_DEST_TUNNEL_SFLOW (1 << 15)
55
#define OPENNSL_MIRROR_DEST_IS_SNOOP (1 << 16)
58
#define OPENNSL_MIRROR_DEST_IS_TRAP (1 << 17)
61
#define OPENNSL_MIRROR_DEST_IS_STAT_SAMPLE (1 << 17)
65
#define OPENNSL_MIRROR_DEST_EGRESS_ADD_ORIG_SYSTEM_HEADER (1 << 18)
71
#define OPENNSL_MIRROR_DEST_FIELD (1 << 19)
74
#define OPENNSL_MIRROR_DEST_PORT (1 << 20)
77
#define OPENNSL_MIRROR_DEST_DROP_SNIFF_IF_FWD_DROPPED (1 << 21)
80
#define OPENNSL_MIRROR_DEST_UPDATE_COUNTER_1 (1 << 21)
81
#define OPENNSL_MIRROR_DEST_UPDATE_COUNTER_2 (1 << 22)
82
#define OPENNSL_MIRROR_DEST_DROP_FWD_IF_SNIFF_DROPPED (1 << 22)
85
#define OPENNSL_MIRROR_DEST_ID_SHARE (1 << 24)
88
#define OPENNSL_MIRROR_DEST_MTP_ADD (1 << 25)
91
#define OPENNSL_MIRROR_DEST_MTP_DELETE (1 << 26)
94
#define OPENNSL_MIRROR_DEST_MTP_REPLACE (1 << 27)
97
#define OPENNSL_MIRROR_DEST_EGRESS_TRAP_WITH_SYSTEM_HEADER (1 << 28)
108
#define OPENNSL_MIRROR_DEST_TUNNEL_PSAMP (1 << 29)
111
#define OPENNSL_MIRROR_DEST_OUT_MIRROR_DISABLE (1 << 30)
113
#define OPENNSL_MIRROR_DEST_TUNNEL_WITH_SEQ (1 << 31)
115
#define OPENNSL_MIRROR_DEST_UPDATE_EXT_COUNTERS (1 << 31)
118
#define OPENNSL_MIRROR_DEST_FLAGS2_TUNNEL_VXLAN (1 << 0)
121
typedef struct opennsl_mirror_options_s {
122
uint32
flags
;
123
uint8
forward_strength
;
124
uint8
copy_strength
;
125
uint32
recycle_cmd
;
126
}
opennsl_mirror_options_t
;
127
/* __doxy_func_body_end__ */
128
134
typedef
struct
opennsl_mirror_destination_s
{
135
opennsl_gport_t
mirror_dest_id
;
137
uint32
flags
;
139
opennsl_gport_t
gport
;
140
uint8
version
;
141
uint8
tos
;
142
uint8
ttl
;
143
opennsl_ip_t
src_addr
;
144
opennsl_ip_t
dst_addr
;
145
opennsl_ip6_t
src6_addr
;
146
opennsl_ip6_t
dst6_addr
;
147
uint32
flow_label
;
148
opennsl_mac_t
src_mac
;
149
opennsl_mac_t
dst_mac
;
150
uint16
tpid
;
151
opennsl_vlan_t
vlan_id
;
152
opennsl_trill_name_t
trill_src_name
;
153
opennsl_trill_name_t
trill_dst_name
;
154
int
trill_hopcount
;
155
uint16
niv_src_vif
;
156
uint16
niv_dst_vif
;
158
uint32
niv_flags
;
159
uint16
gre_protocol
;
160
opennsl_policer_t
policer_id
;
161
int
stat_id
;
162
int
reserved1
;
163
opennsl_if_t
encap_id
;
164
opennsl_if_t
tunnel_id
;
168
uint16
reserved2
;
169
uint8
pkt_prio
;
170
uint32
reserved3
;
171
uint32
reserved4
;
172
uint8
int_pri
;
173
uint16
etag_src_vid
;
174
uint16
etag_dst_vid
;
175
uint16
udp_src_port
;
176
uint16
udp_dst_port
;
177
uint32
reserved5
;
178
uint32
reserved6
;
179
uint8
recycle_context
;
181
uint16
packet_copy_size
;
185
uint16
egress_packet_copy_size
;
190
opennsl_reserved_enum_t
reserved7
;
191
uint8
df
;
193
uint8
reserved8
;
194
uint16
reserved9
;
195
uint32
reserved10
;
196
uint32
reserved11
;
197
int
reserved12
[
OPENNSL_MIRROR_EXT_STAT_ID_COUNT
];
198
uint32
reserved13
;
199
uint32
reserved14
;
200
uint32
reserved15
;
201
opennsl_mirror_pkt_erspan_encap_t
reserved16
;
202
}
opennsl_mirror_destination_t
;
203
/* __doxy_func_body_end__ */
204
205
typedef
int (*
opennsl_mirror_destination_traverse_cb
)(
206
int
unit,
207
opennsl_mirror_destination_t
*mirror_dest,
208
void
*user_data);
209
210
/***************************************************************************/
219
extern
void
opennsl_mirror_destination_t_init
(
220
opennsl_mirror_destination_t
*mirror_dest)
LIB_DLL_EXPORTED
;
221
222
/***************************************************************************/
239
extern
int
opennsl_mirror_destination_create
(
240
int
unit,
241
opennsl_mirror_destination_t
*mirror_dest)
LIB_DLL_EXPORTED
;
242
243
/***************************************************************************/
262
extern
int
opennsl_mirror_destination_get
(
263
int
unit,
264
opennsl_gport_t
mirror_dest_id,
265
opennsl_mirror_destination_t
*mirror_dest)
LIB_DLL_EXPORTED
;
266
267
/***************************************************************************/
278
extern
int
opennsl_mirror_destination_destroy
(
279
int
unit,
280
opennsl_gport_t
mirror_dest_id)
LIB_DLL_EXPORTED
;
281
282
/***************************************************************************/
294
extern
int
opennsl_mirror_destination_traverse
(
295
int
unit,
296
opennsl_mirror_destination_traverse_cb
cb,
297
void
*user_data)
LIB_DLL_EXPORTED
;
298
299
/***************************************************************************/
314
extern
int
opennsl_mirror_to_pbmp_set
(
315
int
unit,
316
opennsl_port_t
port
,
317
opennsl_pbmp_t
pbmp)
LIB_DLL_EXPORTED
;
318
319
/***************************************************************************/
334
extern
int
opennsl_mirror_to_pbmp_get
(
335
int
unit,
336
opennsl_port_t
port
,
337
opennsl_pbmp_t
*pbmp)
LIB_DLL_EXPORTED
;
338
339
/***************************************************************************/
356
extern
int
opennsl_mirror_vlan_set
(
357
int
unit,
358
opennsl_port_t
port
,
359
uint16
tpid,
360
uint16
vlan)
LIB_DLL_EXPORTED
;
361
362
/***************************************************************************/
379
extern
int
opennsl_mirror_vlan_get
(
380
int
unit,
381
opennsl_port_t
port
,
382
uint16
*tpid,
383
uint16
*vlan)
LIB_DLL_EXPORTED
;
384
385
#define OPENNSL_MIRROR_DEST_NO_COUNT -2
388
#endif
/* __OPENNSL_MIRRORX_H__ */
389
© 2016-17 by Broadcom Limited. All rights reserved.