API Reference Manual  1.45.0
api/spec/packet.h File Reference

ODP packet descriptor. More...

#include <odp/visibility_begin.h>
#include <odp/api/event_types.h>
#include <odp/api/packet_types.h>
#include <odp/api/packet_io_types.h>
#include <odp/api/pool_types.h>
#include <odp/api/proto_stats_types.h>
#include <odp/api/std_types.h>
#include <odp/api/time_types.h>
#include <odp/visibility_end.h>
Include dependency graph for api/spec/packet.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

odp_event_subtype_t odp_packet_subtype (odp_packet_t packet)
 Event subtype of a packet. More...
 
odp_packet_t odp_packet_alloc (odp_pool_t pool, uint32_t len)
 Allocate a packet from a packet pool. More...
 
int odp_packet_alloc_multi (odp_pool_t pool, uint32_t len, odp_packet_t pkt[], int num)
 Allocate multiple packets from a packet pool. More...
 
void odp_packet_free (odp_packet_t pkt)
 Free packet. More...
 
void odp_packet_free_multi (const odp_packet_t pkt[], int num)
 Free multiple packets. More...
 
void odp_packet_free_sp (const odp_packet_t pkt[], int num)
 Free multiple packets to the same pool. More...
 
int odp_packet_reset (odp_packet_t pkt, uint32_t len)
 Reset packet. More...
 
uint32_t odp_packet_reset_max_len (odp_packet_t pkt)
 Maximum packet data reset length. More...
 
void odp_packet_reset_meta (odp_packet_t pkt)
 Reset packet metadata. More...
 
odp_packet_t odp_packet_from_event (odp_event_t ev)
 Get packet handle from event. More...
 
void odp_packet_from_event_multi (odp_packet_t pkt[], const odp_event_t ev[], int num)
 Convert multiple packet events to packet handles. More...
 
odp_event_t odp_packet_to_event (odp_packet_t pkt)
 Convert packet handle to event. More...
 
void odp_packet_to_event_multi (const odp_packet_t pkt[], odp_event_t ev[], int num)
 Convert multiple packet handles to events. More...
 
int odp_packet_reass_info (odp_packet_t pkt, odp_packet_reass_info_t *info)
 Get information about successful reassembly offload that has happened. More...
 
int odp_packet_reass_partial_state (odp_packet_t pkt, odp_packet_t frags[], odp_packet_reass_partial_state_t *res)
 Get partial reassembly state from a packet. More...
 
void * odp_packet_head (odp_packet_t pkt)
 Packet head address. More...
 
uint32_t odp_packet_buf_len (odp_packet_t pkt)
 Total packet buffer length. More...
 
void * odp_packet_data (odp_packet_t pkt)
 Packet data pointer. More...
 
uint32_t odp_packet_seg_len (odp_packet_t pkt)
 Packet data length following the data pointer. More...
 
void * odp_packet_data_seg_len (odp_packet_t pkt, uint32_t *seg_len)
 Packet data pointer with segment length. More...
 
uint32_t odp_packet_len (odp_packet_t pkt)
 Packet data length. More...
 
uint32_t odp_packet_headroom (odp_packet_t pkt)
 Packet headroom length. More...
 
uint32_t odp_packet_tailroom (odp_packet_t pkt)
 Packet tailroom length. More...
 
void * odp_packet_tail (odp_packet_t pkt)
 Packet tailroom pointer. More...
 
void * odp_packet_offset (odp_packet_t pkt, uint32_t offset, uint32_t *len, odp_packet_seg_t *seg)
 Packet offset pointer. More...
 
void odp_packet_prefetch (odp_packet_t pkt, uint32_t offset, uint32_t len)
 Packet data prefetch. More...
 
void * odp_packet_push_head (odp_packet_t pkt, uint32_t len)
 Push out packet head. More...
 
void * odp_packet_pull_head (odp_packet_t pkt, uint32_t len)
 Pull in packet head. More...
 
