Struct Gre

Source
pub struct Gre {
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: Vec<u8>,
}
Expand description

GRE (Generic Routing Encapsulation) Packet.

See RFCs 1701, 2784, 2890, 7676, 2637

Current status of implementation:

  • RFC 1701 except for source routing and checksums. Processing a source routed packet will panic. Checksums are able to be inspected, but not calculated or verified.

  • RFC 2784 except for checksums (same as 1701 status). Note that it is possible to generate noncompliant packets by setting any of the reserved bits (but see 2890).

  • RFC 2890 implemented.

  • RFC 7676 has no packet changes - compliance is up to the user.

  • RFC 2637 not implemented.

Note that routing information from RFC 1701 is not implemented, packets with routing_present true will currently cause a panic.

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: Vec<u8>

Trait Implementations§

Source§

impl Debug for Gre

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Gre

§

impl RefUnwindSafe for Gre

§

impl Send for Gre

§

impl Sync for Gre

§

impl Unpin for Gre

§

impl UnwindSafe for Gre

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.