pub struct MacsecHeaderSlice<'a> { /* private fields */ }
Expand description
Slice containing a MACsec header & next ether type (if possible).
Implementations§
Source§impl<'a> MacsecHeaderSlice<'a>
impl<'a> MacsecHeaderSlice<'a>
Sourcepub fn from_slice(
slice: &'a [u8],
) -> Result<MacsecHeaderSlice<'a>, HeaderSliceError>
pub fn from_slice( slice: &'a [u8], ) -> Result<MacsecHeaderSlice<'a>, HeaderSliceError>
Try creating a MacsecHeaderSlice
from a slice containing the
MACsec header & next ether type.
Sourcepub fn slice(&self) -> &'a [u8] ⓘ
pub fn slice(&self) -> &'a [u8] ⓘ
Slice containing the header & ether type of the next segment if available.
Sourcepub fn tci_an_raw(&self) -> u8
pub fn tci_an_raw(&self) -> u8
Raw first byte of the mac sec header (containing TCI & AN).
Sourcepub fn endstation_id(&self) -> bool
pub fn endstation_id(&self) -> bool
End station identifier (TCI.ES flag).
Sourcepub fn encrypted(&self) -> bool
pub fn encrypted(&self) -> bool
Encryption flag, which indicates whether the user data is encrypted (true = encrypted, TCI.E flag).
Sourcepub fn userdata_changed(&self) -> bool
pub fn userdata_changed(&self) -> bool
Flag for change text, set if the user data is modified.
Sourcepub fn is_unmodified(&self) -> bool
pub fn is_unmodified(&self) -> bool
True if the payload was neither flagged as modified or encrypted.
Sourcepub fn ptype(&self) -> MacsecPType
pub fn ptype(&self) -> MacsecPType
Payload type (contains encryption, modification flag as well as the next ether type if available)
Sourcepub fn short_len(&self) -> MacsecShortLen
pub fn short_len(&self) -> MacsecShortLen
Short length with reserved bits.
Sourcepub fn sci_present(&self) -> bool
pub fn sci_present(&self) -> bool
True if the SCI bit is set in the TCI part of the SecTag header.
Sourcepub fn next_ether_type(&self) -> Option<EtherType>
pub fn next_ether_type(&self) -> Option<EtherType>
Ether type of the data following the sec tag (only available if not encrypted and userdata is not flagged as modified).
Sourcepub fn header_len(&self) -> usize
pub fn header_len(&self) -> usize
Length of the MACsec header (SecTag + next ether type if available).
Sourcepub fn expected_payload_len(&self) -> Option<usize>
pub fn expected_payload_len(&self) -> Option<usize>
Returns the required length of the payload (data after header + next_ether_type if present) if possible.
If the length cannot be determined (short_len
is zero or less then
2
when ptype
Unmodified
) None
is returned.
Sourcepub fn to_header(&self) -> MacsecHeader
pub fn to_header(&self) -> MacsecHeader
Decodes all MacSecHeader values and returns them as a
crate::MacsecHeader
.
Trait Implementations§
Source§impl<'a> Clone for MacsecHeaderSlice<'a>
impl<'a> Clone for MacsecHeaderSlice<'a>
Source§fn clone(&self) -> MacsecHeaderSlice<'a>
fn clone(&self) -> MacsecHeaderSlice<'a>
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more