X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_lpm%2Frte_lpm6.h;h=13d027f95913feedbcb6248ba277cd3dabcce4fa;hb=8bf7a79d508253d417d1088f35279fabb539ddd9;hp=856e5407d5aaf067570148ec2ac3d2c0f329333d;hpb=3031749c2df04a63cdcef186dcce3781e61436e8;p=dpdk.git diff --git a/lib/librte_lpm/rte_lpm6.h b/lib/librte_lpm/rte_lpm6.h index 856e5407d5..13d027f959 100644 --- a/lib/librte_lpm/rte_lpm6.h +++ b/lib/librte_lpm/rte_lpm6.h @@ -38,6 +38,8 @@ * RTE Longest Prefix Match for IPv6 (LPM6) */ +#include + #ifdef __cplusplus extern "C" { #endif @@ -72,7 +74,6 @@ struct rte_lpm6_config { * to an appropriate values. Possible rte_errno values include: * - E_RTE_NO_CONFIG - function could not get pointer to rte_config structure * - E_RTE_SECONDARY - function was called from a secondary process instance - * - E_RTE_NO_TAILQ - no tailq list could be got for the lpm object list * - EINVAL - invalid parameter passed to function * - ENOSPC - the maximum number of memzones has already been allocated * - EEXIST - a memzone with the same name already exists @@ -124,6 +125,25 @@ int rte_lpm6_add(struct rte_lpm6 *lpm, uint8_t *ip, uint8_t depth, uint8_t next_hop); +/** + * Check if a rule is present in the LPM table, + * and provide its next hop if it is. + * + * @param lpm + * LPM object handle + * @param ip + * IP of the rule to be searched + * @param depth + * Depth of the rule to searched + * @param next_hop + * Next hop of the rule (valid only if it is found) + * @return + * 1 if the rule exists, 0 if it does not, a negative value on failure + */ +int +rte_lpm6_is_rule_present(struct rte_lpm6 *lpm, uint8_t *ip, uint8_t depth, +uint8_t *next_hop); + /** * Delete a rule from the LPM table. *