Struct pnet::packet::ipv6::MutableIpv6Packet
[−]
[src]
pub struct MutableIpv6Packet<'p> { /* fields omitted */ }
A structure enabling manipulation of on the wire packets
Methods
impl<'a> MutableIpv6Packet<'a>
[src]
fn new<'p>(packet: &'p mut [u8]) -> Option<MutableIpv6Packet<'p>>
Constructs a new MutableIpv6Packet. If the provided buffer is less than the minimum required packet size, this will return None.
fn owned(packet: Vec<u8>) -> Option<MutableIpv6Packet<'static>>
Constructs a new MutableIpv6Packet. If the provided buffer is less than the minimum required packet size, this will return None. With this constructor the MutableIpv6Packet will own its own data and the underlying buffer will be dropped when the MutableIpv6Packet is.
fn to_immutable<'p>(&'p self) -> Ipv6Packet<'p>
Maps from a MutableIpv6Packet to a Ipv6Packet
fn consume_to_immutable(self) -> Ipv6Packet<'a>
Maps from a MutableIpv6Packet to a Ipv6Packet while consuming the source
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: &Ipv6) -> usize
The size (in bytes) of a Ipv6 instance when converted into a byte-array
fn populate(&mut self, packet: &Ipv6)
Populates a Ipv6Packet using a Ipv6 structure
fn get_version(&self) -> u4
Get the version field
fn get_traffic_class(&self) -> u8
Get the traffic_class field
fn get_flow_label(&self) -> u20be
Get the flow_label field
fn get_payload_length(&self) -> u16be
Get the payload_length field
fn get_next_header(&self) -> IpNextHeaderProtocol
Get the value of the next_header field
fn get_hop_limit(&self) -> u8
Get the hop_limit field
fn get_source(&self) -> Ipv6Addr
Get the value of the source field
fn get_destination(&self) -> Ipv6Addr
Get the value of the destination field
fn set_version(&mut self, val: u4)
Set the version field
fn set_traffic_class(&mut self, val: u8)
Set the traffic_class field
fn set_flow_label(&mut self, val: u20be)
Set the flow_label field
fn set_payload_length(&mut self, val: u16be)
Set the payload_length field
fn set_next_header(&mut self, val: IpNextHeaderProtocol)
Set the value of the next_header field
fn set_hop_limit(&mut self, val: u8)
Set the hop_limit field
fn set_source(&mut self, val: Ipv6Addr)
Set the value of the source field
fn set_destination(&mut self, val: Ipv6Addr)
Set the value of the destination field
fn set_payload(&mut self, vals: &[u8])
Set the value of the payload field (copies contents)
Trait Implementations
impl<'p> PartialEq for MutableIpv6Packet<'p>
[src]
fn eq(&self, __arg_0: &MutableIpv6Packet<'p>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &MutableIpv6Packet<'p>) -> bool
This method tests for !=
.
impl<'a> PacketSize for MutableIpv6Packet<'a>
[src]
fn packet_size(&self) -> usize
Get the calculated size of the packet
impl<'a> MutablePacket for MutableIpv6Packet<'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 MutableIpv6Packet<'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 MutableIpv6Packet<'p>
[src]
type T = Ipv6
The type of the packet to convert from
fn from_packet(&self) -> Ipv6
Converts a wire-format packet to #[packet] struct format