Struct pnet::packet::ipv4::MutableIpv4OptionPacket []

pub struct MutableIpv4OptionPacket<'p> {
    // some fields omitted
}

A structure enabling manipulation of on the wire packets

Methods

impl<'a> MutableIpv4OptionPacket<'a>

fn new<'p>(packet: &'p mut [u8]) -> Option<MutableIpv4OptionPacket<'p>>

Constructs a new MutableIpv4OptionPacket. If the provided buffer is less than the minimum required packet size, this will return None.

fn to_immutable<'p>(&'p self) -> Ipv4OptionPacket<'p>

Maps from a MutableIpv4OptionPacket to a Ipv4OptionPacket

fn minimum_packet_size() -> usize

The minimum size (in bytes) a packet of this type can be. It's based on the total size of the fixed-size fields.

fn packet_size(_packet: &Ipv4Option) -> usize

The size (in bytes) of a Ipv4Option instance when converted into a byte-array

fn populate(&mut self, packet: Ipv4Option)

Populates a Ipv4OptionPacket using a Ipv4Option structure

fn get_copied(&self) -> u1

Get the copied field

fn get_class(&self) -> u2

Get the class field

fn get_number(&self) -> u5

Get the number field

fn get_length(&self) -> u8

Get the length field

fn set_copied(&mut self, val: u1)

Set the copied field

fn set_class(&mut self, val: u2)

Set the class field

fn set_number(&mut self, val: u5)

Set the number field

fn set_length(&mut self, val: u8)

Set the length field

fn set_data(&mut self, vals: Vec<u8>)

Set the value of the data field (copies contents)

Trait Implementations

impl<'a> PacketSize for MutableIpv4OptionPacket<'a>

fn packet_size(&self) -> usize

impl<'a> MutablePacket for MutableIpv4OptionPacket<'a>

fn packet_mut<'p>(&'p mut self) -> &'p mut [u8]

fn payload_mut<'p>(&'p mut self) -> &'p mut [u8]

fn clone_from<T: Packet>(&mut self, other: &T)

impl<'a> Packet for MutableIpv4OptionPacket<'a>

fn packet<'p>(&'p self) -> &'p [u8]

fn payload<'p>(&'p self) -> &'p [u8]

impl<'p> FromPacket for MutableIpv4OptionPacket<'p>

type T = Ipv4Option

fn from_packet(&self) -> Ipv4Option

impl<'p> Debug for MutableIpv4OptionPacket<'p>

fn fmt(&self, fmt: &mut Formatter) -> Result

Derived Implementations

impl<'p> PartialEq for MutableIpv4OptionPacket<'p>

fn eq(&self, __arg_0: &MutableIpv4OptionPacket<'p>) -> bool

fn ne(&self, __arg_0: &MutableIpv4OptionPacket<'p>) -> bool