pub struct SingleVlanHeader {
pub pcp: VlanPcp,
pub drop_eligible_indicator: bool,
pub vlan_id: VlanId,
pub ether_type: EtherType,
}
Expand description
IEEE 802.1Q VLAN Tagging Header
Fields§
§pcp: VlanPcp
A 3 bit number which refers to the IEEE 802.1p class of service and maps to the frame priority level.
drop_eligible_indicator: bool
Indicate that the frame may be dropped under the presence of congestion.
vlan_id: VlanId
12 bits vland identifier.
ether_type: EtherType
“Tag protocol identifier”: Type id of content after this header. Refer to the “EtherType” for a list of possible supported values.
Implementations§
Source§impl SingleVlanHeader
impl SingleVlanHeader
pub const SERIALIZED_SIZE: usize = 4usize
SingleVlanHeader::LEN
insteadSourcepub fn read_from_slice(
slice: &[u8],
) -> Result<(SingleVlanHeader, &[u8]), LenError>
👎Deprecated since 0.10.1: Use SingleVlanHeader::from_slice instead.
pub fn read_from_slice( slice: &[u8], ) -> Result<(SingleVlanHeader, &[u8]), LenError>
Read an SingleVlanHeader from a slice and return the header & unused parts of the slice.
Sourcepub fn from_slice(slice: &[u8]) -> Result<(SingleVlanHeader, &[u8]), LenError>
pub fn from_slice(slice: &[u8]) -> Result<(SingleVlanHeader, &[u8]), LenError>
Read an SingleVlanHeader from a slice and return the header & unused parts of the slice.
Sourcepub fn from_bytes(bytes: [u8; 4]) -> SingleVlanHeader
pub fn from_bytes(bytes: [u8; 4]) -> SingleVlanHeader
Read an SingleVlanHeader from a static sized byte array.
Sourcepub fn read<T: Read + Seek + Sized>(
reader: &mut T,
) -> Result<SingleVlanHeader, Error>
Available on crate feature std
only.
pub fn read<T: Read + Seek + Sized>( reader: &mut T, ) -> Result<SingleVlanHeader, Error>
std
only.Read a IEEE 802.1Q VLAN tagging header
Sourcepub fn write<T: Write + Sized>(&self, writer: &mut T) -> Result<(), Error>
Available on crate feature std
only.
pub fn write<T: Write + Sized>(&self, writer: &mut T) -> Result<(), Error>
std
only.Write the IEEE 802.1Q VLAN tagging header
Sourcepub fn header_len(&self) -> usize
pub fn header_len(&self) -> usize
Length of the serialized header in bytes.
Trait Implementations§
Source§impl Clone for SingleVlanHeader
impl Clone for SingleVlanHeader
Source§fn clone(&self) -> SingleVlanHeader
fn clone(&self) -> SingleVlanHeader
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more