CNDP  22.08.0
pktmbuf_ops.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2019-2022 Intel Corporation.
3  * Copyright (c) 2019-2020 6WIND S.A.
4  */
5 
6 #include <cne_common.h> // for CNDP_API
7 #include <stdint.h> // for uint16_t
8 
9 #ifndef _PKTMBUF_OPS_H_
10 #define _PKTMBUF_OPS_H_
11 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 struct pktmbuf_info_s;
23 struct pktmbuf_s;
24 
33 typedef int (*mbuf_ctor_t)(struct pktmbuf_info_s *pi);
34 
41 typedef void (*mbuf_dtor_t)(struct pktmbuf_info_s *pi);
42 
55 typedef int (*mbuf_alloc_t)(struct pktmbuf_info_s *pi, struct pktmbuf_s **pkts, uint16_t npkts);
56 
67 typedef void (*mbuf_free_t)(struct pktmbuf_info_s *pi, struct pktmbuf_s **pkts, uint16_t npkts);
68 
72 typedef struct mbuf_ops {
78 
85 CNDP_API void pktmbuf_set_default_ops(mbuf_ops_t *ops);
86 
87 #ifdef __cplusplus
88 }
89 #endif
90 
91 #endif /* _PKTMBUF_OPS_H_ */
int(* mbuf_alloc_t)(struct pktmbuf_info_s *pi, struct pktmbuf_s **pkts, uint16_t npkts)
Definition: pktmbuf_ops.h:55
void(* mbuf_dtor_t)(struct pktmbuf_info_s *pi)
Definition: pktmbuf_ops.h:41
CNDP_API void pktmbuf_set_default_ops(mbuf_ops_t *ops)
int(* mbuf_ctor_t)(struct pktmbuf_info_s *pi)
Definition: pktmbuf_ops.h:33
void(* mbuf_free_t)(struct pktmbuf_info_s *pi, struct pktmbuf_s **pkts, uint16_t npkts)
Definition: pktmbuf_ops.h:67
struct mbuf_ops mbuf_ops_t
mbuf_dtor_t mbuf_dtor
Definition: pktmbuf_ops.h:74
mbuf_alloc_t mbuf_alloc
Definition: pktmbuf_ops.h:75
mbuf_free_t mbuf_free
Definition: pktmbuf_ops.h:76
mbuf_ctor_t mbuf_ctor
Definition: pktmbuf_ops.h:73