rte_ip6.h(3)

๐Ÿ’– rte_ip6.h(3) ๐Ÿ’–

okay bestie, welcome to rte_ip6.h(3) from the Library Functions Manual โœจ this is THE page for all the IPv6-related defines, and we're gonna go through every single one of them together, no skipping, no skimming, periodt ๐Ÿ’…


๐ŸŒธ NAME ๐ŸŒธ

rte_ip6.h โ€” that's it, that's the name, short and iconic ๐Ÿ‘‘


โœจ SYNOPSIS โœจ

first things first, all the headers you're gonna pull in, copy-paste these babies exactly:

#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>

๐ŸŽ€ 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)

๐Ÿ‘‘ DETAILED DESCRIPTION ๐Ÿ‘‘

IPv6-related defines โ€” that's the whole serve, and it ate ๐Ÿฝ๏ธโœจ

Definition in file rte_ip6.h.


๐ŸŽ€ MACRO DEFINITION DOCUMENTATION ๐ŸŽ€

๐Ÿ’ซ #define RTE_IPV6_ADDR_SIZE 16

Maximum IPv6 address size in bytes. sixteen whole bytes bestie, count 'em ๐Ÿงฎ

Definition at line 43 of file rte_ip6.h.

๐Ÿ’ซ #define RTE_IPV6_MAX_DEPTH (RTE_IPV6_ADDR_SIZE * CHAR_BIT)

Maximum IPv6 address size in bits. so like, the size, but in bits, math girlies rise ๐Ÿ’…

Definition at line 48 of file rte_ip6.h.

๐Ÿ’ซ #define RTE_IPV6_U16_SPLIT( x)

Value:

(uint8_t)((uint16_t)(x) & UINT16_C(0xff)), \
(uint8_t)(((uint16_t)(x) >> 8) & UINT16_C(0xff))

Split a literal 16 bit unsigned integer into two bytes separated by a comma according to the platform endianness. it literally takes your lil number and goes "here's two bytes, comma-separated, and also I respect whatever endianness your platform is on" ๐Ÿซถ

Parameters

  • x โ€” A uint16_t literal value.

Returns

  • Two uint8_t literals separated by a coma.
ngl the original says "coma" not "comma", and I am respectfully preserving that typo because the rules are the rules ๐Ÿ˜ญ

Definition at line 162 of file rte_ip6.h.

๐Ÿ’ซ #define RTE_IPV6( a, b, c, d, e, f, g, h)

Value:

{{ \
    RTE_IPV6_U16_SPLIT(a), \
    RTE_IPV6_U16_SPLIT(b), \
    RTE_IPV6_U16_SPLIT(c), \
    RTE_IPV6_U16_SPLIT(d), \
    RTE_IPV6_U16_SPLIT(e), \
    RTE_IPV6_U16_SPLIT(f), \
    RTE_IPV6_U16_SPLIT(g), \
    RTE_IPV6_U16_SPLIT(h) \
}}

Shorthand to define a literal IPv6 address based on 16bit unsigned integers. the way that you just hand it eight numbers and it hands you back a whole address โœจ iconic behavior

Parameters

  • a,b,c,d,e,f,g,h โ€” uint8_t literals that will be passed to RTE_IPV6_U16_SPLIT(x).

Returns

  • A literal rte_ipv6_addr value suitable for static initialization.

Definition at line 179 of file rte_ip6.h.

๐Ÿ’ซ #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). these two are a package deal, you don't take one without the other ๐Ÿ’ž

Definition at line 195 of file rte_ip6.h.

๐Ÿ’ซ #define RTE_IPV6_ADDR_SPLIT( ip)

Value:

((uint8_t)(ip)->a[0]), \
((uint8_t)(ip)->a[1]), \
((uint8_t)(ip)->a[2]), \
((uint8_t)(ip)->a[3]), \
((uint8_t)(ip)->a[4]), \
((uint8_t)(ip)->a[5]), \
((uint8_t)(ip)->a[6]), \
((uint8_t)(ip)->a[7]), \
((uint8_t)(ip)->a[8]), \
((uint8_t)(ip)->a[9]), \
((uint8_t)(ip)->a[10]), \
((uint8_t)(ip)->a[11]), \
((uint8_t)(ip)->a[12]), \
((uint8_t)(ip)->a[13]), \
((uint8_t)(ip)->a[14]), \
((uint8_t)(ip)->a[15])