void * odp_packet_push_tail (odp_packet_t pkt, uint32_t len)
 Push out packet tail. More...
 
void * odp_packet_pull_tail (odp_packet_t pkt, uint32_t len)
 Pull in packet tail. More...
 
int odp_packet_extend_head (odp_packet_t *pkt, uint32_t len, void **data_ptr, uint32_t *seg_len)
 Extend packet head. More...
 
int odp_packet_trunc_head (odp_packet_t *pkt, uint32_t len, void **data_ptr, uint32_t *seg_len)
 Truncate packet head. More...
 
int odp_packet_extend_tail (odp_packet_t *pkt, uint32_t len, void **data_ptr, uint32_t *seg_len)
 Extend packet tail. More...
 
int odp_packet_trunc_tail (odp_packet_t *pkt, uint32_t len, void **tail_ptr, uint32_t *tailroom)
 Truncate packet tail. More...
 
int odp_packet_add_data (odp_packet_t *pkt, uint32_t offset, uint32_t len)
 Add data into an offset. More...
 
int odp_packet_rem_data (odp_packet_t *pkt, uint32_t offset, uint32_t len)
 Remove data from an offset. More...
 
int odp_packet_align (odp_packet_t *pkt, uint32_t offset, uint32_t len, uint32_t align)
 Align packet data. More...
 
int odp_packet_is_segmented (odp_packet_t pkt)
 Tests if packet is segmented. More...
 
int odp_packet_num_segs (odp_packet_t pkt)
 Number of segments. More...
 
odp_packet_seg_t odp_packet_first_seg (odp_packet_t pkt)
 First segment in packet. More...
 
odp_packet_seg_t odp_packet_last_seg (odp_packet_t pkt)
 Last segment in packet. More...
 
odp_packet_seg_t odp_packet_next_seg (odp_packet_t pkt, odp_packet_seg_t seg)
 Next segment in packet. More...
 
void * odp_packet_seg_data (odp_packet_t pkt, odp_packet_seg_t seg)
 Segment data pointer. More...
 
uint32_t odp_packet_seg_data_len (odp_packet_t pkt, odp_packet_seg_t seg)
 Segment data length. More...
 
int odp_packet_concat (odp_packet_t *dst, odp_packet_t src)
 Concatenate two packets. More...
 
int odp_packet_split (odp_packet_t *pkt, uint32_t len, odp_packet_t *tail)
 Split packet into two packets. More...
 
void * odp_packet_buf_head (odp_packet_buf_t pkt_buf)
 Packet buffer head pointer. More...
 
uint32_t odp_packet_buf_size (odp_packet_buf_t pkt_buf)
 Packet buffer size in bytes. More...
 
uint32_t odp_packet_buf_data_offset (odp_packet_buf_t pkt_buf)
 Packet buffer data offset. More...
 
uint32_t odp_packet_buf_data_len (odp_packet_buf_t pkt_buf)
 Packet buffer data length in bytes. More...
 
void odp_packet_buf_data_set (odp_packet_buf_t pkt_buf, uint32_t data_offset, uint32_t data_len)
 Packet buffer data set. More...
 
odp_packet_buf_t odp_packet_buf_from_head (odp_pool_t pool, void *head)
 Convert packet buffer head pointer to handle. More...
 
uint32_t odp_packet_disassemble (odp_packet_t pkt, odp_packet_buf_t pkt_buf[], uint32_t num)
 Disassemble packet into packet buffers. More...
 
odp_packet_t odp_packet_reassemble (odp_pool_t pool, odp_packet_buf_t pkt_buf[], uint32_t num)
 Reassemble packet from packet buffers. More...
 
odp_packet_t odp_packet_ref_static (odp_packet_t pkt)
 Create a static reference to a packet. More...
 
odp_packet_t odp_packet_ref (odp_packet_t pkt, uint32_t offset)
 Create a reference to a packet. More...
 
