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

Function get_msk_part

dpdk/lib/rib/rte_rib6.h:103–112  ·  view source on GitHub ↗

* 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 */

Source from the content-addressed store, hash-verified

101 * 8-bit chunk of the 128-bit IPv6 mask
102 */
103static inline uint8_t
104get_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

Callers 6

trie_modifyFunction · 0.85
is_coveredFunction · 0.85
rte_rib6_lookup_exactFunction · 0.85
rte_rib6_get_nxtFunction · 0.85
rte_rib6_insertFunction · 0.85
check_fibFunction · 0.85

Calls

no outgoing calls

Tested by 1

check_fibFunction · 0.68