For use with RTE_IPV6_ADDR_FMT. E.g.:

printf(RTE_IPV6_ADDR_FMT "\n", RTE_IPV6_ADDR_SPLIT(&ip));

Parameters

  • ip โ€” A struct rte_ipv6_addr pointer.

Returns

  • A set of 16 uint8_t values separated by comas for use in printf().

Definition at line 210 of file rte_ip6.h.

๐Ÿ’ซ #define RTE_IPV6_MASK_FULL RTE_IPV6(0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff)

Full IPv6 mask. NB: this is not a valid/routable IPv6 address. ๐Ÿšจ read that again bestie, it's a mask, not somewhere you can actually send packets, do not put this on a postcard

Definition at line 229 of file rte_ip6.h.

๐Ÿ’ซ #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. all zeros, the void, the blank canvas ๐ŸŒŒ

Definition at line 233 of file rte_ip6.h.

๐Ÿ’ซ #define RTE_IPV6_ADDR_LOOPBACK RTE_IPV6(0, 0, 0, 0, 0, 0, 0, 1)

Loopback IPv6 address as defined in RFC 4291, section 2.5.3. it's the ::1 of the situation, it's giving "me talking to me" ๐Ÿชž

Definition at line 251 of file rte_ip6.h.

๐Ÿ’ซ #define RTE_IPV6_ADDR_ALLNODES_IFACE_LOCAL RTE_IPV6(0xff01, 0, 0, 0, 0, 0, 0, 1)

Interface-local all-nodes multicast address as defined in RFC 4291, section 2.7.1. everybody on this interface, get in the group chat ๐Ÿ“ฃ

Definition at line 383 of file rte_ip6.h.

Link-local all-nodes multicast address as defined in RFC 4291, section 2.7.1. same energy but scoped to the link, the whole neighborhood is here ๐Ÿ’ซ

Definition at line 385 of file rte_ip6.h.

๐Ÿ’ซ #define RTE_IPV6_ADDR_ALLROUTERS_IFACE_LOCAL RTE_IPV6(0xff01, 0, 0, 0, 0, 0, 0, 2)

Interface-local all-routers multicast address as defined in RFC 4291, section 2.7.1. this one's for the routers only, sorry, it's a VIP list ๐ŸŽŸ๏ธ

Definition at line 387 of file rte_ip6.h.

Link-local all-routers multicast address as defined in RFC 4291, section 2.7.1.

Definition at line 389 of file rte_ip6.h.

๐Ÿ’ซ #define RTE_IPV6_ADDR_ALLROUTERS_SITE_LOCAL RTE_IPV6(0xff05, 0, 0, 0, 0, 0, 0, 2)

Site-local all-routers multicast address as defined in RFC 4291, section 2.7.1. routers at the site level, the regional managers of the multicast world ๐Ÿข

Definition at line 391 of file rte_ip6.h.

๐Ÿ’ซ #define RTE_IPV6_MIN_MTU 1280

Minimum MTU for IPv6, see RFC 8200. 1280 is the floor, you do not go below 1280, that is simply not the vibe ๐Ÿšซ

Definition at line 542 of file rte_ip6.h.

๐Ÿ’ซ #define RTE_IPV6_EHDR_MF_SHIFT 0

IPv6 fragment extension header. the fragment header's lil shift, here to keep all your fragments in formation ๐Ÿงฉ

Definition at line 746 of file rte_ip6.h.


๐ŸŒˆ ENUMERATION TYPE DOCUMENTATION ๐ŸŒˆ

๐Ÿ’œ enum rte_ipv6_mc_scope

IPv6 multicast scope values as defined in RFC 4291, section 2.7. each one is a different radius of "who's allowed in the group chat", and we're gonna meet every single member of the cast ๐Ÿ’…

