|
|
|
|
@ -113,6 +113,19 @@ mod intrinsics {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Builds a flag for [`SkBuffContext::adjust_room`] that defines L2 encapsulation,
|
|
|
|
|
/// using `len` as the inner MAC header length.
|
|
|
|
|
///
|
|
|
|
|
/// Equivalent to the [`BPF_F_ADJ_ROOM_ENCAP_L2`][uapi-bpf-adj-room-encap-l2] macro
|
|
|
|
|
/// in the Linux user-space API.
|
|
|
|
|
///
|
|
|
|
|
/// [uapi-bpf-adj-room-encap-l2]: https://elixir.bootlin.com/linux/v6.16.4/source/include/uapi/linux/bpf.h#L6149
|
|
|
|
|
#[inline(always)]
|
|
|
|
|
#[allow(non_snake_case)]
|
|
|
|
|
pub fn BPF_F_ADJ_ROOM_ENCAP_L2(len: u64) -> u64 {
|
|
|
|
|
(len & u64::from(bindings::BPF_ADJ_ROOM_ENCAP_L2_MASK)) << bindings::BPF_ADJ_ROOM_ENCAP_L2_SHIFT
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Check if a value is within a range, using conditional forms compatible with
|
|
|
|
|
/// the verifier.
|
|
|
|
|
#[inline(always)]
|
|
|
|
|
|