OpenNSL API Guide and Reference Manual
mirror.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_MIRROR_H__
25 #define __OPENNSL_MIRROR_H__
26 
27 #include <opennsl/types.h>
28 #include <opennsl/pkt.h>
29 
30 #define OPENNSL_MIRROR_DISABLE 0
31 #define OPENNSL_MIRROR_L2 1
32 #define OPENNSL_MIRROR_L2_L3 2
33 #define OPENNSL_MIRROR_PORT_ENABLE 0x00000001
34 #define OPENNSL_MIRROR_PORT_INGRESS 0x00000002
35 #define OPENNSL_MIRROR_PORT_EGRESS 0x00000004
36 #define OPENNSL_MIRROR_PORT_EGRESS_TRUE 0x00000008
37 #define OPENNSL_MIRROR_PORT_DEST_TRUNK 0x00000010
39 #define OPENNSL_MIRROR_PORT_EGRESS_ACL 0x00000020
41 #define OPENNSL_MIRROR_PORT_SFLOW 0x00000040
42 #define OPENNSL_MIRROR_NIV_LOOP 1
44 #define OPENNSL_MIRROR_EXT_STAT_ID_COUNT 2
48 typedef struct opennsl_mirror_pkt_erspan_encap_s {
59 /* __doxy_func_body_end__ */
60 
61 #ifndef OPENNSL_HIDE_DISPATCHABLE
62 
63 /***************************************************************************/
75 extern int opennsl_mirror_init(
76  int unit) LIB_DLL_EXPORTED ;
77 
78 /***************************************************************************/
100 extern int opennsl_mirror_mode_set(
101  int unit,
102  int mode) LIB_DLL_EXPORTED ;
103 
104 #endif /* OPENNSL_HIDE_DISPATCHABLE */
105 
106 #ifndef OPENNSL_HIDE_DISPATCHABLE
107 
108 /***************************************************************************/
120 extern int opennsl_mirror_mode_get(
121  int unit,
122  int *mode) LIB_DLL_EXPORTED ;
123 
124 /***************************************************************************/
150 extern int opennsl_mirror_to_set(
151  int unit,
153 
154 /***************************************************************************/
168 extern int opennsl_mirror_to_get(
169  int unit,
171 
172 /***************************************************************************/
190 extern int opennsl_mirror_ingress_set(
191  int unit,
193  int val) LIB_DLL_EXPORTED ;
194 
195 /***************************************************************************/
213 extern int opennsl_mirror_ingress_get(
214  int unit,
216  int *val) LIB_DLL_EXPORTED ;
217 
218 /***************************************************************************/
235 extern int opennsl_mirror_egress_set(
236  int unit,
238  int val) LIB_DLL_EXPORTED ;
239 
240 /***************************************************************************/
258 extern int opennsl_mirror_egress_get(
259  int unit,
261  int *val) LIB_DLL_EXPORTED ;
262 
263 /***************************************************************************/
291 extern int opennsl_mirror_port_set(
292  int unit,
294  opennsl_module_t dest_mod,
295  opennsl_port_t dest_port,
296  uint32 flags) LIB_DLL_EXPORTED ;
297 
298 /***************************************************************************/
316 extern int opennsl_mirror_port_get(
317  int unit,
319  opennsl_module_t *dest_mod,
320  opennsl_port_t *dest_port,
321  uint32 *flags) LIB_DLL_EXPORTED ;
322 
323 /***************************************************************************/
338  int unit,
340  uint32 flags,
341  opennsl_gport_t mirror_dest_id) LIB_DLL_EXPORTED ;
342 
343 /***************************************************************************/
356  int unit,
358  uint32 flags,
359  opennsl_gport_t mirror_dest_id) LIB_DLL_EXPORTED ;
360 
361 /***************************************************************************/
374  int unit,
376  uint32 flags) LIB_DLL_EXPORTED ;
377 
378 /***************************************************************************/
399  int unit,
401  uint32 flags,
402  int mirror_dest_size,
403  opennsl_gport_t *mirror_dest,
404  int *mirror_dest_count) LIB_DLL_EXPORTED ;
405 
406 #endif /* OPENNSL_HIDE_DISPATCHABLE */
407 
408 #ifndef OPENNSL_HIDE_DISPATCHABLE
409 
410 /***************************************************************************/
436  int unit,
438  opennsl_vlan_t vlan,
439  opennsl_gport_t destport,
440  uint32 flags) LIB_DLL_EXPORTED ;
441 
442 /***************************************************************************/
461  int unit,
463  opennsl_vlan_t vlan,
464  opennsl_gport_t *dest_port,
465  uint32 *flags) LIB_DLL_EXPORTED ;
466 
467 /***************************************************************************/
483  int unit,
485  opennsl_vlan_t vlan,
486  uint32 flags,
488 
489 /***************************************************************************/
503  int unit,
505  opennsl_vlan_t vlan,
506  uint32 flags,
508 
509 /***************************************************************************/
523  int unit,
525  opennsl_vlan_t vlan,
526  uint32 flags) LIB_DLL_EXPORTED ;
527 
528 /***************************************************************************/
550  int unit,
552  opennsl_vlan_t vlan,
553  uint32 flags,
554  uint32 mirror_dest_size,
555  opennsl_gport_t *destid,
556  uint32 *destcount) LIB_DLL_EXPORTED ;
557 
558 #endif /* OPENNSL_HIDE_DISPATCHABLE */
559 
568 /* __doxy_func_body_end__ */
569 
570 /***************************************************************************/
581 
582 #ifndef OPENNSL_HIDE_DISPATCHABLE
583 
584 /***************************************************************************/
601  int unit,
603  uint32 flags,
605 
606 /***************************************************************************/
622  int unit,
624  uint32 flags,
626 
627 #endif /* OPENNSL_HIDE_DISPATCHABLE */
628 
629 #include <opennsl/mirrorX.h>
630 #endif /* __OPENNSL_MIRROR_H__ */
631