X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_lpm%2Frte_lpm.h;h=840d871cc921b320e84110969038550affd77ef1;hb=4d6d8babac6f1e1349d934eb3e1b15950822adbb;hp=d35565df7cf79ed924037c86217f364b2841c436;hpb=3440438c5d4749371be8c9c2abace4793af495b9;p=dpdk.git diff --git a/lib/librte_lpm/rte_lpm.h b/lib/librte_lpm/rte_lpm.h index d35565df7c..840d871cc9 100644 --- a/lib/librte_lpm/rte_lpm.h +++ b/lib/librte_lpm/rte_lpm.h @@ -215,6 +215,25 @@ rte_lpm_free(struct rte_lpm *lpm); int rte_lpm_add(struct rte_lpm *lpm, uint32_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_lpm_is_rule_present(struct rte_lpm *lpm, uint32_t ip, uint8_t depth, +uint8_t *next_hop); + /** * Delete a rule from the LPM table. *