Enumerator

  • RTE_IPV6_MC_SCOPE_NONE โ€” Invalid multicast scope. not a vibe, don't use it.
  • RTE_IPV6_MC_SCOPE_IFACELOCAL โ€” Interface-local multicast scope.
  • RTE_IPV6_MC_SCOPE_LINKLOCAL โ€” Link-local multicast scope.
  • RTE_IPV6_MC_SCOPE_SITELOCAL โ€” Site-local multicast scope.
  • RTE_IPV6_MC_SCOPE_ORGLOCAL โ€” Organizational-local multicast scope.
  • RTE_IPV6_MC_SCOPE_GLOBAL โ€” Global multicast scope. the whole planet, main character energy fr fr ๐ŸŒ

Definition at line 348 of file rte_ip6.h.


okay that's the macros and the enum, but we are NOT done bestie, there's more page and more functions to meet ๐Ÿ’–


๐Ÿ’ซ Function Documentation ๐Ÿ’ซ

๐ŸŒธ rte_ipv6_addr_eq

bool rte_ipv6_addr_eq (const struct rte_ipv6_addr * a, const struct rte_ipv6_addr * b) [inline], [static]

Okay bestie, this is the "are these two the same" check. It asks: are these two IPv6 Addresses equal?

Parameters

  • a โ€” the first address ๐Ÿ’–
  • b โ€” the second address ๐Ÿ’–

Returns

true if both addresses are identical. Periodt.

Definition at line 68 of file rte_ip6.h.


๐ŸŽ€ rte_ipv6_addr_mask

void rte_ipv6_addr_mask (struct rte_ipv6_addr * ip, uint8_t depth) [inline], [static]

Mask an IPv6 address using the specified depth โœจ

So like, leave untouched one bit per unit in the depth variable and set the rest to 0. The way it just zeroes the leftovers? iconic.

Parameters

  • ip โ€” the address to mask ๐Ÿซถ
  • depth โ€” all bits starting from this bit number will be set to zero

Definition at line 84 of file rte_ip6.h.


๐Ÿฆ‹ rte_ipv6_addr_eq_prefix

bool rte_ipv6_addr_eq_prefix (const struct rte_ipv6_addr * a, const struct rte_ipv6_addr * b, uint8_t depth) [inline], [static]

Check if two IPv6 addresses belong to the same network prefix ๐Ÿ‘‘ same neighborhood, same vibe.

Parameters

  • a โ€” the first address or network
  • b โ€” the second address or network
  • depth โ€” the network prefix length

Returns

true if the first depth bits of both addresses are identical ๐ŸŒˆ

Definition at line 109 of file rte_ip6.h.


๐Ÿ’… rte_ipv6_mask_depth

uint8_t rte_ipv6_mask_depth (const struct rte_ipv6_addr * mask) [inline], [static]

Get the depth of a given IPv6 address mask. Counting the ones, fr fr.

Parameters

  • mask โ€” the address mask

Returns

The number of consecutive bits set to 1 starting from the beginning of the mask โญ

Definition at line 132 of file rte_ip6.h.


๐Ÿ™ˆ rte_ipv6_addr_is_unspec

bool rte_ipv6_addr_is_unspec (const struct rte_ipv6_addr * ip) [inline], [static]

Check if an IPv6 address is unspecified as defined in RFC 4291, section 2.5.2.

Parameters

  • ip โ€” the address to check

Returns

true if the address is the unspecified address (all zeroes). literally all zeroes, not a single bit of main character energy ๐Ÿ’€

Definition at line 244 of file rte_ip6.h.


๐Ÿ“ rte_ipv6_addr_is_loopback

bool rte_ipv6_addr_is_loopback (const struct rte_ipv6_addr * ip) [inline], [static]

Check if an IPv6 address is the loopback address as defined in RFC 4291, section 2.5.3.

Parameters

  • ip โ€” the address to check

Returns

true if the address is the loopback address (all zeroes except the last bit) ๐ŸŒ€

Definition at line 263 of file rte_ip6.h.


๐ŸŒธ rte_ipv6_addr_is_linklocal

bool rte_ipv6_addr_is_linklocal (const struct rte_ipv6_addr * ip) [inline], [static]

Check if an IPv6 address is link-local as defined in RFC 4291, section 2.5.6.

Parameters

  • ip โ€” the address to check

Returns

true if the address is a link-local address ๐Ÿซถ

Definition at line 278 of file rte_ip6.h.


โœจ rte_ipv6_addr_is_sitelocal