odp_packet_t odp_packet_ref_pkt (odp_packet_t pkt, uint32_t offset, odp_packet_t hdr)
 Create a reference to a packet with a header packet. More...
 
int odp_packet_has_ref (odp_packet_t pkt)
 Test if packet has multiple references. More...
 
odp_packet_t odp_packet_copy (odp_packet_t pkt, odp_pool_t pool)
 Full copy of a packet. More...
 
odp_packet_t odp_packet_copy_part (odp_packet_t pkt, uint32_t offset, uint32_t len, odp_pool_t pool)
 Partial copy of a packet. More...
 
int odp_packet_copy_to_mem (odp_packet_t pkt, uint32_t offset, uint32_t len, void *dst)
 Copy data from packet to memory. More...
 
int odp_packet_copy_from_mem (odp_packet_t pkt, uint32_t offset, uint32_t len, const void *src)
 Copy data from memory to packet. More...
 
int odp_packet_copy_from_pkt (odp_packet_t dst, uint32_t dst_offset, odp_packet_t src, uint32_t src_offset, uint32_t len)
 Copy data from another packet. More...
 
int odp_packet_copy_data (odp_packet_t pkt, uint32_t dst_offset, uint32_t src_offset, uint32_t len)
 Copy data within packet. More...
 
int odp_packet_move_data (odp_packet_t pkt, uint32_t dst_offset, uint32_t src_offset, uint32_t len)
 Move data within packet. More...
 
int odp_packet_parse (odp_packet_t pkt, uint32_t offset, const odp_packet_parse_param_t *param)
 Parse packet. More...
 
int odp_packet_parse_multi (const odp_packet_t pkt[], const uint32_t offset[], int num, const odp_packet_parse_param_t *param)
 Parse multiple packets. More...
 
void odp_packet_parse_result (odp_packet_t pkt, odp_packet_parse_result_t *result)
 Read parse results. More...
 
void odp_packet_parse_result_multi (const odp_packet_t pkt[], odp_packet_parse_result_t *result[], int num)
 Read parse results from multiple packets. More...
 
odp_pool_t odp_packet_pool (odp_packet_t pkt)
 Packet pool. More...
 
odp_pktio_t odp_packet_input (odp_packet_t pkt)
 Packet input interface. More...
 
void odp_packet_input_set (odp_packet_t pkt, odp_pktio_t pktio)
 Set packet input interface. More...
 
int odp_packet_input_index (odp_packet_t pkt)
 Packet input interface index. More...
 
void * odp_packet_user_ptr (odp_packet_t pkt)
 User context pointer. More...
 
void odp_packet_user_ptr_set (odp_packet_t pkt, const void *user_ptr)
 Set user context pointer. More...
 
void * odp_packet_user_area (odp_packet_t pkt)
 User area address. More...
 
uint32_t odp_packet_user_area_size (odp_packet_t pkt)
 User area size. More...
 
int odp_packet_user_flag (odp_packet_t pkt)
 Check user flag. More...
 
void odp_packet_user_flag_set (odp_packet_t pkt, int val)
 Set user flag. More...
 
void * odp_packet_l2_ptr (odp_packet_t pkt, uint32_t *len)
 Layer 2 start pointer. More...
 
uint32_t odp_packet_l2_offset (odp_packet_t pkt)
 Layer 2 start offset. More...
 
int odp_packet_l2_offset_set (odp_packet_t pkt, uint32_t offset)
 Set layer 2 start offset. More...
 
void * odp_packet_l3_ptr (odp_packet_t pkt, uint32_t *len)
 Layer 3 start pointer. More...
 
uint32_t odp_packet_l3_offset (odp_packet_t pkt)
 Layer 3 start offset. More...
 
int odp_packet_l3_offset_set (odp_packet_t pkt, uint32_t offset)
 Set layer 3 start offset. More...
 
void * odp_packet_l4_ptr (odp_packet_t pkt, uint32_t *len)
 Layer 4 start pointer. More...
 
uint32_t odp_packet_l4_offset (odp_packet_t pkt)
 Layer 4 start offset. More...
 
int odp_packet_l4_offset_set (odp_packet_t pkt, uint32_t offset)
 Set layer 4 start offset. More...
 
odp_proto_l2_type_t odp_packet_l2_type (odp_packet_t pkt)
 Layer 2 protocol type. More...
 
odp_proto_l3_type_t odp_packet_l3_type (odp_packet_t pkt)
 Layer 3 protocol type. More...
 
odp_proto_l4_type_t odp_packet_l4_type (odp_packet_t pkt)
 Layer 4 protocol type. More...
 
odp_packet_chksum_status_t odp_packet_l3_chksum_status (odp_packet_t pkt)
 Layer 3 checksum check status. More...
 
odp_packet_chksum_status_t odp_packet_l4_chksum_status (odp_packet_t pkt)
 Layer 4 checksum check status. More...
 
void odp_packet_l3_chksum_insert (odp_packet_t pkt, int insert)
 Layer 3 checksum insertion override. More...
 
void odp_packet_l4_chksum_insert (odp_packet_t pkt, int insert)
 Layer 4 checksum insertion override. More...
 
uint16_t odp_packet_ones_comp (odp_packet_t pkt, odp_packet_data_range_t *range)
 Ones' complement sum of packet data. More...
 
uint32_t odp_packet_flow_hash (odp_packet_t pkt)
 Packet flow hash value. More...
 
void odp_packet_flow_hash_set (odp_packet_t pkt, uint32_t flow_hash)
 Set packet flow hash value. More...
 
odp_time_t odp_packet_ts (odp_packet_t pkt)
 Packet timestamp. More...
 
void odp_packet_ts_set (odp_packet_t pkt, odp_time_t timestamp)
 Set packet timestamp. More...
 
void odp_packet_ts_request (odp_packet_t pkt, int enable)
 Request Tx timestamp capture. More...
 
odp_packet_color_t odp_packet_color (odp_packet_t pkt)
 Get packet color. More...
 
void odp_packet_color_set (odp_packet_t pkt, odp_packet_color_t color)
 Set packet color. More...
 
odp_bool_t odp_packet_drop_eligible (odp_packet_t pkt)
 Get drop eligible status. More...
 
void odp_packet_drop_eligible_set (odp_packet_t pkt, odp_bool_t status)
 Set drop eligible status. More...
 
int8_t odp_packet_shaper_len_adjust (odp_packet_t pkt)
 Get shaper length adjustment. More...
 
void odp_packet_shaper_len_adjust_set (odp_packet_t pkt, int8_t adj)
 Set shaper length adjustment. More...
 
uint64_t odp_packet_cls_mark (odp_packet_t pkt)
 Classification mark value. More...
 
int odp_packet_lso_request (odp_packet_t pkt, const odp_packet_lso_opt_t *lso_opt)
 Request Large Send Offload (LSO) for a packet. More...
 
void odp_packet_lso_request_clr (odp_packet_t pkt)
 Clear LSO request from a packet. More...
 
int odp_packet_has_lso_request (odp_packet_t pkt)
 Check if LSO is requested for the packet. More...
 
uint32_t odp_packet_payload_offset (odp_packet_t pkt)
 Payload data offset. More...
 
int odp_packet_payload_offset_set (odp_packet_t pkt, uint32_t offset)
 Set payload data start offset. More...
 
void odp_packet_aging_tmo_set (odp_packet_t pkt, uint64_t tmo_ns)
 Enable or disable Tx packet aging. More...
 
uint64_t odp_packet_aging_tmo (odp_packet_t pkt)
 Check if packet has Tx aging drop enabled. More...
 
int odp_packet_tx_compl_request (odp_packet_t pkt, const odp_packet_tx_compl_opt_t *opt)
 Request packet transmit completion. More...
 
