Struct pnet::packet::arp::MutableArpPacket [] [src]

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

A structure enabling manipulation of on the wire packets

Methods

impl<'a> MutableArpPacket<'a>
[src]

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

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

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

Maps from a MutableArpPacket to a ArpPacket

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: &Arp) -> usize

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

fn populate(&mut self, packet: &Arp)

Populates a ArpPacket using a Arp structure

fn get_hardware_type(&self) -> ArpHardwareType

Get the value of the hardware_type field

fn get_protocol_type(&self) -> EtherType

Get the value of the protocol_type field

fn get_hw_addr_len(&self) -> u8

Get the hw_addr_len field

fn get_proto_addr_len(&self) -> u8

Get the proto_addr_len field

fn get_operation(&self) -> ArpOperation

Get the value of the operation field

fn get_sender_hw_addr(&self) -> MacAddr

Get the value of the sender_hw_addr field

fn get_sender_proto_addr(&self) -> Ipv4Addr

Get the value of the sender_proto_addr field

fn get_target_hw_addr(&self) -> MacAddr

Get the value of the target_hw_addr field

fn get_target_proto_addr(&self) -> Ipv4Addr

Get the value of the target_proto_addr field

fn set_hardware_type(&mut self, val: ArpHardwareType)

Set the value of the hardware_type field

fn set_protocol_type(&mut self, val: EtherType)

Set the value of the protocol_type field

fn set_hw_addr_len(&mut self, val: u8)

Set the hw_addr_len field

fn set_proto_addr_len(&mut self, val: u8)

Set the proto_addr_len field

fn set_operation(&mut self, val: ArpOperation)

Set the value of the operation field

fn set_sender_hw_addr(&mut self, val: MacAddr)

Set the value of the sender_hw_addr field

fn set_sender_proto_addr(&mut self, val: Ipv4Addr)

Set the value of the sender_proto_addr field

fn set_target_hw_addr(&mut self, val: MacAddr)

Set the value of the target_hw_addr field

fn set_target_proto_addr(&mut self, val: Ipv4Addr)

Set the value of the target_proto_addr field

fn set_payload(&mut self, vals: &[u8])

Set the value of the payload field (copies contents)

Trait Implementations

impl<'a> PacketSize for MutableArpPacket<'a>
[src]

fn packet_size(&self) -> usize

Get the calculated size of the packet

impl<'a> MutablePacket for MutableArpPacket<'a>
[src]

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

Retreive the underlying, mutable, buffer for the packet

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

Retreive the mutable payload for the packet

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

Initialize this packet by cloning another

impl<'a> Packet for MutableArpPacket<'a>
[src]

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

Retreive the underlying buffer for the packet

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

Retreive the payload for the packet

impl<'p> FromPacket for MutableArpPacket<'p>
[src]

type T = Arp

The type of the packet to convert from

fn from_packet(&self) -> Arp

Converts a wire-format packet to #[packet] struct format

impl<'p> Debug for MutableArpPacket<'p>
[src]

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

Formats the value using the given formatter.

Derived Implementations

impl<'p> PartialEq for MutableArpPacket<'p>
[src]

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

This method tests for self and other values to be equal, and is used by ==. Read more

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

This method tests for !=.