* Check if ip1 is covered by ip2/depth prefix */
| 63 | * Check if ip1 is covered by ip2/depth prefix |
| 64 | */ |
| 65 | static inline bool |
| 66 | is_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 | |
| 78 | static inline int |
| 79 | get_dir(const uint8_t ip[RTE_RIB6_IPV6_ADDR_SIZE], uint8_t depth) |
no test coverage detected