logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Author

       Generated automatically by Doxygen for DPDK from the source code.

DPDK                                             Version 24.11.2                                    rte_rib.h(3)

Detailed Description

       RTE RIB library.

       Level compressed tree implementation for IPv4 Longest Prefix Match

       Definition in file rte_rib.h.

Enumeration Type Documentation

anonymousenumrte_rib_get_nxt() flags

       EnumeratorRTE_RIB_GET_NXT_ALL
              flag to get all subroutes in a RIB tree

       RTE_RIB_GET_NXT_COVER
              flag to get first matched subroutes in a RIB tree

       Definition at line 28 of file rte_rib.h.

Function Documentation

staticuint32_trte_rib_depth_to_mask(uint8_tdepth)[inline],[static]
       Get an IPv4 mask from prefix length It is caller responsibility to make sure depth is not bigger than 32

       Parametersdepth prefix length

       Returns
           IPv4 mask

       Definition at line 60 of file rte_rib.h.

   structrte_rib_node*rte_rib_lookup(structrte_rib*rib,uint32_tip)
       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_rib_node on success NULL otherwise

   structrte_rib_node*rte_rib_lookup_parent(structrte_rib_node*ent)
       Lookup less specific route into the RIB structure

       Parametersent Pointer to struct rte_rib_node that represents target route

       Returns
           pointer to struct rte_rib_node that represents less specific route on success NULL otherwise

   structrte_rib_node*rte_rib_lookup_exact(structrte_rib*rib,uint32_tip,uint8_tdepth)
       Lookup 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_rib_node on success NULL otherwise

   structrte_rib_node*rte_rib_get_nxt(structrte_rib*rib,uint32_tip,uint8_tdepth,structrte_rib_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_RIB_GET_NXT_ALL  get  all prefixes from subtrie -RTE_RIB_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_rib_remove(structrte_rib*rib,uint32_tip,uint8_tdepth)
       Remove prefix from the RIB

       Parametersrib RIB object handle
           ip net to be removed from the RIB
           depth prefix length

   structrte_rib_node*rte_rib_insert(structrte_rib*rib,uint32_tip,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_rib_node on success NULL otherwise

   intrte_rib_get_ip(conststructrte_rib_node*node,uint32_t*ip)
       Get an ip from rte_rib_node

       Parametersnode pointer to the rib node
           ip pointer to the ip to save

       Returns
           0 on success. -1 on failure with rte_errno indicating reason for failure.

   intrte_rib_get_depth(conststructrte_rib_node*node,uint8_t*depth)
       Get a depth from rte_rib_node

       Parametersnode pointer to the rib node
           depth pointer to the depth to save

       Returns
           0 on success. -1 on failure with rte_errno indicating reason for failure.

   void*rte_rib_get_ext(structrte_rib_node*node)
       Get ext field from the rib node It is caller responsibility to make sure there are  necessary  space  for
       the ext field inside rib node.

       Parametersnode pointer to the rib node

       Returns
           pointer to the ext

   intrte_rib_get_nh(conststructrte_rib_node*node,uint64_t*nh)
       Get nexthop from the rib node

       Parametersnode pointer to the rib node
           nh pointer to the nexthop to save

       Returns
           0 on success. -1 on failure with rte_errno indicating reason for failure.

   intrte_rib_set_nh(structrte_rib_node*node,uint64_tnh)
       Set nexthop into the rib node

       Parametersnode pointer to the rib node
           nh nexthop value to set to the rib node

       Returns
           0 on success. -1 on failure with rte_errno indicating reason for failure.

   structrte_rib*rte_rib_create(constchar*name,intsocket_id,conststructrte_rib_conf*conf)
       Create RIB

       Parametersname RIB name
           socket_id NUMA socket ID for RIB table memory allocation
           conf Structure containing the configuration

       Returns
           Handle to RIB object on success NULL otherwise with rte_errno indicating reason for failure.

   structrte_rib*rte_rib_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_rib_create()Returns
           Pointer to RIB object on success NULL otherwise with rte_errno indicating reason for failure.

   voidrte_rib_free(structrte_rib*rib)
       Free an RIB object.

       Parametersrib RIB object handle created with rte_rib_create(). If rib is NULL, no operation is performed.

Name

       rte_rib.h

Synopsis

       #include <stdlib.h>
       #include <stdint.h>

   DataStructures
       struct rte_rib_confEnumerations
       enum { RTE_RIB_GET_NXT_ALL, RTE_RIB_GET_NXT_COVER }

   Functions
       static uint32_t rte_rib_depth_to_mask (uint8_t depth)
       struct rte_rib_node * rte_rib_lookup (struct rte_rib *rib, uint32_t ip)
       struct rte_rib_node * rte_rib_lookup_parent (struct rte_rib_node *ent)
       struct rte_rib_node * rte_rib_lookup_exact (struct rte_rib *rib, uint32_t ip, uint8_t depth)
       struct rte_rib_node * rte_rib_get_nxt (struct rte_rib *rib, uint32_t ip, uint8_t depth, struct
           rte_rib_node *last, int flag)
       void rte_rib_remove (struct rte_rib *rib, uint32_t ip, uint8_t depth)
       struct rte_rib_node * rte_rib_insert (struct rte_rib *rib, uint32_t ip, uint8_t depth)
       int rte_rib_get_ip (const struct rte_rib_node *node, uint32_t *ip)
       int rte_rib_get_depth (const struct rte_rib_node *node, uint8_t *depth)
       void * rte_rib_get_ext (struct rte_rib_node *node)
       int rte_rib_get_nh (const struct rte_rib_node *node, uint64_t *nh)
       int rte_rib_set_nh (struct rte_rib_node *node, uint64_t nh)
       struct rte_rib * rte_rib_create (const char *name, int socket_id, const struct rte_rib_conf *conf)
       struct rte_rib * rte_rib_find_existing (const char *name)
       void rte_rib_free (struct rte_rib *rib)

See Also