CNDP  22.08.0
pktmbuf_ops.h File Reference
#include <cne_common.h>
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  mbuf_ops
 

Typedefs

typedef int(* mbuf_ctor_t) (struct pktmbuf_info_s *pi)
 
typedef void(* mbuf_dtor_t) (struct pktmbuf_info_s *pi)
 
typedef int(* mbuf_alloc_t) (struct pktmbuf_info_s *pi, struct pktmbuf_s **pkts, uint16_t npkts)
 
typedef void(* mbuf_free_t) (struct pktmbuf_info_s *pi, struct pktmbuf_s **pkts, uint16_t npkts)
 
typedef struct mbuf_ops mbuf_ops_t
 

Functions

CNDP_API void pktmbuf_set_default_ops (mbuf_ops_t *ops)
 

Detailed Description

Pktmbuf Operation data and APIs

Definition in file pktmbuf_ops.h.

Typedef Documentation

◆ mbuf_ctor_t

typedef int(* mbuf_ctor_t) (struct pktmbuf_info_s *pi)

Initialization/Constructor function prototype

Parameters
piThe pktmbuf_info_t pointer, pktmbuf_pool_init() function
Returns
0 on success or -1 on error

Definition at line 33 of file pktmbuf_ops.h.

◆ mbuf_dtor_t

typedef void(* mbuf_dtor_t) (struct pktmbuf_info_s *pi)

Destroy/Deconstructor function prototype

Parameters
piThe pktmbuf_info_t pointer, pktmbuf_pool_init() function

Definition at line 41 of file pktmbuf_ops.h.

◆ mbuf_alloc_t

typedef int(* mbuf_alloc_t) (struct pktmbuf_info_s *pi, struct pktmbuf_s **pkts, uint16_t npkts)

Allocation function prototype, used to allocate pktmbuf_t pointers.

Parameters
piThe pktmbuf_info_t pointer, pktmbuf_pool_init() function
pktsThe vector array of pktmbuf_t pointers
npktsThe number of valid pktmbuy_t pointers in the pkts array
Returns
0 on success or -1 on error

Definition at line 55 of file pktmbuf_ops.h.

◆ mbuf_free_t

typedef void(* mbuf_free_t) (struct pktmbuf_info_s *pi, struct pktmbuf_s **pkts, uint16_t npkts)

Free function prototype, used to free pktmbuf_t pointers.

Parameters
piThe pktmbuf_info_t pointer, pktmbuf_pool_init() function
pktsThe vector array of pktmbuf_t pointers
npktsThe number of valid pktmbuy_t pointers in the pkts array can be zero

Definition at line 67 of file pktmbuf_ops.h.

◆ mbuf_ops_t

typedef struct mbuf_ops mbuf_ops_t

Function pointers to operate in pktmbuf setup/alloc/free.

Function Documentation

◆ pktmbuf_set_default_ops()

CNDP_API void pktmbuf_set_default_ops ( mbuf_ops_t ops)

Set the default operation function pointers in the structure pointed to by ops

Parameters
opsA pointer to the structure to place the default mbuf operation function pointers.