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)