|
DPDK 25.11.0
|
#include <stdint.h>#include <string.h>#include <sys/socket.h>#include <sys/types.h>#include <netinet/in.h>#include <arpa/inet.h>#include <netinet/ip6.h>#include <rte_byteorder.h>#include <rte_cksum.h>#include <rte_ether.h>#include <rte_mbuf.h>Go to the source code of this file.
Data Structures | |
| struct | rte_ipv6_addr |
Macros | |
| #define | RTE_IPV6_ADDR_SIZE 16 |
| #define | RTE_IPV6_MAX_DEPTH (RTE_IPV6_ADDR_SIZE * CHAR_BIT) |
| #define | RTE_IPV6_U16_SPLIT(x) |
| #define | RTE_IPV6(a, b, c, d, e, f, g, h) |
| #define | RTE_IPV6_ADDR_FMT "%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x" |
| #define | RTE_IPV6_ADDR_SPLIT(ip) |
| #define | RTE_IPV6_MASK_FULL RTE_IPV6(0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff) |
| #define | RTE_IPV6_ADDR_UNSPEC RTE_IPV6(0, 0, 0, 0, 0, 0, 0, 0) |
| #define | RTE_IPV6_ADDR_LOOPBACK RTE_IPV6(0, 0, 0, 0, 0, 0, 0, 1) |
| #define | RTE_IPV6_MIN_MTU 1280 |
| #define | RTE_IPV6_EHDR_MF_SHIFT 0 |
Well known multicast addresses | |
| #define | RTE_IPV6_ADDR_ALLNODES_IFACE_LOCAL RTE_IPV6(0xff01, 0, 0, 0, 0, 0, 0, 1) |
| #define | RTE_IPV6_ADDR_ALLNODES_LINK_LOCAL RTE_IPV6(0xff02, 0, 0, 0, 0, 0, 0, 1) |
| #define | RTE_IPV6_ADDR_ALLROUTERS_IFACE_LOCAL RTE_IPV6(0xff01, 0, 0, 0, 0, 0, 0, 2) |
| #define | RTE_IPV6_ADDR_ALLROUTERS_LINK_LOCAL RTE_IPV6(0xff02, 0, 0, 0, 0, 0, 0, 2) |
| #define | RTE_IPV6_ADDR_ALLROUTERS_SITE_LOCAL RTE_IPV6(0xff05, 0, 0, 0, 0, 0, 0, 2) |
Enumerations | |
| enum | rte_ipv6_mc_scope { RTE_IPV6_MC_SCOPE_NONE = 0x00 , RTE_IPV6_MC_SCOPE_IFACELOCAL = 0x01 , RTE_IPV6_MC_SCOPE_LINKLOCAL = 0x02 , RTE_IPV6_MC_SCOPE_SITELOCAL = 0x05 , RTE_IPV6_MC_SCOPE_ORGLOCAL = 0x08 , RTE_IPV6_MC_SCOPE_GLOBAL = 0x0e } |
Functions | |
| static bool | rte_ipv6_addr_eq (const struct rte_ipv6_addr *a, const struct rte_ipv6_addr *b) |
| static void | rte_ipv6_addr_mask (struct rte_ipv6_addr *ip, uint8_t depth) |
| static bool | rte_ipv6_addr_eq_prefix (const struct rte_ipv6_addr *a, const struct rte_ipv6_addr *b, uint8_t depth) |
| static uint8_t | rte_ipv6_mask_depth (const struct rte_ipv6_addr *mask) |
| static bool | rte_ipv6_addr_is_unspec (const struct rte_ipv6_addr *ip) |
| static bool | rte_ipv6_addr_is_loopback (const struct rte_ipv6_addr *ip) |
| static bool | rte_ipv6_addr_is_linklocal (const struct rte_ipv6_addr *ip) |
| static bool | rte_ipv6_addr_is_sitelocal (const struct rte_ipv6_addr *ip) |
| static bool | rte_ipv6_addr_is_v4compat (const struct rte_ipv6_addr *ip) |
| static bool | rte_ipv6_addr_is_v4mapped (const struct rte_ipv6_addr *ip) |
| static bool | rte_ipv6_addr_is_mcast (const struct rte_ipv6_addr *ip) |
| static enum rte_ipv6_mc_scope | rte_ipv6_mc_scope (const struct rte_ipv6_addr *ip) |
| static void | rte_ipv6_solnode_from_addr (struct rte_ipv6_addr *sol, const struct rte_ipv6_addr *ip) |
| static void | rte_ether_mcast_from_ipv6 (struct rte_ether_addr *mac, const struct rte_ipv6_addr *ip) |
| struct | __rte_aligned (2) __rte_packed_begin rte_ipv6_hdr |
| static int | rte_ipv6_check_version (const struct rte_ipv6_hdr *ip) |
| static uint16_t | rte_ipv6_phdr_cksum (const struct rte_ipv6_hdr *ipv6_hdr, uint64_t ol_flags) |
| static uint16_t | rte_ipv6_udptcp_cksum (const struct rte_ipv6_hdr *ipv6_hdr, const void *l4_hdr) |
| static uint16_t | rte_ipv6_udptcp_cksum_mbuf (const struct rte_mbuf *m, const struct rte_ipv6_hdr *ipv6_hdr, uint16_t l4_off) |
| static int | rte_ipv6_udptcp_cksum_verify (const struct rte_ipv6_hdr *ipv6_hdr, const void *l4_hdr) |
| static int | rte_ipv6_udptcp_cksum_mbuf_verify (const struct rte_mbuf *m, const struct rte_ipv6_hdr *ipv6_hdr, uint16_t l4_off) |
| static int | rte_ipv6_get_next_ext (const uint8_t *p, int proto, size_t *ext_len) |
IPv6-related defines
Definition in file rte_ip6.h.
| #define RTE_IPV6_ADDR_SIZE 16 |
| #define RTE_IPV6_MAX_DEPTH (RTE_IPV6_ADDR_SIZE * CHAR_BIT) |
| #define RTE_IPV6_U16_SPLIT | ( | x | ) |
Split a literal 16 bit unsigned integer into two bytes separated by a comma according to the platform endianness.
| x | A uint16_t literal value. |
uint8_t literals separated by a coma. | #define RTE_IPV6 | ( | a, | |
| b, | |||
| c, | |||
| d, | |||
| e, | |||
| f, | |||
| g, | |||
| h ) |
Shorthand to define a literal IPv6 address based on 16bit unsigned integers.
| a,b,c,d,e,f,g,h | uint8_t literals that will be passed to RTE_IPV6_U16_SPLIT(x). |
| #define RTE_IPV6_ADDR_FMT "%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x" |
printf() format element for rte_ipv6_addr structures. To be used along with RTE_IPV6_ADDR_SPLIT(ip).
| #define RTE_IPV6_ADDR_SPLIT | ( | ip | ) |
For use with RTE_IPV6_ADDR_FMT. E.g.:
| ip | A struct rte_ipv6_addr pointer. |
uint8_t values separated by comas for use in printf(). | #define RTE_IPV6_MASK_FULL RTE_IPV6(0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff) |
| #define RTE_IPV6_ADDR_UNSPEC RTE_IPV6(0, 0, 0, 0, 0, 0, 0, 0) |
Unspecified IPv6 address as defined in RFC 4291, section 2.5.2.
| #define RTE_IPV6_ADDR_LOOPBACK RTE_IPV6(0, 0, 0, 0, 0, 0, 0, 1) |
| #define RTE_IPV6_ADDR_ALLNODES_IFACE_LOCAL RTE_IPV6(0xff01, 0, 0, 0, 0, 0, 0, 1) |
| #define RTE_IPV6_ADDR_ALLNODES_LINK_LOCAL RTE_IPV6(0xff02, 0, 0, 0, 0, 0, 0, 1) |
| #define RTE_IPV6_ADDR_ALLROUTERS_IFACE_LOCAL RTE_IPV6(0xff01, 0, 0, 0, 0, 0, 0, 2) |
| #define RTE_IPV6_ADDR_ALLROUTERS_LINK_LOCAL RTE_IPV6(0xff02, 0, 0, 0, 0, 0, 0, 2) |
| #define RTE_IPV6_ADDR_ALLROUTERS_SITE_LOCAL RTE_IPV6(0xff05, 0, 0, 0, 0, 0, 0, 2) |
| #define RTE_IPV6_MIN_MTU 1280 |
| #define RTE_IPV6_EHDR_MF_SHIFT 0 |
| enum rte_ipv6_mc_scope |
IPv6 multicast scope values as defined in RFC 4291, section 2.7.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Check if an IPv6 address is unspecified as defined in RFC 4291, section 2.5.2.
| ip | The address to check. |
true if the address is the unspecified address (all zeroes).
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Extract the IPv6 multicast scope value as defined in RFC 4291, section 2.7.
| ip | The address from which to get the multicast scope. |
|
inlinestatic |
|
inlinestatic |
| struct __rte_aligned | ( | 2 | ) |
IPv6 Header
IPv6 Routing Extension Header
< IP version, traffic class & flow label.
< Flow label
< ECN
< Differentiated services
< Version
< IP payload size, including ext. headers
< Protocol, next header.
< Hop limits.
< IP address of source host.
< IP address of destination host(s).
< Protocol, next header.
< Header length.
< Extension header type.
< Valid segments number.
< Packet control data per type.
< The last_entry field of SRH
< Packet flag.
< Packet tag.
< Next header type
< Reserved
< All fragmentation data
< Packet ID
|
inlinestatic |
|
inlinestatic |
Process the pseudo-header checksum of an IPv6 header.
Depending on the ol_flags, the pseudo-header checksum expected by the drivers is not the same. For instance, when TSO is enabled, the IPv6 payload length must not be included in the packet.
When ol_flags is 0, it computes the standard pseudo-header checksum.
| ipv6_hdr | The pointer to the contiguous IPv6 header. |
| ol_flags | The ol_flags of the associated mbuf. |
|
inlinestatic |
Process the IPv6 UDP or TCP checksum.
The IPv6 header must not be followed by extension headers. The layer 4 checksum must be set to 0 in the L4 header by the caller.
| ipv6_hdr | The pointer to the contiguous IPv6 header. |
| l4_hdr | The pointer to the beginning of the L4 header. |
|
inlinestatic |
Process the IPv6 UDP or TCP checksum of a packet.
The IPv6 header must not be followed by extension headers. The layer 4 checksum must be set to 0 in the L4 header by the caller.
| m | The pointer to the mbuf. |
| ipv6_hdr | The pointer to the contiguous IPv6 header. |
| l4_off | The offset in bytes to start L4 checksum. |
|
inlinestatic |
Validate the IPv6 UDP or TCP checksum.
In case of UDP, the caller must first check if udp_hdr->dgram_cksum is 0: this is either invalid or means no checksum in some situations. See 8.1 (Upper-Layer Checksums) in RFC 8200.
| ipv6_hdr | The pointer to the contiguous IPv6 header. |
| l4_hdr | The pointer to the beginning of the L4 header. |
|
inlinestatic |
Validate the IPv6 UDP or TCP checksum of a packet.
In case of UDP, the caller must first check if udp_hdr->dgram_cksum is 0: this is either invalid or means no checksum in some situations. See 8.1 (Upper-Layer Checksums) in RFC 8200.
| m | The pointer to the mbuf. |
| ipv6_hdr | The pointer to the contiguous IPv6 header. |
| l4_off | The offset in bytes to start L4 checksum. |
|
inlinestatic |
Parse next IPv6 header extension
This function checks if proto number is an IPv6 extensions and parses its data if so, providing information on next header and extension length.
| p | Pointer to an extension raw data. |
| proto | Protocol number extracted from the "next header" field from the IPv6 header or the previous extension. |
| ext_len | Extension data length. |