* Get 8-bit part of 128-bit IPv6 mask * * @param depth * ipv6 prefix length * @param byte * position of a 8-bit chunk in the 128-bit mask * * @return * 8-bit chunk of the 128-bit IPv6 mask */
| 101 | * 8-bit chunk of the 128-bit IPv6 mask |
| 102 | */ |
| 103 | static inline uint8_t |
| 104 | get_msk_part(uint8_t depth, int byte) { |
| 105 | uint8_t part; |
| 106 | |
| 107 | byte &= 0xf; |
| 108 | depth = RTE_MIN(depth, 128); |
| 109 | part = RTE_MAX((int16_t)depth - (byte * 8), 0); |
| 110 | part = (part > 8) ? 8 : part; |
| 111 | return (uint16_t)(~UINT8_MAX) >> part; |
| 112 | } |
| 113 | |
| 114 | /** |
| 115 | * Lookup an IP into the RIB structure |
no outgoing calls