rte_rib6.h(3)
π rte_rib6.h π
okay bestie, welcome to the Library Functions Manual entry for rte_rib6.h β the RTE rib6 library, aka the level compressed tree implementation for IPv6 Longest Prefix Match. it's giving routing table royalty and we're gonna walk through every single bit of it together π«Ά
β¨ NAME β¨
rte_rib6.h β the header that holds the whole rib6 IPv6 longest-prefix-match situation π
β¨ SYNOPSIS β¨
bestie these are the includes, do not skip them:
#include <rte_memcpy.h>
#include <rte_common.h>
#include <rte_ip6.h>
πΈ Data Structures
struct rte_rib6_confβ the configuration struct, she's the blueprint, that's literally all we know about her here
πΈ Enumerations
enum { RTE_RIB6_GET_NXT_ALL, RTE_RIB6_GET_NXT_COVER }β the little flag squad for getting next prefixes β¨
πΈ Functions
look at this lineup, main character energy fr:
static void rte_rib6_copy_addr (uint8_t *dst, const uint8_t *src)
__rte_deprecated_msg('use direct struct assignment')
static int rte_rib6_is_equal (const uint8_t *ip1, const uint8_t *ip2)
__rte_deprecated_msg('use rte_ipv6_addr_eq')
static uint8_t get_msk_part (uint8_t depth, int byte) __rte_deprecated
struct rte_rib6_node * rte_rib6_lookup (struct rte_rib6 *rib, const
struct rte_ipv6_addr *ip)
struct rte_rib6_node * rte_rib6_lookup_parent (struct rte_rib6_node
*ent)
struct rte_rib6_node * rte_rib6_lookup_exact (struct rte_rib6 *rib,
const struct rte_ipv6_addr *ip, uint8_t depth)
struct rte_rib6_node * rte_rib6_get_nxt (struct rte_rib6 *rib, const
struct rte_ipv6_addr *ip, uint8_t depth, struct rte_rib6_node *last,
int flag)
void rte_rib6_remove (struct rte_rib6 *rib, const struct rte_ipv6_addr
*ip, uint8_t depth)
struct rte_rib6_node * rte_rib6_insert (struct rte_rib6 *rib, const
struct rte_ipv6_addr *ip, uint8_t depth)
int rte_rib6_get_ip (const struct rte_rib6_node *node, struct
rte_ipv6_addr *ip)
int rte_rib6_get_depth (const struct rte_rib6_node *node, uint8_t
*depth)
void * rte_rib6_get_ext (struct rte_rib6_node *node)
int rte_rib6_get_nh (const struct rte_rib6_node *node, uint64_t *nh)
int rte_rib6_set_nh (struct rte_rib6_node *node, uint64_t nh)
void rte_rib6_free (struct rte_rib6 *rib)
struct rte_rib6 * rte_rib6_create (const char *name, int socket_id,
const struct rte_rib6_conf *conf) __rte_malloc
__rte_dealloc(rte_rib6_free
struct rte_rib6 struct rte_rib6 * rte_rib6_find_existing (const char
*name)
β¨ Detailed Description β¨
so basically: RTE rib6 library. π¦
it's a Level compressed tree implementation for IPv6 Longest Prefix Match. she's structured, she's compressed, she's matching your longest prefixes. iconic behavior honestly.
Definition in file rte_rib6.h.
β¨ Enumeration Type Documentation β¨
π anonymous enum
rte_rib6_get_nxt() flags π
Enumerator
RTE_RIB6_GET_NXT_ALLβ flag to get all subroutes in a RIB treeRTE_RIB6_GET_NXT_COVERβ flag to get first matched subroutes in a RIB tree
Definition at line 30 of file rte_rib6.h.
β¨ Function Documentation β¨
π void rte_rib6_copy_addr (uint8_t * dst, const uint8_t * src) [inline], [static]
Copy IPv6 address from one location to another β¨
Parameters
dstβ pointer to the place to copysrcβ pointer from where to copy
Definition at line 64 of file rte_rib6.h.
β οΈ heads up bestie β this one is marked __rte_deprecated_msg('use direct struct assignment'), so do the struct assignment instead k?
π int rte_rib6_is_equal (const uint8_t * ip1, const uint8_t * ip2) [inline], [static]
Compare two IPv6 addresses πΈ
Parameters
ip1β pointer to the first ipv6 addressip2β pointer to the second ipv6 address
Returns
1 if equal, 0 otherwise
Definition at line 87 of file rte_rib6.h.
β οΈ also deprecated, marked__rte_deprecated_msg('use rte_ipv6_addr_eq')β userte_ipv6_addr_eqinstead, no cap.
π uint8_t get_msk_part (uint8_t depth, int byte) [inline], [static]
Get 8-bit part of 128-bit IPv6 mask π
Parameters
depthβ ipv6 prefix lengthbyteβ position of a 8-bit chunk in the 128-bit mask
Returns
8-bit chunk of the 128-bit IPv6 mask
Definition at line 113 of file rte_rib6.h.
β οΈ deprecated too β she's tagged __rte_deprecated.
π struct rte_rib6_node * rte_rib6_lookup (struct rte_rib6 * rib, const struct rte_ipv6_addr * ip)
Lookup an IP into the RIB structure π
Parameters
ribβ RIB object handleipβ IP to be looked up in the RIB
Returns
pointer to struct rte_rib6_node on success, NULL otherwise
π struct rte_rib6_node * rte_rib6_lookup_parent (struct rte_rib6_node * ent)
Lookup less specific route into the RIB structure π¦
Parameters
entβ Pointer tostruct rte_rib6_nodethat represents target route
Returns
pointer to struct rte_rib6_node that represents less specific route on success, NULL otherwise
π struct rte_rib6_node * rte_rib6_lookup_exact (struct rte_rib6 * rib, const struct rte_ipv6_addr * ip, uint8_t depth)
Provides exact mach lookup of the prefix into the RIB structure β yes, "mach", that's exactly how the original says it, we keep the lore π
Parameters
ribβ RIB object handleipβ net to be looked up in the RIBdepthβ prefix length
Returns
pointer to struct rte_rib6_node on success, NULL otherwise
π struct rte_rib6_node * rte_rib6_get_nxt (struct rte_rib6 * rib, const struct rte_ipv6_addr * ip, uint8_t depth, struct rte_rib6_node * last, int flag)
Retrieve next more specific prefix from the RIB that is covered by ip/depth supernet in an ascending order π₯
Parameters
ribβ RIB object handleipβ net address of supernet prefix that covers returned more specific prefixesdepthβ supernet prefix lengthlastβ pointer to the last returned prefix to get next prefix orNULLto get first more specific prefixflagβ-RTE_RIB6_GET_NXT_ALLget all prefixes from subtrie;-RTE_RIB6_GET_NXT_COVERget only first more specific prefix even if it have more specifics
Returns
pointer to the next more specific prefix, NULL if there is no prefixes left
π void rte_rib6_remove (struct rte_rib6 * rib, const struct rte_ipv6_addr * ip, uint8_t depth)
Remove prefix from the RIB βοΈ
Parameters
ribβ RIB object handleipβ net to be removed from the RIBdepthβ prefix length
π struct rte_rib6_node * rte_rib6_insert (struct rte_rib6 * rib, const struct rte_ipv6_addr * ip, uint8_t depth)
Insert prefix into the RIB π±
Parameters
ribβ RIB object handleipβ net to be inserted to the RIBdepthβ prefix length
Returns
pointer to new rte_rib6_node on success, NULL otherwise
π int rte_rib6_get_ip (const struct rte_rib6_node * node, struct rte_ipv6_addr * ip)
Get an ip from rte_rib6_node π«Ά
Parameters
nodeβ pointer to the rib6 nodeipβ pointer to the ipv6 to save
Returns
0 on success, -1 on failure with rte_errno indicating reason for failure.
π int rte_rib6_get_depth (const struct rte_rib6_node * node, uint8_t * depth)
Get a depth from rte_rib6_node π
Parameters
nodeβ pointer to the rib6 nodedepthβ pointer to the depth to save
Returns
0 on success, -1 on failure with rte_errno indicating reason for failure.
π void * rte_rib6_get_ext (struct rte_rib6_node * node)
Get ext field from the rte_rib6_node. It is caller responsibility to make sure there are necessary space for the ext field inside rib6 node. π (so like, you have to make sure the space is there, not us, okay bestie?)
Parameters
nodeβ pointer to therte_rib6_node
Returns
pointer to the ext
π int rte_rib6_get_nh (const struct rte_rib6_node * node, uint64_t * nh)
Get nexthop from the rte_rib6_node π―
Parameters
nodeβ pointer to the rib6 nodenhβ pointer to the nexthop to save
Returns
0 on success, -1 on failure, with rte_errno indicating reason for failure.
π int rte_rib6_set_nh (struct rte_rib6_node * node, uint64_t nh)
Set nexthop into the rte_rib6_node β¨
Parameters
nodeβ pointer to the rib6 nodenhβ nexthop value to set to the rib6 node
Returns
0 on success, -1 on failure, with rte_errno indicating reason for failure.
π void rte_rib6_free (struct rte_rib6 * rib)
Free an RIB object. bye bestie, thanks for the memories π«
Parameters
ribβ RIB object handle created withrte_rib6_create(). IfribisNULL, no operation is performed.
π struct rte_rib6 * rte_rib6_create (const char * name, int socket_id, const struct rte_rib6_conf * conf)
Create RIB π
Parameters
nameβ RIB namesocket_idβ NUMA socket ID for RIB table memory allocationconfβ Structure containing the configuration
Returns
Pointer to RIB object on success, NULL otherwise with rte_errno indicating reason for failure.
(she carries the __rte_malloc and __rte_dealloc(rte_rib6_free attributes, so like, the dealloc partner is rte_rib6_free, no cap)
π struct rte_rib6 struct rte_rib6 * rte_rib6_find_existing (const char * name)
Find an existing RIB object and return a pointer to it. π
Parameters
nameβ Name of the rib object as passed torte_rib6_create()
Returns
Pointer to RIB object on success, NULL otherwise with rte_errno indicating reason for failure.
β¨ Author β¨
Generated automatically by Doxygen for DPDK from the source code. π€ (not me, she wrote herself, and honestly? slay)
and that's the whole page bestie!! π the footer said DPDK, Version 25.11.3, and the page's manual name is rte_rib6.h under the Library Functions Manual β so that's a DPDK Version 25.11.3 rte_rib6.h(3) situation, mwah, go read some IPv6 prefixes, you've got this ππ¦π
π¦ where this page comes from
- ubuntu resolute: dpdk-doc 25.11.3-0ubuntu0.26.04.1 Β· BSD-3-Clause
- ubuntu stonking: dpdk-doc 25.11.3-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms