DPDK 22.11.6
rte_ip.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 1982, 1986, 1990, 1993
3 * The Regents of the University of California.
4 * Copyright(c) 2010-2014 Intel Corporation.
5 * Copyright(c) 2014 6WIND S.A.
6 * All rights reserved.
7 */
8
9#ifndef _RTE_IP_H_
10#define _RTE_IP_H_
11
18#include <stdint.h>
19
20#ifdef RTE_EXEC_ENV_WINDOWS
21#include <ws2tcpip.h>
22#else
23#include <sys/socket.h>
24#include <sys/types.h>
25#include <netinet/in.h>
26#include <arpa/inet.h>
27#include <netinet/ip.h>
28#include <netinet/ip6.h>
29#endif
30
31#include <rte_compat.h>
32#include <rte_byteorder.h>
33#include <rte_mbuf.h>
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
43 __extension__
44 union {
45 uint8_t version_ihl;
46 struct {
47#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
48 uint8_t ihl:4;
49 uint8_t version:4;
50#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
51 uint8_t version:4;
52 uint8_t ihl:4;
53#endif
54 };
55 };
60 uint8_t time_to_live;
61 uint8_t next_proto_id;
66
68#define RTE_IPV4(a, b, c, d) ((uint32_t)(((a) & 0xff) << 24) | \
69 (((b) & 0xff) << 16) | \
70 (((c) & 0xff) << 8) | \
71 ((d) & 0xff))
72
74#define RTE_IPV4_MAX_PKT_LEN 65535
75
77#define RTE_IPV4_HDR_IHL_MASK (0x0f)
82#define RTE_IPV4_IHL_MULTIPLIER (4)
83
84/* Type of Service fields */
85#define RTE_IPV4_HDR_DSCP_MASK (0xfc)
86#define RTE_IPV4_HDR_ECN_MASK (0x03)
87#define RTE_IPV4_HDR_ECN_CE RTE_IPV4_HDR_ECN_MASK
88
89/* Fragment Offset * Flags. */
90#define RTE_IPV4_HDR_DF_SHIFT 14
91#define RTE_IPV4_HDR_MF_SHIFT 13
92#define RTE_IPV4_HDR_FO_SHIFT 3
93
94#define RTE_IPV4_HDR_DF_FLAG (1 << RTE_IPV4_HDR_DF_SHIFT)
95#define RTE_IPV4_HDR_MF_FLAG (1 << RTE_IPV4_HDR_MF_SHIFT)
96
97#define RTE_IPV4_HDR_OFFSET_MASK ((1 << RTE_IPV4_HDR_MF_SHIFT) - 1)
98
99#define RTE_IPV4_HDR_OFFSET_UNITS 8
100
101/* IPv4 options */
102#define RTE_IPV4_HDR_OPT_EOL 0
103#define RTE_IPV4_HDR_OPT_NOP 1
104#define RTE_IPV4_HDR_OPT_COPIED(v) ((v) & 0x80)
105#define RTE_IPV4_HDR_OPT_MAX_LEN 40
106
107/*
108 * IPv4 address types
109 */
110#define RTE_IPV4_ANY ((uint32_t)0x00000000)
111#define RTE_IPV4_LOOPBACK ((uint32_t)0x7f000001)
112#define RTE_IPV4_BROADCAST ((uint32_t)0xe0000000)
113#define RTE_IPV4_ALLHOSTS_GROUP ((uint32_t)0xe0000001)
114#define RTE_IPV4_ALLRTRS_GROUP ((uint32_t)0xe0000002)
115#define RTE_IPV4_MAX_LOCAL_GROUP ((uint32_t)0xe00000ff)
117/*
118 * IPv4 Multicast-related macros
119 */
120#define RTE_IPV4_MIN_MCAST \
121 RTE_IPV4(224, 0, 0, 0)
122#define RTE_IPV4_MAX_MCAST \
123 RTE_IPV4(239, 255, 255, 255)
125#define RTE_IS_IPV4_MCAST(x) \
126 ((x) >= RTE_IPV4_MIN_MCAST && (x) <= RTE_IPV4_MAX_MCAST)
129/* IPv4 default fields values */
130#define RTE_IPV4_MIN_IHL (0x5)
131#define RTE_IPV4_VHL_DEF ((IPVERSION << 4) | RTE_IPV4_MIN_IHL)
132
141static inline uint8_t
142rte_ipv4_hdr_len(const struct rte_ipv4_hdr *ipv4_hdr)
143{
144 return (uint8_t)((ipv4_hdr->version_ihl & RTE_IPV4_HDR_IHL_MASK) *
146}
147
161static inline uint32_t
162__rte_raw_cksum(const void *buf, size_t len, uint32_t sum)
163{
164 const void *end;
165
166 for (end = RTE_PTR_ADD(buf, RTE_ALIGN_FLOOR(len, sizeof(uint16_t)));
167 buf != end; buf = RTE_PTR_ADD(buf, sizeof(uint16_t))) {
168 uint16_t v;
169
170 memcpy(&v, buf, sizeof(uint16_t));
171 sum += v;
172 }
173
174 /* if length is odd, keeping it byte order independent */
175 if (unlikely(len % 2)) {
176 uint16_t left = 0;
177
178 memcpy(&left, end, 1);
179 sum += left;
180 }
181
182 return sum;
183}
184
194static inline uint16_t
195__rte_raw_cksum_reduce(uint32_t sum)
196{
197 sum = ((sum & 0xffff0000) >> 16) + (sum & 0xffff);
198 sum = ((sum & 0xffff0000) >> 16) + (sum & 0xffff);
199 return (uint16_t)sum;
200}
201
212static inline uint16_t
213rte_raw_cksum(const void *buf, size_t len)
214{
215 uint32_t sum;
216
217 sum = __rte_raw_cksum(buf, len, 0);
218 return __rte_raw_cksum_reduce(sum);
219}
220
235static inline int
236rte_raw_cksum_mbuf(const struct rte_mbuf *m, uint32_t off, uint32_t len,
237 uint16_t *cksum)
239 const struct rte_mbuf *seg;
240 const char *buf;
241 uint32_t sum, tmp;
242 uint32_t seglen, done;
243
244 /* easy case: all data in the first segment */
245 if (off + len <= rte_pktmbuf_data_len(m)) {
247 const char *, off), len);
248 return 0;
249 }
250
251 if (unlikely(off + len > rte_pktmbuf_pkt_len(m)))
252 return -1; /* invalid params, return a dummy value */
253
254 /* else browse the segment to find offset */
255 seglen = 0;
256 for (seg = m; seg != NULL; seg = seg->next) {
257 seglen = rte_pktmbuf_data_len(seg);
258 if (off < seglen)
259 break;
260 off -= seglen;
261 }
262 RTE_ASSERT(seg != NULL);
263 if (seg == NULL)
264 return -1;
265 seglen -= off;
266 buf = rte_pktmbuf_mtod_offset(seg, const char *, off);
267 if (seglen >= len) {
268 /* all in one segment */
269 *cksum = rte_raw_cksum(buf, len);
270 return 0;
271 }
272
273 /* hard case: process checksum of several segments */
274 sum = 0;
275 done = 0;
276 for (;;) {
277 tmp = __rte_raw_cksum(buf, seglen, 0);
278 if (done & 1)
279 tmp = rte_bswap16((uint16_t)tmp);
280 sum += tmp;
281 done += seglen;
282 if (done == len)
283 break;
284 seg = seg->next;
285 buf = rte_pktmbuf_mtod(seg, const char *);
286 seglen = rte_pktmbuf_data_len(seg);
287 if (seglen > len - done)
288 seglen = len - done;
289 }
290
291 *cksum = __rte_raw_cksum_reduce(sum);
292 return 0;
293}
294
305static inline uint16_t
306rte_ipv4_cksum(const struct rte_ipv4_hdr *ipv4_hdr)
307{
308 uint16_t cksum;
309 cksum = rte_raw_cksum(ipv4_hdr, rte_ipv4_hdr_len(ipv4_hdr));
310 return (uint16_t)~cksum;
311}
312
331static inline uint16_t
332rte_ipv4_phdr_cksum(const struct rte_ipv4_hdr *ipv4_hdr, uint64_t ol_flags)
333{
334 struct ipv4_psd_header {
335 uint32_t src_addr; /* IP address of source host. */
336 uint32_t dst_addr; /* IP address of destination host. */
337 uint8_t zero; /* zero. */
338 uint8_t proto; /* L4 protocol type. */
339 uint16_t len; /* L4 length. */
340 } psd_hdr;
341
342 uint32_t l3_len;
343
344 psd_hdr.src_addr = ipv4_hdr->src_addr;
345 psd_hdr.dst_addr = ipv4_hdr->dst_addr;
346 psd_hdr.zero = 0;
347 psd_hdr.proto = ipv4_hdr->next_proto_id;
348 if (ol_flags & RTE_MBUF_F_TX_TCP_SEG) {
349 psd_hdr.len = 0;
350 } else {
351 l3_len = rte_be_to_cpu_16(ipv4_hdr->total_length);
352 psd_hdr.len = rte_cpu_to_be_16((uint16_t)(l3_len -
353 rte_ipv4_hdr_len(ipv4_hdr)));
354 }
355 return rte_raw_cksum(&psd_hdr, sizeof(psd_hdr));
356}
357
361static inline uint16_t
362__rte_ipv4_udptcp_cksum(const struct rte_ipv4_hdr *ipv4_hdr, const void *l4_hdr)
363{
364 uint32_t cksum;
365 uint32_t l3_len, l4_len;
366 uint8_t ip_hdr_len;
367
368 ip_hdr_len = rte_ipv4_hdr_len(ipv4_hdr);
369 l3_len = rte_be_to_cpu_16(ipv4_hdr->total_length);
370 if (l3_len < ip_hdr_len)
371 return 0;
372
373 l4_len = l3_len - ip_hdr_len;
374
375 cksum = rte_raw_cksum(l4_hdr, l4_len);
376 cksum += rte_ipv4_phdr_cksum(ipv4_hdr, 0);
377
378 cksum = ((cksum & 0xffff0000) >> 16) + (cksum & 0xffff);
379
380 return (uint16_t)cksum;
381}
382
395static inline uint16_t
396rte_ipv4_udptcp_cksum(const struct rte_ipv4_hdr *ipv4_hdr, const void *l4_hdr)
397{
398 uint16_t cksum = __rte_ipv4_udptcp_cksum(ipv4_hdr, l4_hdr);
399
400 cksum = ~cksum;
401
402 /*
403 * Per RFC 768: If the computed checksum is zero for UDP,
404 * it is transmitted as all ones
405 * (the equivalent in one's complement arithmetic).
406 */
407 if (cksum == 0 && ipv4_hdr->next_proto_id == IPPROTO_UDP)
408 cksum = 0xffff;
409
410 return cksum;
411}
412
416static inline uint16_t
417__rte_ipv4_udptcp_cksum_mbuf(const struct rte_mbuf *m,
418 const struct rte_ipv4_hdr *ipv4_hdr,
419 uint16_t l4_off)
420{
421 uint16_t raw_cksum;
422 uint32_t cksum;
423 uint16_t len;
424
425 if (unlikely(l4_off > m->pkt_len))
426 return 0; /* invalid params, return a dummy value */
427
428 len = rte_be_to_cpu_16(ipv4_hdr->total_length) - (uint16_t)rte_ipv4_hdr_len(ipv4_hdr);
429
430 if (rte_raw_cksum_mbuf(m, l4_off, len, &raw_cksum))
431 return 0;
432
433 cksum = raw_cksum + rte_ipv4_phdr_cksum(ipv4_hdr, 0);
434
435 cksum = ((cksum & 0xffff0000) >> 16) + (cksum & 0xffff);
436
437 return (uint16_t)cksum;
438}
439
455__rte_experimental
456static inline uint16_t
458 const struct rte_ipv4_hdr *ipv4_hdr, uint16_t l4_off)
460 uint16_t cksum = __rte_ipv4_udptcp_cksum_mbuf(m, ipv4_hdr, l4_off);
461
462 cksum = ~cksum;
463
464 /*
465 * Per RFC 768: If the computed checksum is zero for UDP,
466 * it is transmitted as all ones
467 * (the equivalent in one's complement arithmetic).
468 */
469 if (cksum == 0 && ipv4_hdr->next_proto_id == IPPROTO_UDP)
470 cksum = 0xffff;
471
472 return cksum;
473}
474
488__rte_experimental
489static inline int
490rte_ipv4_udptcp_cksum_verify(const struct rte_ipv4_hdr *ipv4_hdr,
491 const void *l4_hdr)
493 uint16_t cksum = __rte_ipv4_udptcp_cksum(ipv4_hdr, l4_hdr);
494
495 if (cksum != 0xffff)
496 return -1;
497
498 return 0;
499}
500
519__rte_experimental
520static inline int
522 const struct rte_ipv4_hdr *ipv4_hdr,
523 uint16_t l4_off)
524{
525 uint16_t cksum = __rte_ipv4_udptcp_cksum_mbuf(m, ipv4_hdr, l4_off);
526
527 if (cksum != 0xffff)
528 return -1;
529
530 return 0;
531}
532
536struct rte_ipv6_hdr {
539 uint8_t proto;
540 uint8_t hop_limits;
541 uint8_t src_addr[16];
542 uint8_t dst_addr[16];
545/* IPv6 vtc_flow: IPv / TC / flow_label */
546#define RTE_IPV6_HDR_FL_SHIFT 0
547#define RTE_IPV6_HDR_TC_SHIFT 20
548#define RTE_IPV6_HDR_FL_MASK ((1u << RTE_IPV6_HDR_TC_SHIFT) - 1)
549#define RTE_IPV6_HDR_TC_MASK (0xff << RTE_IPV6_HDR_TC_SHIFT)
550#define RTE_IPV6_HDR_DSCP_MASK (0xfc << RTE_IPV6_HDR_TC_SHIFT)
551#define RTE_IPV6_HDR_ECN_MASK (0x03 << RTE_IPV6_HDR_TC_SHIFT)
552#define RTE_IPV6_HDR_ECN_CE RTE_IPV6_HDR_ECN_MASK
553
554#define RTE_IPV6_MIN_MTU 1280
572static inline uint16_t
573rte_ipv6_phdr_cksum(const struct rte_ipv6_hdr *ipv6_hdr, uint64_t ol_flags)
574{
575 uint32_t sum;
576 struct {
577 rte_be32_t len; /* L4 length. */
578 rte_be32_t proto; /* L4 protocol - top 3 bytes must be zero */
579 } psd_hdr;
580
581 psd_hdr.proto = (uint32_t)(ipv6_hdr->proto << 24);
582 if (ol_flags & RTE_MBUF_F_TX_TCP_SEG) {
583 psd_hdr.len = 0;
584 } else {
585 psd_hdr.len = ipv6_hdr->payload_len;
586 }
587
588 sum = __rte_raw_cksum(ipv6_hdr->src_addr,
589 sizeof(ipv6_hdr->src_addr) + sizeof(ipv6_hdr->dst_addr),
590 0);
591 sum = __rte_raw_cksum(&psd_hdr, sizeof(psd_hdr), sum);
592 return __rte_raw_cksum_reduce(sum);
593}
594
598static inline uint16_t
599__rte_ipv6_udptcp_cksum(const struct rte_ipv6_hdr *ipv6_hdr, const void *l4_hdr)
600{
601 uint32_t cksum;
602 uint32_t l4_len;
603
604 l4_len = rte_be_to_cpu_16(ipv6_hdr->payload_len);
605
606 cksum = rte_raw_cksum(l4_hdr, l4_len);
607 cksum += rte_ipv6_phdr_cksum(ipv6_hdr, 0);
608
609 cksum = ((cksum & 0xffff0000) >> 16) + (cksum & 0xffff);
610
611 return (uint16_t)cksum;
612}
613
627static inline uint16_t
628rte_ipv6_udptcp_cksum(const struct rte_ipv6_hdr *ipv6_hdr, const void *l4_hdr)
629{
630 uint16_t cksum = __rte_ipv6_udptcp_cksum(ipv6_hdr, l4_hdr);
631
632 cksum = ~cksum;
633
634 /*
635 * Per RFC 768: If the computed checksum is zero for UDP,
636 * it is transmitted as all ones
637 * (the equivalent in one's complement arithmetic).
638 */
639 if (cksum == 0 && ipv6_hdr->proto == IPPROTO_UDP)
640 cksum = 0xffff;
641
642 return cksum;
643}
644
648static inline uint16_t
649__rte_ipv6_udptcp_cksum_mbuf(const struct rte_mbuf *m,
650 const struct rte_ipv6_hdr *ipv6_hdr,
651 uint16_t l4_off)
652{
653 uint16_t raw_cksum;
654 uint32_t cksum;
655
656 if (unlikely(l4_off > m->pkt_len))
657 return 0; /* invalid params, return a dummy value */
658
659 if (rte_raw_cksum_mbuf(m, l4_off, rte_be_to_cpu_16(ipv6_hdr->payload_len), &raw_cksum))
660 return 0;
661
662 cksum = raw_cksum + rte_ipv6_phdr_cksum(ipv6_hdr, 0);
663
664 cksum = ((cksum & 0xffff0000) >> 16) + (cksum & 0xffff);
665
666 return (uint16_t)cksum;
667}
668
687__rte_experimental
688static inline uint16_t
690 const struct rte_ipv6_hdr *ipv6_hdr, uint16_t l4_off)
692 uint16_t cksum = __rte_ipv6_udptcp_cksum_mbuf(m, ipv6_hdr, l4_off);
693
694 cksum = ~cksum;
695
696 /*
697 * Per RFC 768: If the computed checksum is zero for UDP,
698 * it is transmitted as all ones
699 * (the equivalent in one's complement arithmetic).
700 */
701 if (cksum == 0 && ipv6_hdr->proto == IPPROTO_UDP)
702 cksum = 0xffff;
703
704 return cksum;
705}
706
721__rte_experimental
722static inline int
723rte_ipv6_udptcp_cksum_verify(const struct rte_ipv6_hdr *ipv6_hdr,
724 const void *l4_hdr)
726 uint16_t cksum = __rte_ipv6_udptcp_cksum(ipv6_hdr, l4_hdr);
727
728 if (cksum != 0xffff)
729 return -1;
730
731 return 0;
732}
733
753__rte_experimental
754static inline int
756 const struct rte_ipv6_hdr *ipv6_hdr,
757 uint16_t l4_off)
758{
759 uint16_t cksum = __rte_ipv6_udptcp_cksum_mbuf(m, ipv6_hdr, l4_off);
760
761 if (cksum != 0xffff)
762 return -1;
763
764 return 0;
765}
766
768#define RTE_IPV6_EHDR_MF_SHIFT 0
769#define RTE_IPV6_EHDR_MF_MASK 1
770#define RTE_IPV6_EHDR_FO_SHIFT 3
771#define RTE_IPV6_EHDR_FO_MASK (~((1 << RTE_IPV6_EHDR_FO_SHIFT) - 1))
772#define RTE_IPV6_EHDR_FO_ALIGN (1 << RTE_IPV6_EHDR_FO_SHIFT)
773
774#define RTE_IPV6_FRAG_USED_MASK (RTE_IPV6_EHDR_MF_MASK | RTE_IPV6_EHDR_FO_MASK)
775
776#define RTE_IPV6_GET_MF(x) ((x) & RTE_IPV6_EHDR_MF_MASK)
777#define RTE_IPV6_GET_FO(x) ((x) >> RTE_IPV6_EHDR_FO_SHIFT)
778
779#define RTE_IPV6_SET_FRAG_DATA(fo, mf) \
780 (((fo) & RTE_IPV6_EHDR_FO_MASK) | ((mf) & RTE_IPV6_EHDR_MF_MASK))
781
782struct rte_ipv6_fragment_ext {
783 uint8_t next_header;
784 uint8_t reserved;
785 rte_be16_t frag_data;
786 rte_be32_t id;
788
789/* IPv6 fragment extension header size */
790#define RTE_IPV6_FRAG_HDR_SIZE sizeof(struct rte_ipv6_fragment_ext)
791
808__rte_experimental
809static inline int
810rte_ipv6_get_next_ext(const uint8_t *p, int proto, size_t *ext_len)
811{
812 int next_proto;
813
814 switch (proto) {
815 case IPPROTO_AH:
816 next_proto = *p++;
817 *ext_len = (*p + 2) * sizeof(uint32_t);
818 break;
819
820 case IPPROTO_HOPOPTS:
821 case IPPROTO_ROUTING:
822 case IPPROTO_DSTOPTS:
823 next_proto = *p++;
824 *ext_len = (*p + 1) * sizeof(uint64_t);
825 break;
826
827 case IPPROTO_FRAGMENT:
828 next_proto = *p;
829 *ext_len = RTE_IPV6_FRAG_HDR_SIZE;
830 break;
831
832 default:
833 return -EINVAL;
834 }
835
836 return next_proto;
837}
838
839#ifdef __cplusplus
840}
841#endif
842
843#endif /* _RTE_IP_H_ */
#define unlikely(x)
static uint16_t rte_be_to_cpu_16(rte_be16_t x)
static rte_be16_t rte_cpu_to_be_16(uint16_t x)
uint32_t rte_be32_t
static uint16_t rte_bswap16(uint16_t _x)
uint16_t rte_be16_t
#define RTE_ALIGN_FLOOR(val, align)
Definition: rte_common.h:328
#define RTE_PTR_ADD(ptr, x)
Definition: rte_common.h:290
#define __rte_packed
Definition: rte_common.h:83
struct rte_ether_addr src_addr
Definition: rte_ether.h:1
struct rte_ether_addr dst_addr
Definition: rte_ether.h:0
static uint16_t rte_ipv4_phdr_cksum(const struct rte_ipv4_hdr *ipv4_hdr, uint64_t ol_flags)
Definition: rte_ip.h:334
static __rte_experimental int rte_ipv6_get_next_ext(const uint8_t *p, int proto, size_t *ext_len)
Definition: rte_ip.h:812
static __rte_experimental uint16_t rte_ipv6_udptcp_cksum_mbuf(const struct rte_mbuf *m, const struct rte_ipv6_hdr *ipv6_hdr, uint16_t l4_off)
Definition: rte_ip.h:691
static uint16_t rte_ipv6_phdr_cksum(const struct rte_ipv6_hdr *ipv6_hdr, uint64_t ol_flags)
Definition: rte_ip.h:575
static uint16_t rte_raw_cksum(const void *buf, size_t len)
Definition: rte_ip.h:215
static uint16_t rte_ipv6_udptcp_cksum(const struct rte_ipv6_hdr *ipv6_hdr, const void *l4_hdr)
Definition: rte_ip.h:630
static __rte_experimental uint16_t rte_ipv4_udptcp_cksum_mbuf(const struct rte_mbuf *m, const struct rte_ipv4_hdr *ipv4_hdr, uint16_t l4_off)
Definition: rte_ip.h:459
static __rte_experimental int rte_ipv4_udptcp_cksum_mbuf_verify(const struct rte_mbuf *m, const struct rte_ipv4_hdr *ipv4_hdr, uint16_t l4_off)
Definition: rte_ip.h:523
static __rte_experimental int rte_ipv6_udptcp_cksum_verify(const struct rte_ipv6_hdr *ipv6_hdr, const void *l4_hdr)
Definition: rte_ip.h:725
static uint16_t rte_ipv4_udptcp_cksum(const struct rte_ipv4_hdr *ipv4_hdr, const void *l4_hdr)
Definition: rte_ip.h:398
static uint16_t rte_ipv4_cksum(const struct rte_ipv4_hdr *ipv4_hdr)
Definition: rte_ip.h:308
static int rte_raw_cksum_mbuf(const struct rte_mbuf *m, uint32_t off, uint32_t len, uint16_t *cksum)
Definition: rte_ip.h:238
static uint8_t rte_ipv4_hdr_len(const struct rte_ipv4_hdr *ipv4_hdr)
Definition: rte_ip.h:144
static __rte_experimental int rte_ipv4_udptcp_cksum_verify(const struct rte_ipv4_hdr *ipv4_hdr, const void *l4_hdr)
Definition: rte_ip.h:492
static __rte_experimental int rte_ipv6_udptcp_cksum_mbuf_verify(const struct rte_mbuf *m, const struct rte_ipv6_hdr *ipv6_hdr, uint16_t l4_off)
Definition: rte_ip.h:757
#define RTE_IPV4_HDR_IHL_MASK
Definition: rte_ip.h:77
#define RTE_IPV4_IHL_MULTIPLIER
Definition: rte_ip.h:82
#define rte_pktmbuf_data_len(m)
Definition: rte_mbuf.h:1569
#define rte_pktmbuf_pkt_len(m)
Definition: rte_mbuf.h:1559
#define rte_pktmbuf_mtod(m, t)
#define RTE_MBUF_F_TX_TCP_SEG
#define rte_pktmbuf_mtod_offset(m, t, o)
uint8_t time_to_live
Definition: rte_ip.h:60
uint8_t version_ihl
Definition: rte_ip.h:45
rte_be16_t hdr_checksum
Definition: rte_ip.h:62
uint8_t ihl
Definition: rte_ip.h:48
uint8_t next_proto_id
Definition: rte_ip.h:61
rte_be32_t dst_addr
Definition: rte_ip.h:64
rte_be32_t src_addr
Definition: rte_ip.h:63
uint8_t version
Definition: rte_ip.h:49
uint8_t type_of_service
Definition: rte_ip.h:56
rte_be16_t total_length
Definition: rte_ip.h:57
rte_be16_t fragment_offset
Definition: rte_ip.h:59
rte_be16_t packet_id
Definition: rte_ip.h:58
uint8_t hop_limits
Definition: rte_ip.h:542
uint8_t dst_addr[16]
Definition: rte_ip.h:544
rte_be32_t vtc_flow
Definition: rte_ip.h:539
uint8_t src_addr[16]
Definition: rte_ip.h:543
rte_be16_t payload_len
Definition: rte_ip.h:540
uint8_t proto
Definition: rte_ip.h:541
uint64_t ol_flags
uint32_t pkt_len
struct rte_mbuf * next