pub struct GreSlice<'a> { /* private fields */ }Available on crate feature
extractors only.Expand description
GRE (Generic Routing Encapsulation) header slice.
RFC 2784 fixed 4-byte header; RFC 2890 + variants add optional Checksum, Key, Sequence fields conditionally.
Implementations§
Source§impl<'a> GreSlice<'a>
impl<'a> GreSlice<'a>
Sourcepub fn has_checksum(&self) -> bool
pub fn has_checksum(&self) -> bool
Checksum-present bit.
Sourcepub fn has_sequence(&self) -> bool
pub fn has_sequence(&self) -> bool
Sequence-number-present bit.
Sourcepub fn protocol_type(&self) -> u16
pub fn protocol_type(&self) -> u16
Protocol type (EtherType of the encapsulated payload).
Sourcepub fn header_len(&self) -> usize
pub fn header_len(&self) -> usize
Compute the header length in bytes given the present optional fields. 4-byte base + 4 each for checksum, key, sequence.
pub fn header(&self) -> &'a [u8] ⓘ
pub fn bytes(&self) -> &'a [u8] ⓘ
pub fn kind(&self) -> LayerKind
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for GreSlice<'a>
impl<'a> RefUnwindSafe for GreSlice<'a>
impl<'a> Send for GreSlice<'a>
impl<'a> Sync for GreSlice<'a>
impl<'a> Unpin for GreSlice<'a>
impl<'a> UnsafeUnpin for GreSlice<'a>
impl<'a> UnwindSafe for GreSlice<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more