OpenNSL API Guide and Reference Manual
Welcome
OpenNSL Documentation
API Reference
Files
File List
Globals
include
opennsl
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 {
49
uint8
reserved1
;
50
uint16
reserved2
;
51
uint16
reserved3
;
52
uint8
reserved4
;
53
uint8
reserved5
;
54
uint8
reserved6
;
55
uint8
reserved7
;
56
uint16
reserved8
;
57
uint16
reserved9
;
58
}
opennsl_mirror_pkt_erspan_encap_t
;
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,
152
opennsl_port_t
port
)
LIB_DLL_EXPORTED
;
153
154
/***************************************************************************/
168
extern
int
opennsl_mirror_to_get
(
169
int
unit,
170
opennsl_port_t
*
port
)
LIB_DLL_EXPORTED
;
171
172
/***************************************************************************/
190
extern
int
opennsl_mirror_ingress_set
(
191
int
unit,
192
opennsl_port_t
port
,
193
int
val)
LIB_DLL_EXPORTED
;
194
195
/***************************************************************************/
213
extern
int
opennsl_mirror_ingress_get
(
214
int
unit,
215
opennsl_port_t
port
,
216
int
*val)
LIB_DLL_EXPORTED
;
217
218
/***************************************************************************/
235
extern
int
opennsl_mirror_egress_set
(
236
int
unit,
237
opennsl_port_t
port
,
238
int
val)
LIB_DLL_EXPORTED
;
239
240
/***************************************************************************/
258
extern
int
opennsl_mirror_egress_get
(
259
int
unit,
260
opennsl_port_t
port
,
261
int
*val)
LIB_DLL_EXPORTED
;
262
263
/***************************************************************************/
291
extern
int
opennsl_mirror_port_set
(
292
int
unit,
293
opennsl_port_t
port
,
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,
318
opennsl_port_t
port
,
319
opennsl_module_t
*dest_mod,
320
opennsl_port_t
*dest_port,
321
uint32
*flags)
LIB_DLL_EXPORTED
;
322
323
/***************************************************************************/
337
extern
int
opennsl_mirror_port_dest_add
(
338
int
unit,
339
opennsl_port_t
port
,
340
uint32
flags,
341
opennsl_gport_t
mirror_dest_id)
LIB_DLL_EXPORTED
;
342
343
/***************************************************************************/
355
extern
int
opennsl_mirror_port_dest_delete
(
356
int
unit,
357
opennsl_port_t
port
,
358
uint32
flags,
359
opennsl_gport_t
mirror_dest_id)
LIB_DLL_EXPORTED
;
360
361
/***************************************************************************/
373
extern
int
opennsl_mirror_port_dest_delete_all
(
374
int
unit,
375
opennsl_port_t
port
,
376
uint32
flags)
LIB_DLL_EXPORTED
;
377
378
/***************************************************************************/
398
extern
int
opennsl_mirror_port_dest_get
(
399
int
unit,
400
opennsl_port_t
port
,
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
/***************************************************************************/
435
extern
int
opennsl_mirror_port_vlan_set
(
436
int
unit,
437
opennsl_port_t
port
,
438
opennsl_vlan_t
vlan,
439
opennsl_gport_t
destport,
440
uint32
flags)
LIB_DLL_EXPORTED
;
441
442
/***************************************************************************/
460
extern
int
opennsl_mirror_port_vlan_get
(
461
int
unit,
462
opennsl_port_t
port
,
463
opennsl_vlan_t
vlan,
464
opennsl_gport_t
*dest_port,
465
uint32
*flags)
LIB_DLL_EXPORTED
;
466
467
/***************************************************************************/
482
extern
int
opennsl_mirror_port_vlan_dest_add
(
483
int
unit,
484
opennsl_port_t
port
,
485
opennsl_vlan_t
vlan,
486
uint32
flags,
487
opennsl_gport_t
destid)
LIB_DLL_EXPORTED
;
488
489
/***************************************************************************/
502
extern
int
opennsl_mirror_port_vlan_dest_delete
(
503
int
unit,
504
opennsl_port_t
port
,
505
opennsl_vlan_t
vlan,
506
uint32
flags,
507
opennsl_gport_t
destid)
LIB_DLL_EXPORTED
;
508
509
/***************************************************************************/
522
extern
int
opennsl_mirror_port_vlan_dest_delete_all
(
523
int
unit,
524
opennsl_port_t
port
,
525
opennsl_vlan_t
vlan,
526
uint32
flags)
LIB_DLL_EXPORTED
;
527
528
/***************************************************************************/
549
extern
int
opennsl_mirror_port_vlan_dest_get
(
550
int
unit,
551
opennsl_port_t
port
,
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
565
typedef
struct
opennsl_mirror_port_info_s
{
566
opennsl_gport_t
mirror_system_id
;
567
}
opennsl_mirror_port_info_t
;
568
/* __doxy_func_body_end__ */
569
570
/***************************************************************************/
579
extern
void
opennsl_mirror_port_info_t_init
(
580
opennsl_mirror_port_info_t
*info)
LIB_DLL_EXPORTED
;
581
582
#ifndef OPENNSL_HIDE_DISPATCHABLE
583
584
/***************************************************************************/
600
extern
int
opennsl_mirror_port_info_set
(
601
int
unit,
602
opennsl_port_t
port
,
603
uint32
flags,
604
opennsl_mirror_port_info_t
*info)
LIB_DLL_EXPORTED
;
605
606
/***************************************************************************/
621
extern
int
opennsl_mirror_port_info_get
(
622
int
unit,
623
opennsl_port_t
port
,
624
uint32
flags,
625
opennsl_mirror_port_info_t
*info)
LIB_DLL_EXPORTED
;
626
627
#endif
/* OPENNSL_HIDE_DISPATCHABLE */
628
629
#include <
opennsl/mirrorX.h
>
630
#endif
/* __OPENNSL_MIRROR_H__ */
631
© 2016-17 by Broadcom Limited. All rights reserved.