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

Function depth_to_mask_1b

dpdk/lib/lpm/rte_lpm6.c:1129–1136  ·  view source on GitHub ↗

* Convert a depth to a one byte long mask * Example: 4 will be converted to 0xF0 */

Source from the content-addressed store, hash-verified

1127 * Example: 4 will be converted to 0xF0
1128 */
1129static uint8_t __attribute__((pure))
1130depth_to_mask_1b(uint8_t depth)
1131{
1132 /* To calculate a mask start with a 1 on the left hand side and right
1133 * shift while populating the left hand side with 1's
1134 */
1135 return (signed char)0x80 >> (depth - 1);
1136}
1137
1138/*
1139 * Find a less specific rule

Callers 2

rule_find_less_specificFunction · 0.70
rule_find_rangeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected