API Reference Manual  1.46.0
api/spec/packet_types.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2013-2018 Linaro Limited
3  * Copyright (c) 2021-2023 Nokia
4  */
5 
12 #ifndef ODP_API_SPEC_PACKET_TYPES_H_
13 #define ODP_API_SPEC_PACKET_TYPES_H_
14 #include <odp/visibility_begin.h>
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 #include <odp/api/deprecated.h>
22 #include <odp/api/queue_types.h>
23 
88 #define ODP_NUM_PACKET_COLORS 3
89 
93 typedef uint8_t odp_proto_l2_type_t;
94 
96 #define ODP_PROTO_L2_TYPE_NONE 0
97 
99 #define ODP_PROTO_L2_TYPE_ETH 1
100 
104 typedef uint16_t odp_proto_l3_type_t;
105 
107 #define ODP_PROTO_L3_TYPE_NONE 0xFFFF
108 
109 /* Types from IEEE EtherType assignments list */
110 
112 #define ODP_PROTO_L3_TYPE_ARP 0x0806
113 
115 #define ODP_PROTO_L3_TYPE_RARP 0x8035
116 
118 #define ODP_PROTO_L3_TYPE_MPLS 0x8847
119 
121 #define ODP_PROTO_L3_TYPE_IPV4 0x0800
122 
124 #define ODP_PROTO_L3_TYPE_IPV6 0x86DD
125 
129 typedef uint8_t odp_proto_l4_type_t;
130 
132  #define ODP_PROTO_L4_TYPE_NONE 255
133 
134 /* Types from IANA assigned Internet protocol numbers list */
135 
137  #define ODP_PROTO_L4_TYPE_ICMPV4 1
138 
140 #define ODP_PROTO_L4_TYPE_IGMP 2
141 
143 #define ODP_PROTO_L4_TYPE_IPV4 4
144 
146  #define ODP_PROTO_L4_TYPE_TCP 6
147 
149 #define ODP_PROTO_L4_TYPE_UDP 17
150 
152 #define ODP_PROTO_L4_TYPE_IPV6 41
153 
155 #define ODP_PROTO_L4_TYPE_GRE 47
156 
158 #define ODP_PROTO_L4_TYPE_ESP 50
159 
161 #define ODP_PROTO_L4_TYPE_AH 51
162 
164 #define ODP_PROTO_L4_TYPE_ICMPV6 58
165 
167 #define ODP_PROTO_L4_TYPE_NO_NEXT 59
168 
170 #define ODP_PROTO_L4_TYPE_IPCOMP 108
171 
173 #define ODP_PROTO_L4_TYPE_SCTP 132
174 
176 #define ODP_PROTO_L4_TYPE_ROHC 142
177 
216 typedef enum odp_proto_t {
219 
222 
225 
228 
230 
234 typedef enum odp_proto_layer_t {
237 
240 
243 
246 
249 
251 
255 typedef struct odp_packet_data_range {
257  uint32_t offset;
258 
260  uint32_t length;
261 
263 
270 
278 
283 
287 typedef struct odp_packet_reass_info_t {
289  uint16_t num_frags;
291 
297  uint16_t num_frags;
298 
300  uint64_t elapsed_time;
302 
306 typedef union odp_proto_chksums_t {
308  struct {
310  uint32_t ipv4 : 1;
311 
313  uint32_t udp : 1;
314 
316  uint32_t tcp : 1;
317 
319  uint32_t sctp : 1;
320 
322 
327  uint32_t all_chksum;
328 
330 
334 typedef struct odp_packet_parse_param_t {
338 
342 
349 
351 
358 
360  uint32_t packet_len;
361 
363  uint32_t l2_offset;
365  uint32_t l3_offset;
367  uint32_t l4_offset;
368 
373 
380 
382 
386 typedef struct odp_packet_lso_opt_t {
396 
406  uint32_t payload_offset;
407 
416  uint32_t max_payload_len;
417 
419 
426 
433 
440 
442 
448 #if ODP_DEPRECATED_API
449 #define ODP_PACKET_TX_COMPL_ALL ODP_PACKET_TX_COMPL_EVENT
450 #endif
451 
463 
465  union {
473 
486  uint32_t compl_id;
487  };
488 
490 
497 
500 
502 
512 
514  int32_t oct_count0_adj;
515 
517  int32_t oct_count1_adj;
519 
524 #ifdef __cplusplus
525 }
526 #endif
527 
528 #include <odp/visibility_end.h>
529 #endif
ODP proto stats types.
ODP queue.
Control deprecated API definitions.
odp_packet_free_ctrl_t
Packet free control option.
odp_proto_t
Protocol.
struct odp_packet_data_range odp_packet_data_range_t
Packet API data range specifier.
struct odp_packet_parse_result_t odp_packet_parse_result_t
Packet parse results.
uint16_t odp_proto_l3_type_t
Layer 3 protocol type.
odp_proto_layer_t
Protocol layer.
odp_packet_tx_compl_mode_t
Packet transmit completion mode.
struct odp_packet_proto_stats_opt_t odp_packet_proto_stats_opt_t
Packet proto stats options.
struct odp_packet_parse_param_t odp_packet_parse_param_t
Packet parse parameters.
odp_packet_reass_status_t
Reassembly status of a packet.
struct odp_packet_reass_info_t odp_packet_reass_info_t
Information about a completed reassembly.
struct odp_packet_reass_partial_state_t odp_packet_reass_partial_state_t
Result from odp_packet_reass_partial_state()
odp_packet_chksum_status_t
Packet Checksum Status.
struct odp_packet_tx_compl_opt_t odp_packet_tx_compl_opt_t
Packet transmit completion request options.
uint8_t odp_proto_l4_type_t
Layer 4 protocol type.
struct odp_packet_lso_opt_t odp_packet_lso_opt_t
LSO options.
union odp_proto_chksums_t odp_proto_chksums_t
Flags to control packet data checksum checking.
uint8_t odp_proto_l2_type_t
Layer 2 protocol type.
@ ODP_PACKET_FREE_CTRL_DONT_FREE
Don't free packet after processing it.
@ ODP_PACKET_FREE_CTRL_DISABLED
Packet free control disabled.
@ ODP_PROTO_NONE
No protocol defined.
@ ODP_PROTO_IPV6
IP version 6.
@ ODP_PROTO_ETH
Ethernet (including VLAN)
@ ODP_PROTO_IPV4
IP version 4.
@ ODP_PROTO_LAYER_L3
Layer L3 protocols (IPv4, IPv6, ICMP, IPSEC, etc)
@ ODP_PROTO_LAYER_ALL
All layers.
@ ODP_PROTO_LAYER_L4
Layer L4 protocols (UDP, TCP, SCTP)
@ ODP_PROTO_LAYER_NONE
No layers.
@ ODP_PROTO_LAYER_L2
Layer L2 protocols (Ethernet, VLAN, etc)
@ ODP_PACKET_TX_COMPL_POLL
Enable packet transmit completion check through polling.
@ ODP_PACKET_TX_COMPL_DISABLED
Disable packet transmit completion.
@ ODP_PACKET_TX_COMPL_EVENT
Enable packet transmit completion event.
@ ODP_PACKET_REASS_INCOMPLETE
Reassembly was attempted but is incomplete.
@ ODP_PACKET_REASS_COMPLETE
Reassembly was successfully done.
@ ODP_PACKET_REASS_NONE
Reassembly was not attempted.
Packet API data range specifier.
uint32_t offset
Offset from beginning of packet.
uint32_t length
Length of data to operate on.
odp_lso_profile_t lso_profile
LSO profile handle.
uint32_t payload_offset
LSO payload offset.
uint32_t max_payload_len
Maximum payload length in an LSO segment.
Packet parse parameters.
odp_proto_chksums_t chksums
Flags to control payload data checksums checks up to the selected parse layer.
odp_proto_layer_t last_layer
Continue parsing until this layer.
odp_proto_t proto
Protocol header at parse starting point.
odp_proto_l3_type_t l3_type
See odp_packet_l3_type()
odp_packet_chksum_status_t l3_chksum_status
See odp_packet_l3_chksum_status()
odp_packet_chksum_status_t l4_chksum_status
See odp_packet_l4_chksum_status()
uint32_t packet_len
See odp_packet_len()
odp_packet_parse_result_flag_t flag
Parse result flags.
odp_proto_l4_type_t l4_type
See odp_packet_l4_type()
uint32_t l3_offset
See odp_packet_l3_offset()
odp_proto_l2_type_t l2_type
See odp_packet_l2_type()
uint32_t l4_offset
See odp_packet_l4_offset()
uint32_t l2_offset
See odp_packet_l2_offset()
Packet proto stats options.
int32_t oct_count1_adj
Octet counter 1 adjust.
int32_t oct_count0_adj
Octet counter 0 adjust.
odp_proto_stats_t stat
Packet proto stats object handle.
Information about a completed reassembly.
uint16_t num_frags
Number of fragments reassembled.
Result from odp_packet_reass_partial_state()
uint16_t num_frags
Number of fragments returned.
uint64_t elapsed_time
Time, in ns, since the reception of the first received fragment.
Packet transmit completion request options.
odp_packet_tx_compl_mode_t mode
Packet transmit completion mode.
odp_queue_t queue
Destination queue.
uint32_t compl_id
Completion identifier.
Flags to control packet data checksum checking.
uint32_t sctp
SCTP checksum.
struct odp_proto_chksums_t::@116 chksum
Individual checksum bits.
uint32_t ipv4
IPv4 header checksum.
uint32_t all_chksum
All checksum bits.
uint32_t tcp
TCP checksum.
uint32_t udp
UDP checksum.