[][src]Enum ethox::layer::ip::IpPacket

pub enum IpPacket<'a, P: Payload> {
    V4(V4Packet<'a, P>),
    V6(V6Packet<'a, P>),
}

A valid IP packet buffer.

This provides a unified view on the payload and the source and destination addresses.

Variants

V4(V4Packet<'a, P>)

Containing an IPv4 packet.

V6(V6Packet<'a, P>)

Containing an IPv6 packet.

Methods

impl<'a, P: Payload> IpPacket<'a, P>[src]

pub fn new_unchecked(inner: Frame<&'a mut P>, repr: Repr) -> Self[src]

Assemble an ip packet with already computed representation.

Panics

This function panics if the representation is not specifically Ipv4 or Ipv6.

pub fn repr(&self) -> Repr[src]

Retrieve the representation of the packet.

pub fn into_inner(self) -> Frame<&'a mut P>[src]

Turn the packet into its ethernet layer respresentation.

pub fn into_raw(self) -> &'a mut P[src]

Retrieve the payload of the packet.

This is a utility wrapper around unwrapping the inner ethernet frame.

Trait Implementations

impl<'a, P: Payload> Payload for IpPacket<'a, P>[src]

impl<'a, P: PayloadMut> PayloadMut for IpPacket<'a, P>[src]

Auto Trait Implementations

impl<'a, P> Send for IpPacket<'a, P> where
    P: Send

impl<'a, P> Sync for IpPacket<'a, P> where
    P: Sync

impl<'a, P> Unpin for IpPacket<'a, P>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.