OpenNSL API Guide and Reference Manual
pkt.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_PKT_H__
25 #define __OPENNSL_PKT_H__
26 
27 #include <shared/rx.h>
28 #include <opennsl/types.h>
29 #include <opennsl/vlan.h>
30 
60 
61 typedef void (*opennsl_pkt_cb_f)(
62  int reserved1,
64  void *reserved3);
65 
67 typedef struct opennsl_pkt_blk_s {
69  int len;
71 /* __doxy_func_body_end__ */
72 
75 
77 typedef struct opennsl_pkt_oam_counter_s {
86 /* __doxy_func_body_end__ */
87 
88 #define OPENNSL_PKT_OAM_COUNTER_MAX 3
89 #define OPENNSL_PKT_NOF_DNX_HEADERS _SHR_PKT_NOF_DNX_HEADERS
90 
91 struct opennsl_pkt_s {
143  void *reserved35;
144  void *reserved36;
147  void *reserved37;
151  void *reserved40;
154  void *reserved43;
155  void *reserved44;
174  void *reserved61;
196  void *reserved82;
206 };
207 /* __doxy_func_body_end__ */
208 
209 #define OPENNSL_PKT_F_NO_VTAG 0x4
210 #define OPENNSL_TX_CRC_ALLOC 0x10
211 #define OPENNSL_TX_CRC_REGEN 0x20
212 #define OPENNSL_TX_CRC_APPEND (OPENNSL_TX_CRC_ALLOC + OPENNSL_TX_CRC_REGEN)
213 #define OPENNSL_TX_ETHER 0x100000
214 #define OPENNSL_PKT_F_TRUNK 0x20000000
215 #define OPENNSL_PKT_ONE_BUF_SETUP(pkt, buf, _len) \
216  do { \
217  (pkt)->_pkt_data.data = (buf); \
218  (pkt)->_pkt_data.len = (_len); \
219  (pkt)->pkt_data = &(pkt)->_pkt_data; \
220  (pkt)->blk_count = 1; \
221  } while (0)
222 /* __doxy_func_body_end__ */
223 /***************************************************************************/
245 extern int opennsl_pkt_clear(
246  int unit,
247  opennsl_pkt_t *pkt,
248  opennsl_pkt_blk_t *blks,
249  int blk_count,
250  uint32 flags,
251  opennsl_pkt_t **pkt_buf) LIB_DLL_EXPORTED ;
252 
253 /***************************************************************************/
265 extern int opennsl_pkt_flags_init(
266  int unit,
267  opennsl_pkt_t *pkt,
268  uint32 init_flags) LIB_DLL_EXPORTED ;
269 
270 /***************************************************************************/
289 extern int opennsl_pkt_memcpy(
290  opennsl_pkt_t *pkt,
291  int dest_byte,
292  uint8 *src,
293  int len) LIB_DLL_EXPORTED ;
294 
295 /***************************************************************************/
316 extern int opennsl_pkt_alloc(
317  int unit,
318  int size,
319  uint32 flags,
320  opennsl_pkt_t **pkt_buf) LIB_DLL_EXPORTED ;
321 
322 /***************************************************************************/
341 extern int opennsl_pkt_free(
342  int unit,
344 
345 /***************************************************************************/
359 extern void opennsl_pkt_t_init(
361 
362 /***************************************************************************/
378 extern void opennsl_pkt_blk_t_init(
380 
381 /***************************************************************************/
395 extern void opennsl_rx_reasons_t_init(
397 
398 #include <opennsl/pktX.h>
399 #endif /* __OPENNSL_PKT_H__ */
400