Function p4rs::extract_ternary_key

source ·
pub fn extract_ternary_key(keyset_data: &[u8], offset: usize, len: usize) -> Key
Expand description

Extract a ternary key from the provided keyset data. Ternary keys come in two parts. The first part is a leading bit that indicates whether we care about the value. If that leading bit is non-zero, the trailing bits of the key are interpreted as a binary value. If the leading bit is zero, the trailing bits are ignored and a Ternary::DontCare key is returned.