OpenNSL API Guide and Reference Manual
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;
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;
84  int priority;
85  int dest_type;
86  int dest_id;
87  int dest_proto;
91  int mirror_id;
92  int mirror_proto;
102  int m_fp_rule;
103  int raw_size;
108 /* __doxy_func_body_end__ */
109 
110 /***************************************************************************/
119 extern void opennsl_knet_netif_t_init(
121 
122 /***************************************************************************/
131 extern void opennsl_knet_filter_t_init(
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,
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 
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,
233  void *user_data) LIB_DLL_EXPORTED ;
234 
235 /***************************************************************************/
252 extern int opennsl_knet_filter_create(
253  int unit,
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 
278  int unit,
279  opennsl_knet_filter_t *filter,
280  void *user_data);
281 
282 #ifndef OPENNSL_HIDE_DISPATCHABLE
283 
284 /***************************************************************************/
307  int unit,
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