[−][src]Enum ethox::layer::ip::IpPacket
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]
fn payload_mut(&mut self) -> &mut payload
[src]
fn resize(&mut self, length: usize) -> PayloadResult<()>
[src]
fn reframe(&mut self, frame: Reframe) -> PayloadResult<()>
[src]
Auto Trait Implementations
impl<'a, P> Send for IpPacket<'a, P> where
P: Send,
P: Send,
impl<'a, P> Sync for IpPacket<'a, P> where
P: Sync,
P: Sync,
impl<'a, P> Unpin for IpPacket<'a, P>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,