src/dpdk/lib/librte_lpm/rte_lpm6.c
int
rte_lpm6_is_rule_present(struct rte_lpm6 *lpm, const uint8_t *ip, uint8_t depth,
			 uint32_t *next_hop)
{
	uint8_t masked_ip[RTE_LPM6_IPV6_ADDR_SIZE];

	/* Check user arguments. */
	if ((lpm == NULL) || next_hop == NULL || ip == NULL ||
			(depth < 1) || (depth > RTE_LPM6_MAX_DEPTH))
		return -EINVAL;

	/* Copy the IP and mask it to avoid modifying user's input data. */
	ip6_copy_addr(masked_ip, ip);
	ip6_mask_addr(masked_ip, depth);

	return rule_find(lpm, masked_ip, depth, next_hop);
}
/*
 * Look for a rule in the high-level rules table
 */
Look for a rule in the high-level rules table
Look for a rule in the high - level rules table
int
rte_lpm6_is_rule_present(struct rte_lpm6 *lpm, const uint8_t *ip, uint8_t depth,
			 uint32_t *next_hop)
{
	uint8_t masked_ip[RTE_LPM6_IPV6_ADDR_SIZE];
	if ((lpm == NULL) || next_hop == NULL || ip == NULL ||
			(depth < 1) || (depth > RTE_LPM6_MAX_DEPTH))
		return -EINVAL;
	ip6_copy_addr(masked_ip, ip);
	ip6_mask_addr(masked_ip, depth);
	return rule_find(lpm, masked_ip, depth, next_hop);
}
int rte_lpm6_is_rule_present ( struct rte_lpm6 * lpm , const uint8_t * ip , uint8_t depth , uint32_t * next_hop ) { uint8_t masked_ip [ RTE_LPM6_IPV6_ADDR_SIZE ] ; if ( ( lpm == NULL ) || next_hop == NULL || ip == NULL || ( depth < 1 ) || ( depth > RTE_LPM6_MAX_DEPTH ) ) return - EINVAL ; ip6_copy_addr ( masked_ip , ip ) ; ip6_mask_addr ( masked_ip , depth ) ; return rule_find ( lpm , masked_ip , depth , next_hop ) ; }
Look for a rule in the high-level rules table
Look for a rule in the high - level rules table
/* Check user arguments. */ /* Copy the IP and mask it to avoid modifying user's input data. */