rte_rib6.h(3)

πŸ“¦ version 26.03, in nixos 26.05, nixpkgs unstable

πŸ¦‹ rte_rib6.h β€” Library Functions Manual πŸ’…

okay bestie, so this is the <rte_rib6.h> page from the DPDK docs, and before you ask: yes, it's the RTE rib6 library, yes it's a whole level-compressed-tree situation, and yes it ate. Let's get into it 🫢


✨ NAME ✨

rte_rib6.h β€” that's the whole name, no cap. It's the header you're looking at and everything below is what lives inside it πŸ’–


✨ SYNOPSIS ✨

So first things first, you gotta pull in your includes, periodt:

#include <rte_memcpy.h>
#include <rte_common.h>
#include <rte_ip6.h>

πŸŽ€ Data Structures

  • struct rte_rib6_conf β€” the config struct, she's giving necessary-evil energy πŸ’…

πŸŽ€ Enumerations

enum { RTE_RIB6_GET_NXT_ALL, RTE_RIB6_GET_NXT_COVER }

πŸŽ€ Functions

okay this is the list, and I need you to read it because there's some deprecated stuff in here and I don't want you getting attached to the wrong functions 😭

  • static void rte_rib6_copy_addr (uint8_t *dst, const uint8_t *src) β€” __rte_deprecated_msg('use direct struct assignment') β€” yeah she's deprecated, do direct struct assignment instead, I'm serious πŸ™ˆ
  • static int rte_rib6_is_equal (const uint8_t *ip1, const uint8_t *ip2) β€” __rte_deprecated_msg('use rte_ipv6_addr_eq') β€” also deprecated, use rte_ipv6_addr_eq bestie, the note literally says so πŸ’€
  • static uint8_t get_msk_part (uint8_t depth, int byte) β€” __rte_deprecated β€” yep, deprecated too, no note attached, just vibes
  • struct rte_rib6_node * rte_rib6_lookup (struct rte_rib6 *rib, const struct rte_ipv6_addr *ip) β€” the actual lookup, she's alive and well ✨
  • struct rte_rib6_node * rte_rib6_lookup_parent (struct rte_rib6_node *ent) β€” go find the parent, we love a nepotism moment πŸ‘‘
  • struct rte_rib6_node * rte_rib6_lookup_exact (struct rte_rib6 *rib, const struct rte_ipv6_addr *ip, uint8_t depth) β€” exact match only, she's picky πŸŽ€
  • 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) β€” next more specific prefix, ascending order, main character behavior
  • void rte_rib6_remove (struct rte_rib6 *rib, const struct rte_ipv6_addr *ip, uint8_t depth) β€” bye bye prefix πŸ¦‹
  • struct rte_rib6_node * rte_rib6_insert (struct rte_rib6 *rib, const struct rte_ipv6_addr *ip, uint8_t depth) β€” come on in, prefix 🌸
  • int rte_rib6_get_ip (const struct rte_rib6_node *node, struct rte_ipv6_addr *ip) β€” grab the ip off a node
  • int rte_rib6_get_depth (const struct rte_rib6_node *node, uint8_t *depth) β€” grab the depth off a node
  • void * rte_rib6_get_ext (struct rte_rib6_node *node) β€” grab the ext field 🧚
  • int rte_rib6_get_nh (const struct rte_rib6_node *node, uint64_t *nh) β€” get the nexthop
  • int rte_rib6_set_nh (struct rte_rib6_node *node, uint64_t nh) β€” set the nexthop
  • void rte_rib6_free (struct rte_rib6 *rib) β€” free the whole RIB object
  • 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 β€” make a new RIB, and yes that's the exact annotation text, I'm not touching it πŸ’€
  • struct rte_rib6 struct rte_rib6 * rte_rib6_find_existing (const char *name) β€” find one that already exists πŸ‘€

✨ Detailed Description ✨

RTE rib6 library. Periodt πŸ’…

Level compressed tree implementation for IPv6 Longest Prefix Match. Literally that's the whole thing β€” it's a tree, it's level-compressed, it does LPM for IPv6, and it's iconic for it ⭐

Definition in file rte_rib6.h.


✨ Enumeration Type Documentation ✨

🌈 anonymous enum

These are the rte_rib6_get_nxt() flags, bestie β€” you'll see them in the params down below 🫢

Enumerator

  • RTE_RIB6_GET_NXT_ALL β€” flag to get all subroutes in a RIB tree πŸ”₯
  • RTE_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.

ngl she's deprecated β€” the manpage annotation literally says use direct struct assignment πŸ’€

Parameters

  • dst β€” pointer to the place to copy
  • src β€” pointer from where to copy

Definition at line 64 of file rte_rib6.h.


πŸŽ€ int rte_rib6_is_equal (const uint8_t * ip1, const uint8_t * ip2) [inline], [static]

Compare two IPv6 addresses.

also deprecated β€” annotation says use rte_ipv6_addr_eq πŸ™ˆ

Parameters

  • ip1 β€” pointer to the first ipv6 address
  • ip2 β€” pointer to the second ipv6 address

Returns β€” 1 if equal, 0 otherwise

Definition at line 87 of file rte_rib6.h.


πŸŽ€ uint8_t get_msk_part (uint8_t depth, int byte) [inline], [static]

Get 8-bit part of 128-bit IPv6 mask. she's a lil slice πŸ“

deprecated, __rte_deprecated, no extra note, just so you know πŸ’…

Parameters

  • depth β€” ipv6 prefix length
  • byte β€” 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.


πŸŽ€ 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 handle
  • ip β€” 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. she's the less-specific one, the chill older sibling πŸ¦‹

Parameters

  • ent β€” Pointer to struct rte_rib6_node that 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 what the page says, I don't make the rules 😭)

Parameters

  • rib β€” RIB object handle
  • ip β€” net to be looked up in the RIB
  • depth β€” 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. she's giving ordered-queued-kingdom πŸ‘‘

Parameters

  • rib β€” RIB object handle
  • ip β€” net address of supernet prefix that covers returned more specific prefixes
  • depth β€” supernet prefix length
  • last β€” pointer to the last returned prefix to get next prefix or NULL to get first more specific prefix
  • flag β€” -RTE_RIB6_GET_NXT_ALL get all prefixes from subtrie; -RTE_RIB6_GET_NXT_COVER get 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. sorry girl, you're out πŸ’€

Parameters

  • rib β€” RIB object handle
  • ip β€” net to be removed from the RIB
  • depth β€” 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. welcome to the tree bestie 🌸

Parameters

  • rib β€” RIB object handle
  • ip β€” net to be inserted to the RIB
  • depth β€” 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 node
  • ip β€” 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 node
  • depth β€” 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.

⚠️ read that again bestie β€” you have to make sure there's enough space for the ext field inside the rib6 node. that's on you, not her πŸ™ˆ

Parameters

  • node β€” pointer to the rte_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 node
  • nh β€” 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 node
  • nh β€” 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. let her go πŸ¦‹

Parameters

  • rib β€” RIB object handle created with rte_rib6_create(). If rib is NULL, no operation is performed.

πŸŽ€ struct rte_rib6 * rte_rib6_create (const char * name, int socket_id, const struct rte_rib6_conf * conf)

Create RIB. build her, she's new πŸ‘‘

Parameters

  • name β€” RIB name
  • socket_id β€” NUMA socket ID for RIB table memory allocation
  • conf β€” Structure containing the configuration

Returns β€” Pointer to RIB object on success, NULL otherwise with rte_errno indicating reason for failure.


πŸŽ€ struct rte_rib6 struct rte_rib6 * rte_rib6_find_existing (const char * name)

Find an existing RIB object and return a pointer to it. she's already out there, go get her πŸ’–

Parameters

  • name β€” Name of the rib object as passed to rte_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 a human, not a bestie, just Doxygen doing her thing πŸ€–πŸ’…


🌈 and that's the whole page! this one came out of DPDK, Version 26.03.0, and she's filed under rte_rib6.h(3) β€” mwah, go build something iconic with your longest-prefix-matching self πŸ’œβœ¨
πŸ“¦ where this page comes from