staticvoidrte_rib6_copy_addr(uint8_t*dst,constuint8_t*src)[inline],[static]
Copy IPv6 address from one location to another
Parametersdst pointer to the place to copy
src pointer from where to copy
Definition at line 64 of file rte_rib6.h.
staticintrte_rib6_is_equal(constuint8_t*ip1,constuint8_t*ip2)[inline],[static]
Compare two IPv6 addresses
Parametersip1 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.
staticuint8_tget_msk_part(uint8_tdepth,intbyte)[inline],[static]
Get 8-bit part of 128-bit IPv6 mask
Parametersdepth 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.
structrte_rib6_node*rte_rib6_lookup(structrte_rib6*rib,conststructrte_ipv6_addr*ip)
Lookup an IP into the RIB structure
Parametersrib RIB object handle
ip IP to be looked up in the RIB
Returns
pointer to struct rte_rib6_node on success NULL otherwise
structrte_rib6_node*rte_rib6_lookup_parent(structrte_rib6_node*ent)
Lookup less specific route into the RIB structure
Parametersent 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
structrte_rib6_node*rte_rib6_lookup_exact(structrte_rib6*rib,conststructrte_ipv6_addr*ip,uint8_tdepth)
Provides exact mach lookup of the prefix into the RIB structure
Parametersrib 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
structrte_rib6_node*rte_rib6_get_nxt(structrte_rib6*rib,conststructrte_ipv6_addr*ip,uint8_tdepth,structrte_rib6_node*last,intflag)
Retrieve next more specific prefix from the RIB that is covered by ip/depth supernet in an ascending
order
Parametersrib 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
voidrte_rib6_remove(structrte_rib6*rib,conststructrte_ipv6_addr*ip,uint8_tdepth)
Remove prefix from the RIB
Parametersrib RIB object handle
ip net to be removed from the RIB
depth prefix length
structrte_rib6_node*rte_rib6_insert(structrte_rib6*rib,conststructrte_ipv6_addr*ip,uint8_tdepth)
Insert prefix into the RIB
Parametersrib 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
intrte_rib6_get_ip(conststructrte_rib6_node*node,structrte_ipv6_addr*ip)
Get an ip from rte_rib6_node
Parametersnode 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.
intrte_rib6_get_depth(conststructrte_rib6_node*node,uint8_t*depth)
Get a depth from rte_rib6_node
Parametersnode 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(structrte_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.
Parametersnode pointer to the rte_rib6_node
Returns
pointer to the ext
intrte_rib6_get_nh(conststructrte_rib6_node*node,uint64_t*nh)
Get nexthop from the rte_rib6_node
Parametersnode 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.
intrte_rib6_set_nh(structrte_rib6_node*node,uint64_tnh)
Set nexthop into the rte_rib6_node
Parametersnode 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.
structrte_rib6*rte_rib6_create(constchar*name,intsocket_id,conststructrte_rib6_conf*conf)
Create RIB
Parametersname 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.
structrte_rib6*rte_rib6_find_existing(constchar*name)
Find an existing RIB object and return a pointer to it.
Parametersname 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.
voidrte_rib6_free(structrte_rib6*rib)
Free an RIB object.
Parametersrib RIB object handle created with rte_rib6_create(). If rib is NULL, no operation is performed.