int odp_packet_has_tx_compl_request (odp_packet_t pkt)
 Check if packet transmit completion is requested. More...
 
void odp_packet_free_ctrl_set (odp_packet_t pkt, odp_packet_free_ctrl_t ctrl)
 Set packet free control option. More...
 
odp_packet_free_ctrl_t odp_packet_free_ctrl (odp_packet_t pkt)
 Returns packet free control option value. More...
 
void odp_packet_proto_stats_request (odp_packet_t pkt, odp_packet_proto_stats_opt_t *opt)
 Request packet proto stats. More...
 
odp_proto_stats_t odp_packet_proto_stats (odp_packet_t pkt)
 Get proto stats object. More...
 
odp_packet_vector_t odp_packet_vector_from_event (odp_event_t ev)
 Get packet vector handle from event. More...
 
odp_event_t odp_packet_vector_to_event (odp_packet_vector_t pktv)
 Convert packet vector handle to event. More...
 
odp_packet_vector_t odp_packet_vector_alloc (odp_pool_t pool)
 Allocate a packet vector from a packet vector pool. More...
 
void odp_packet_vector_free (odp_packet_vector_t pktv)
 Free packet vector. More...
 
uint32_t odp_packet_vector_tbl (odp_packet_vector_t pktv, odp_packet_t **pkt_tbl)
 Get packet vector table. More...
 
uint32_t odp_packet_vector_size (odp_packet_vector_t pktv)
 Number of packets in a vector. More...
 
void odp_packet_vector_size_set (odp_packet_vector_t pktv, uint32_t size)
 Set the number of packets stored in a vector. More...
 
void * odp_packet_vector_user_area (odp_packet_vector_t pktv)
 Packet vector user area. More...
 
int odp_packet_vector_user_flag (odp_packet_vector_t pktv)
 Check user flag. More...
 
void odp_packet_vector_user_flag_set (odp_packet_vector_t pktv, int val)
 Set user flag. More...
 
int odp_packet_vector_valid (odp_packet_vector_t pktv)
 Check that packet vector is valid. More...
 
odp_pool_t odp_packet_vector_pool (odp_packet_vector_t pktv)
 Packet vector pool. More...
 
void odp_packet_vector_print (odp_packet_vector_t pktv)
 Print packet vector debug information. More...
 
uint64_t odp_packet_vector_to_u64 (odp_packet_vector_t hdl)
 Get printable value for an odp_packet_vector_t. More...
 
odp_packet_reass_status_t odp_packet_reass_status (odp_packet_t pkt)
 Check reassembly status of the packet. More...
 
odp_packet_tx_compl_t odp_packet_tx_compl_from_event (odp_event_t ev)
 Get packet Tx completion handle from event. More...
 
odp_event_t odp_packet_tx_compl_to_event (odp_packet_tx_compl_t tx_compl)
 Convert packet Tx completion to event. More...
 
void odp_packet_tx_compl_free (odp_packet_tx_compl_t tx_compl)
 Free packet Tx completion. More...
 
void * odp_packet_tx_compl_user_ptr (odp_packet_tx_compl_t tx_compl)
 User context pointer. More...
 
int odp_packet_tx_compl_done (odp_pktio_t pktio, uint32_t compl_id)
 Check packet transmit completion. More...
 
void odp_packet_print (odp_packet_t pkt)
 Print packet debug information. More...
 
void odp_packet_print_data (odp_packet_t pkt, uint32_t offset, uint32_t len)
 Print packet data. More...
 
int odp_packet_is_valid (odp_packet_t pkt)
 Check that packet is valid. More...
 
uint64_t odp_packet_to_u64 (odp_packet_t hdl)
 Get printable value for an odp_packet_t. More...
 
uint64_t odp_packet_seg_to_u64 (odp_packet_seg_t hdl)
 Get printable value for an odp_packet_seg_t. More...
 

Detailed Description

ODP packet descriptor.

Definition in file api/spec/packet.h.