|
DPDK 25.11.0
|
#include <stdint.h>#include <sys/socket.h>#include <sys/types.h>#include <netinet/in.h>#include <arpa/inet.h>#include <netinet/ip.h>#include <netinet/ip6.h>#include <rte_byteorder.h>#include <rte_cksum.h>#include <rte_mbuf.h>Go to the source code of this file.
Macros | |
| #define | RTE_IPV4(a, b, c, d) |
| #define | RTE_IPV4_MAX_PKT_LEN 65535 |
| #define | RTE_IPV4_HDR_IHL_MASK (0x0f) |
| #define | RTE_IPV4_IHL_MULTIPLIER (4) |
| #define | RTE_IPV4_ANY ((uint32_t)0x00000000) |
| #define | RTE_IPV4_LOOPBACK ((uint32_t)0x7f000001) |
| #define | RTE_IPV4_BROADCAST ((uint32_t)0xe0000000) |
| #define | RTE_IPV4_ALLHOSTS_GROUP ((uint32_t)0xe0000001) |
| #define | RTE_IPV4_ALLRTRS_GROUP ((uint32_t)0xe0000002) |
| #define | RTE_IPV4_MAX_LOCAL_GROUP ((uint32_t)0xe00000ff) |
| #define | RTE_IPV4_MIN_MCAST RTE_IPV4(224, 0, 0, 0) |
| #define | RTE_IPV4_MAX_MCAST RTE_IPV4(239, 255, 255, 255) |
| #define | RTE_IS_IPV4_MCAST(x) |
Functions | |
| struct | __rte_aligned (2) __rte_packed_begin rte_ipv4_hdr |
| static uint8_t | rte_ipv4_hdr_len (const struct rte_ipv4_hdr *ipv4_hdr) |
| static uint16_t | rte_ipv4_cksum (const struct rte_ipv4_hdr *ipv4_hdr) |
| static __rte_experimental uint16_t | rte_ipv4_cksum_simple (const struct rte_ipv4_hdr *ipv4_hdr) |
| static uint16_t | rte_ipv4_phdr_cksum (const struct rte_ipv4_hdr *ipv4_hdr, uint64_t ol_flags) |
| static uint16_t | rte_ipv4_udptcp_cksum (const struct rte_ipv4_hdr *ipv4_hdr, const void *l4_hdr) |
| static uint16_t | rte_ipv4_udptcp_cksum_mbuf (const struct rte_mbuf *m, const struct rte_ipv4_hdr *ipv4_hdr, uint16_t l4_off) |
| static int | rte_ipv4_udptcp_cksum_verify (const struct rte_ipv4_hdr *ipv4_hdr, const void *l4_hdr) |
| static int | rte_ipv4_udptcp_cksum_mbuf_verify (const struct rte_mbuf *m, const struct rte_ipv4_hdr *ipv4_hdr, uint16_t l4_off) |
IPv4-related defines
Definition in file rte_ip4.h.
| #define RTE_IPV4 | ( | a, | |
| b, | |||
| c, | |||
| d ) |
Create IPv4 address
| #define RTE_IPV4_MAX_PKT_LEN 65535 |
Maximal IPv4 packet length (including a header)
| #define RTE_IPV4_HDR_IHL_MASK (0x0f) |
Internet header length mask for version_ihl field
| #define RTE_IPV4_IHL_MULTIPLIER (4) |
Internet header length field multiplier (IHL field specifies overall header length in number of 4-byte words)
| #define RTE_IPV4_LOOPBACK ((uint32_t)0x7f000001) |
| #define RTE_IPV4_BROADCAST ((uint32_t)0xe0000000) |
| #define RTE_IPV4_ALLHOSTS_GROUP ((uint32_t)0xe0000001) |
| #define RTE_IPV4_ALLRTRS_GROUP ((uint32_t)0xe0000002) |
| #define RTE_IPV4_MAX_LOCAL_GROUP ((uint32_t)0xe00000ff) |
| #define RTE_IPV4_MIN_MCAST RTE_IPV4(224, 0, 0, 0) |
| #define RTE_IPV4_MAX_MCAST RTE_IPV4(239, 255, 255, 255) |
| #define RTE_IS_IPV4_MCAST | ( | x | ) |
check if IPv4 address is multicast
| struct __rte_aligned | ( | 2 | ) |
|
inlinestatic |
Get the length of an IPv4 header.
| ipv4_hdr | Pointer to the IPv4 header. |
|
inlinestatic |
Process the IPv4 checksum of an IPv4 header.
The checksum field must be set to 0 by the caller.
| ipv4_hdr | The pointer to the contiguous IPv4 header. |
|
inlinestatic |
Process the IPv4 checksum of an IPv4 header without any extensions.
The checksum field does NOT have to be set by the caller, the field is skipped by the calculation.
| ipv4_hdr | The pointer to the contiguous IPv4 header. |
|
inlinestatic |
Process the pseudo-header checksum of an IPv4 header.
The checksum field must be set to 0 by the caller.
Depending on the ol_flags, the pseudo-header checksum expected by the drivers is not the same. For instance, when TSO is enabled, the IP payload length must not be included in the packet.
When ol_flags is 0, it computes the standard pseudo-header checksum.
| ipv4_hdr | The pointer to the contiguous IPv4 header. |
| ol_flags | The ol_flags of the associated mbuf. |
|
inlinestatic |
Process the IPv4 UDP or TCP checksum.
The layer 4 checksum must be set to 0 in the L4 header by the caller.
| ipv4_hdr | The pointer to the contiguous IPv4 header. |
| l4_hdr | The pointer to the beginning of the L4 header. |
|
inlinestatic |
|
inlinestatic |
Validate the IPv4 UDP or TCP checksum.
In case of UDP, the caller must first check if udp_hdr->dgram_cksum is 0 (i.e. no checksum).
| ipv4_hdr | The pointer to the contiguous IPv4 header. |
| l4_hdr | The pointer to the beginning of the L4 header. |
|
inlinestatic |
Verify the IPv4 UDP/TCP checksum of a packet.
In case of UDP, the caller must first check if udp_hdr->dgram_cksum is 0 (i.e. no checksum).
| m | The pointer to the mbuf. |
| ipv4_hdr | The pointer to the contiguous IPv4 header. |
| l4_off | The offset in bytes to start L4 checksum. |