bool rte_ipv6_addr_is_sitelocal (const struct rte_ipv6_addr * ip) [inline], [static]

Check if an IPv6 address is site-local as defined in RFC 4291, section 2.5.7.

Parameters

  • ip โ€” the address to check

Returns

true if the address is a site-local address ๐Ÿ’œ

Definition at line 292 of file rte_ip6.h.


๐Ÿงš rte_ipv6_addr_is_v4compat

bool rte_ipv6_addr_is_v4compat (const struct rte_ipv6_addr * ip) [inline], [static]

Check if an IPv6 address is an IPv4-compatible address as defined in RFC 4291, section 2.5.5.1.

Parameters

  • ip โ€” the address to check

Returns

true if the address is an IPv4-compatible address ๐ŸŒˆ

Definition at line 307 of file rte_ip6.h.


๐ŸŽ€ rte_ipv6_addr_is_v4mapped

bool rte_ipv6_addr_is_v4mapped (const struct rte_ipv6_addr * ip) [inline], [static]

Check if an IPv6 address is an IPv4-mapped address as defined in RFC 4291, section 2.5.5.2.

Parameters

  • ip โ€” the address to check

Returns

true if the address is an IPv4-mapped address ๐Ÿ’–

Definition at line 325 of file rte_ip6.h.


๐Ÿฆ‹ rte_ipv6_addr_is_mcast

bool rte_ipv6_addr_is_mcast (const struct rte_ipv6_addr * ip) [inline], [static]

Check if an IPv6 address is multicast as defined in RFC 4291, section 2.7.

Parameters

  • ip โ€” the address to check

Returns

true if the address is multicast ๐Ÿ“ฃ

Definition at line 340 of file rte_ip6.h.


๐Ÿ’ซ rte_ipv6_mc_scope

enum rte_ipv6_mc_scope rte_ipv6_mc_scope (const struct rte_ipv6_addr * ip) [inline], [static]

Extract the IPv6 multicast scope value as defined in RFC 4291, section 2.7. Get the scope, bestie ๐Ÿ”ญ

Parameters

  • ip โ€” the address from which to get the multicast scope

Returns

The multicast scope of the address, or RTE_IPV6_MC_SCOPE_NONE if the address is not multicast. no scope, no drama ๐Ÿ™…

Definition at line 373 of file rte_ip6.h.


๐Ÿ‘‘ rte_ipv6_solnode_from_addr

void rte_ipv6_solnode_from_addr (struct rte_ipv6_addr * sol, const struct rte_ipv6_addr * ip) [inline], [static]

Convert a unicast or anycast IPv6 address to a solicited-node multicast address as defined in RFC 4291, section 2.7.1. glow-up but for addresses โœจ

Parameters

  • sol โ€” the IPv6 solicited-node multicast address to generate
  • ip โ€” a unicast or anycast address

Definition at line 434 of file rte_ip6.h.


๐ŸŒˆ rte_ether_mcast_from_ipv6

void rte_ether_mcast_from_ipv6 (struct rte_ether_addr * mac, const struct rte_ipv6_addr * ip) [inline], [static]

Generate a multicast Ethernet address from a multicast IPv6 address as defined in RFC 2464, section 7.

Parameters

  • mac โ€” the multicast Ethernet address to generate
  • ip โ€” a multicast IPv6 address

Definition at line 456 of file rte_ip6.h.


๐Ÿ’œ struct __rte_aligned(2)

IPv6 Header

The fields, one by one, no skipping ๐Ÿซถ:

  • < 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

Definition at line 456 of file rte_ip6.h.


โญ rte_ipv6_check_version

int rte_ipv6_check_version (const struct rte_ipv6_hdr * ip) [inline], [static]

Check that the IPv6 header version field is valid according to RFC 8200 section 3. vibe check on the version field ๐Ÿ•ต๏ธ

Parameters

  • ip โ€” the IPv6 header

Returns

0 if the version field is valid. -EINVAL otherwise. (the audacity ๐Ÿ˜ญ)

Definition at line 502 of file rte_ip6.h.


๐ŸŽ€ rte_ipv6_phdr_cksum

