OpenNSL API Guide and Reference Manual
Welcome
OpenNSL Documentation
API Reference
Files
File List
Globals
include
opennsl
knet.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_KNET_H__
25
#define __OPENNSL_KNET_H__
26
27
#include <
opennsl/types.h
>
28
#include <
opennsl/rx.h
>
29
30
#define OPENNSL_KNET_NETIF_T_TX_CPU_INGRESS 1
33
#define OPENNSL_KNET_NETIF_T_TX_LOCAL_PORT 2
37
#define OPENNSL_KNET_NETIF_F_ADD_TAG 0x00000001
40
#define OPENNSL_KNET_NETIF_NAME_MAX 16
41
42
typedef
struct
opennsl_knet_netif_s
{
43
int
id
;
44
int
type
;
46
uint32
flags
;
47
opennsl_mac_t
mac_addr
;
49
opennsl_vlan_t
vlan
;
51
opennsl_port_t
port
;
53
opennsl_cos_queue_t
cosq
;
55
char
name
[
OPENNSL_KNET_NETIF_NAME_MAX
];
57
uint32
cb_user_data
;
58
}
opennsl_knet_netif_t
;
59
/* __doxy_func_body_end__ */
60
61
#define OPENNSL_KNET_FILTER_T_RX_PKT 1
62
#define OPENNSL_KNET_DEST_T_NETIF 1
64
#define OPENNSL_KNET_DEST_T_OPENNSL_RX_API 2
66
#define OPENNSL_KNET_FILTER_F_STRIP_TAG 0x00000001
69
#define OPENNSL_KNET_FILTER_DESC_MAX 32
70
#define OPENNSL_KNET_FILTER_SIZE_MAX 256
71
#define OPENNSL_KNET_FILTER_M_RAW 0x00000001
72
#define OPENNSL_KNET_FILTER_M_VLAN 0x00000002
73
#define OPENNSL_KNET_FILTER_M_INGPORT 0x00000004
74
#define OPENNSL_KNET_FILTER_M_REASON 0x00000020
76
#define OPENNSL_KNET_FILTER_M_FP_RULE 0x00000040
79
typedef struct opennsl_knet_filter_s {
80
int
id
;
81
int
type;
83
uint32
flags
;
84
int
priority
;
85
int
dest_type
;
86
int
dest_id
;
87
int
dest_proto;
90
int
mirror_type
;
91
int
mirror_id
;
92
int
mirror_proto;
95
uint32
match_flags
;
96
char
desc[
OPENNSL_KNET_FILTER_DESC_MAX
];
97
opennsl_vlan_t
m_vlan
;
98
opennsl_port_t
m_ingport
;
99
int
m_src_modport
;
100
int
m_src_modid
;
101
opennsl_rx_reasons_t
m_reason
;
102
int
m_fp_rule
;
103
int
raw_size
;
104
uint8
m_raw_data[
OPENNSL_KNET_FILTER_SIZE_MAX
];
105
uint8
m_raw_mask[
OPENNSL_KNET_FILTER_SIZE_MAX
];
106
uint32
cb_user_data
;
107
}
opennsl_knet_filter_t
;
108
/* __doxy_func_body_end__ */
109
110
/***************************************************************************/
119
extern
void
opennsl_knet_netif_t_init
(
120
opennsl_knet_netif_t
*netif)
LIB_DLL_EXPORTED
;
121
122
/***************************************************************************/
131
extern
void
opennsl_knet_filter_t_init
(
132
opennsl_knet_filter_t
*filter)
LIB_DLL_EXPORTED
;
133
134
#ifndef OPENNSL_HIDE_DISPATCHABLE
135
136
/***************************************************************************/
152
extern
int
opennsl_knet_init
(
153
int
unit)
LIB_DLL_EXPORTED
;
154
155
/***************************************************************************/
174
extern
int
opennsl_knet_netif_create
(
175
int
unit,
176
opennsl_knet_netif_t
*netif)
LIB_DLL_EXPORTED
;
177
178
/***************************************************************************/
196
extern
int
opennsl_knet_netif_destroy
(
197
int
unit,
198
int
netif_id)
LIB_DLL_EXPORTED
;
199
200
#endif
/* OPENNSL_HIDE_DISPATCHABLE */
201
202
typedef
int (*
opennsl_knet_netif_traverse_cb
)(
203
int
unit,
204
opennsl_knet_netif_t
*netif,
205
void
*user_data);
206
207
#ifndef OPENNSL_HIDE_DISPATCHABLE
208
209
/***************************************************************************/
230
extern
int
opennsl_knet_netif_traverse
(
231
int
unit,
232
opennsl_knet_netif_traverse_cb
trav_fn,
233
void
*user_data)
LIB_DLL_EXPORTED
;
234
235
/***************************************************************************/
252
extern
int
opennsl_knet_filter_create
(
253
int
unit,
254
opennsl_knet_filter_t
*filter)
LIB_DLL_EXPORTED
;
255
256
/***************************************************************************/
271
extern
int
opennsl_knet_filter_destroy
(
272
int
unit,
273
int
filter_id)
LIB_DLL_EXPORTED
;
274
275
#endif
/* OPENNSL_HIDE_DISPATCHABLE */
276
277
typedef
int (*
opennsl_knet_filter_traverse_cb
)(
278
int
unit,
279
opennsl_knet_filter_t
*filter,
280
void
*user_data);
281
282
#ifndef OPENNSL_HIDE_DISPATCHABLE
283
284
/***************************************************************************/
306
extern
int
opennsl_knet_filter_traverse
(
307
int
unit,
308
opennsl_knet_filter_traverse_cb
trav_fn,
309
void
*user_data)
LIB_DLL_EXPORTED
;
310
311
#endif
/* OPENNSL_HIDE_DISPATCHABLE */
312
313
#include <
opennsl/knetX.h
>
314
#endif
/* __OPENNSL_KNET_H__ */
315
© 2016-17 by Broadcom Limited. All rights reserved.