pub struct MutableVlanPacket<'p> { /* private fields */ }
Expand description
A structure enabling manipulation of on the wire packets
Implementations§
Source§impl<'a> MutableVlanPacket<'a>
impl<'a> MutableVlanPacket<'a>
Sourcepub fn new<'p>(packet: &'p mut [u8]) -> Option<MutableVlanPacket<'p>>
pub fn new<'p>(packet: &'p mut [u8]) -> Option<MutableVlanPacket<'p>>
Constructs a new #name. If the provided buffer is less than the minimum required packet size, this will return None.
Sourcepub fn owned(packet: Vec<u8>) -> Option<MutableVlanPacket<'static>>
pub fn owned(packet: Vec<u8>) -> Option<MutableVlanPacket<'static>>
Constructs a new #name. If the provided buffer is less than the minimum required packet size, this will return None. With this constructor the #name will own its own data and the underlying buffer will be dropped when the #name is.
Sourcepub fn to_immutable<'p>(&'p self) -> VlanPacket<'p>
pub fn to_immutable<'p>(&'p self) -> VlanPacket<'p>
Maps from a #name to a #imm_name
Sourcepub fn consume_to_immutable(self) -> VlanPacket<'a>
pub fn consume_to_immutable(self) -> VlanPacket<'a>
Maps from a #name to a #imm_name while consuming the source
Sourcepub const fn minimum_packet_size() -> usize
pub const 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.
Sourcepub fn packet_size(_packet: &Vlan) -> usize
pub fn packet_size(_packet: &Vlan) -> usize
The size (in bytes) of a #base_name instance when converted into a byte-array
Sourcepub fn get_priority_code_point(&self) -> ClassOfService
pub fn get_priority_code_point(&self) -> ClassOfService
Get the value of the {name} field
Sourcepub fn get_drop_eligible_indicator(&self) -> u1
pub fn get_drop_eligible_indicator(&self) -> u1
Get the drop_eligible_indicator field. This field is always stored big-endian within the struct, but this accessor returns host order.
Sourcepub fn get_vlan_identifier(&self) -> u12be
pub fn get_vlan_identifier(&self) -> u12be
Get the vlan_identifier field. This field is always stored big-endian within the struct, but this accessor returns host order.
Sourcepub fn get_ethertype(&self) -> EtherType
pub fn get_ethertype(&self) -> EtherType
Get the value of the {name} field
Sourcepub fn get_payload(&self) -> Vec<u8> ⓘ
pub fn get_payload(&self) -> Vec<u8> ⓘ
Get the value of the {name} field (copies contents)
Sourcepub fn set_priority_code_point(&mut self, val: ClassOfService)
pub fn set_priority_code_point(&mut self, val: ClassOfService)
Set the value of the {name} field.
Sourcepub fn set_drop_eligible_indicator(&mut self, val: u1)
pub fn set_drop_eligible_indicator(&mut self, val: u1)
Set the drop_eligible_indicator field. This field is always stored big-endian within the struct, but this mutator wants host order.
Sourcepub fn set_vlan_identifier(&mut self, val: u12be)
pub fn set_vlan_identifier(&mut self, val: u12be)
Set the vlan_identifier field. This field is always stored big-endian within the struct, but this mutator wants host order.
Sourcepub fn set_ethertype(&mut self, val: EtherType)
pub fn set_ethertype(&mut self, val: EtherType)
Set the value of the {name} field.
Sourcepub fn set_payload(&mut self, vals: &[u8])
pub fn set_payload(&mut self, vals: &[u8])
Set the value of the {name} field (copies contents)