uint16_t rte_ipv6_phdr_cksum (const struct rte_ipv6_hdr * ipv6_hdr, uint64_t ol_flags) [inline], [static]

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. iykyk ๐Ÿซถ

When ol_flags is 0, it computes the standard pseudo-header checksum.

Parameters

  • ipv6_hdr โ€” the pointer to the contiguous IPv6 header
  • ol_flags โ€” the ol_flags of the associated mbuf

Returns

The non-complemented checksum to set in the L4 header. note: non-complemented, don't mix that up bestie ๐Ÿ’…

Definition at line 561 of file rte_ip6.h.


๐Ÿ”ฅ rte_ipv6_udptcp_cksum

uint16_t rte_ipv6_udptcp_cksum (const struct rte_ipv6_hdr * ipv6_hdr, const void * l4_hdr) [inline], [static]

Process the IPv6 UDP or TCP checksum.

The IPv6 header must not be followed by extension headers. Also, the layer 4 checksum must be set to 0 in the L4 header by the caller. not us, you ๐Ÿ™ˆ

Parameters

  • ipv6_hdr โ€” the pointer to the contiguous IPv6 header
  • l4_hdr โ€” the pointer to the beginning of the L4 header

Returns

The complemented checksum to set in the L4 header. (yes, complemented this time, we said what we said ๐Ÿ’…)

Definition at line 615 of file rte_ip6.h.


๐ŸŒธ rte_ipv6_udptcp_cksum_mbuf

uint16_t rte_ipv6_udptcp_cksum_mbuf (const struct rte_mbuf * m, const struct rte_ipv6_hdr * ipv6_hdr, uint16_t l4_off) [inline], [static]

Process the IPv6 UDP or TCP checksum of a packet. same energy, but this one's riding an mbuf ๐Ÿฆ‹

The IPv6 header must not be followed by extension headers. And again: the layer 4 checksum must be set to 0 in the L4 header by the caller. fr fr.

Parameters

  • 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

Returns

The complemented checksum to set in the L4 header โœจ

Definition at line 672 of file rte_ip6.h.


๐Ÿงš rte_ipv6_udptcp_cksum_verify

int rte_ipv6_udptcp_cksum_verify (const struct rte_ipv6_hdr * ipv6_hdr, const void * l4_hdr) [inline], [static]

Validate the IPv6 UDP or TCP checksum. the receipts check ๐Ÿงพ

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. do not skip this part bestie, it's giving important ๐Ÿ˜ญ

Parameters

  • ipv6_hdr โ€” the pointer to the contiguous IPv6 header
  • l4_hdr โ€” the pointer to the beginning of the L4 header

Returns

Return 0 if the checksum is correct, else -1.

Definition at line 705 of file rte_ip6.h.


๐Ÿ’œ rte_ipv6_udptcp_cksum_mbuf_verify

int rte_ipv6_udptcp_cksum_mbuf_verify (const struct rte_mbuf * m, const struct rte_ipv6_hdr * ipv6_hdr, uint16_t l4_off) [inline], [static]

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. same warning, same stakes ๐Ÿซถ

Parameters

  • 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

Returns

Return 0 if the checksum is correct, else -1 โญ

Definition at line 733 of file rte_ip6.h.


๐ŸŒŸ rte_ipv6_get_next_ext

int rte_ipv6_get_next_ext (const uint8_t * p, int proto, size_t * ext_len) [inline], [static]

Parse next IPv6 header extension ๐Ÿ”

This function checks if proto number is an IPv6 extension and parses its data if so, providing information on next header and extension length. it's giving follow-the-thread ๐Ÿงต

Parameters

  • 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

Returns

next protocol number if proto is an IPv6 extension, -EINVAL otherwise ๐Ÿ‘‘

Definition at line 787 of file rte_ip6.h.


๐ŸŽ€ Author ๐ŸŽ€

Generated automatically by Doxygen for DPDK from the source code. (not me writing this by hand at 2am or anything ๐Ÿ™ˆ)


And that's a wrap on rte_ip6.h(3) bestie!! ๐Ÿ’–โœจ This one's from DPDK, version 25.11.3 โ€” go forth and checksum responsibly ๐Ÿฆ‹๐Ÿ’…๐ŸŒˆ

๐Ÿ“ฆ where this page comes from