pub struct GrePacket {Show 15 fields
pub checksum_present: u1,
pub routing_present: u1,
pub key_present: u1,
pub sequence_present: u1,
pub strict_source_route: u1,
pub recursion_control: u3,
pub zero_flags: u5,
pub version: u3,
pub protocol_type: u16be,
pub checksum: Vec<u16be>,
pub offset: Vec<u16be>,
pub key: Vec<u32be>,
pub sequence: Vec<u32be>,
pub routing: Vec<u8>,
pub payload: Bytes,
}Expand description
GRE (Generic Routing Encapsulation) Packet.
See RFCs 1701, 2784, 2890, 7676, 2637
Fields§
§checksum_present: u1§routing_present: u1§key_present: u1§sequence_present: u1§strict_source_route: u1§recursion_control: u3§zero_flags: u5§version: u3§protocol_type: u16be§checksum: Vec<u16be>§offset: Vec<u16be>§key: Vec<u32be>§sequence: Vec<u32be>§routing: Vec<u8>§payload: BytesImplementations§
Source§impl GrePacket
impl GrePacket
pub fn checksum_length(&self) -> usize
pub fn offset_length(&self) -> usize
pub fn key_length(&self) -> usize
pub fn sequence_length(&self) -> usize
pub fn routing_length(&self) -> usize
Trait Implementations§
Source§impl Packet for GrePacket
impl Packet for GrePacket
type Header = ()
Source§fn from_bytes(bytes: Bytes) -> Option<Self>
fn from_bytes(bytes: Bytes) -> Option<Self>
Parse from raw bytes. (with ownership)
Source§fn header_len(&self) -> usize
fn header_len(&self) -> usize
Get the length of the header.
Source§fn payload_len(&self) -> usize
fn payload_len(&self) -> usize
Get the length of the payload.
fn into_parts(self) -> (Self::Header, Bytes)
Source§fn to_bytes_mut(&self) -> BytesMut
fn to_bytes_mut(&self) -> BytesMut
Convert the packet to a mutable byte buffer.
Source§fn header_mut(&self) -> BytesMut
fn header_mut(&self) -> BytesMut
Get a mutable byte buffer for the header.
Source§fn payload_mut(&self) -> BytesMut
fn payload_mut(&self) -> BytesMut
Get a mutable byte buffer for the payload.
impl Eq for GrePacket
impl StructuralPartialEq for GrePacket
Auto Trait Implementations§
impl !Freeze for GrePacket
impl RefUnwindSafe for GrePacket
impl Send for GrePacket
impl Sync for GrePacket
impl Unpin for GrePacket
impl UnwindSafe for GrePacket
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