OpenNSL API Guide and Reference Manual
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 {
127 /* __doxy_func_body_end__ */
128 
161  int stat_id;
162  int reserved1;
203 /* __doxy_func_body_end__ */
204 
206  int unit,
207  opennsl_mirror_destination_t *mirror_dest,
208  void *user_data);
209 
210 /***************************************************************************/
221 
222 /***************************************************************************/
240  int unit,
242 
243 /***************************************************************************/
263  int unit,
264  opennsl_gport_t mirror_dest_id,
266 
267 /***************************************************************************/
279  int unit,
280  opennsl_gport_t mirror_dest_id) LIB_DLL_EXPORTED ;
281 
282 /***************************************************************************/
295  int unit,
297  void *user_data) LIB_DLL_EXPORTED ;
298 
299 /***************************************************************************/
314 extern int opennsl_mirror_to_pbmp_set(
315  int unit,
318 
319 /***************************************************************************/
334 extern int opennsl_mirror_to_pbmp_get(
335  int unit,
338 
339 /***************************************************************************/
356 extern int opennsl_mirror_vlan_set(
357  int unit,
359  uint16 tpid,
360  uint16 vlan) LIB_DLL_EXPORTED ;
361 
362 /***************************************************************************/
379 extern int opennsl_mirror_vlan_get(
380  int unit,
382  uint16 *tpid,
383  uint16 *vlan) LIB_DLL_EXPORTED ;
384 
385 #define OPENNSL_MIRROR_DEST_NO_COUNT -2
388 #endif /* __OPENNSL_MIRRORX_H__ */
389