MCPcopy Create free account
hub / github.com/F-Stack/f-stack / is_covered

Function is_covered

dpdk/lib/rib/rte_rib6.c:65–76  ·  view source on GitHub ↗

* Check if ip1 is covered by ip2/depth prefix */

Source from the content-addressed store, hash-verified

63 * Check if ip1 is covered by ip2/depth prefix
64 */
65static inline bool
66is_covered(const uint8_t ip1[RTE_RIB6_IPV6_ADDR_SIZE],
67 const uint8_t ip2[RTE_RIB6_IPV6_ADDR_SIZE], uint8_t depth)
68{
69 int i;
70
71 for (i = 0; i < RTE_RIB6_IPV6_ADDR_SIZE; i++)
72 if ((ip1[i] ^ ip2[i]) & get_msk_part(depth, i))
73 return false;
74
75 return true;
76}
77
78static inline int
79get_dir(const uint8_t ip[RTE_RIB6_IPV6_ADDR_SIZE], uint8_t depth)

Callers 4

rte_rib6_lookupFunction · 0.70
rte_rib6_lookup_exactFunction · 0.70
rte_rib6_get_nxtFunction · 0.70
rte_rib6_insertFunction · 0.70

Calls 1

get_msk_partFunction · 0.85

Tested by

no test coverage detected