pub struct DataFrame<'a, DataFramePayload = &'a [u8]> {
pub header: DataFrameHeader,
pub payload: Option<DataFramePayload>,
pub _phantom: PhantomData<&'a ()>,
}Expand description
This is a data frame.
The individual subtypes don’t have there own seperate structs, since the only difference is the header.
Fields§
§header: DataFrameHeaderThis is the header of the data frame.
payload: Option<DataFramePayload>This is the payload of the data frame. It will be set to None for all null function frames. NOTE: This may be crypto wrapped, so using DataFrame::potentially_wrapped_payload is recommended.
_phantom: PhantomData<&'a ()>Implementations§
Source§impl DataFrame<'_>
impl DataFrame<'_>
Sourcepub const fn length_in_bytes(&self) -> usize
pub const fn length_in_bytes(&self) -> usize
The total length in bytes.
Sourcepub fn potentially_wrapped_payload(
&self,
mic_state: Option<MicState>,
) -> Option<PotentiallyWrappedPayload<DataFrameReadPayload<'_>>>
pub fn potentially_wrapped_payload( &self, mic_state: Option<MicState>, ) -> Option<PotentiallyWrappedPayload<DataFrameReadPayload<'_>>>
Get the potentially wrapped inner payload.
If the payload is protected, but mic_state is None, None will be returned.
Source§impl<'a, P> DataFrame<'a, P>
impl<'a, P> DataFrame<'a, P>
Sourcepub fn crypto_wrap(
self,
crypto_header: CryptoHeader,
mic_state: MicState,
) -> DataFrame<'a, CryptoWrapper<P>>
pub fn crypto_wrap( self, crypto_header: CryptoHeader, mic_state: MicState, ) -> DataFrame<'a, CryptoWrapper<P>>
Wrap the payload in a CryptoWrapper.
Source§impl<'a, KeyMic: AsRef<[u8]>, ElementContainer> DataFrame<'a, SnapLlcFrame<'a, EapolKeyFrame<'a, KeyMic, ElementContainer>>>
impl<'a, KeyMic: AsRef<[u8]>, ElementContainer> DataFrame<'a, SnapLlcFrame<'a, EapolKeyFrame<'a, KeyMic, ElementContainer>>>
Sourcepub fn eapol_mic_range(&self) -> Option<Range<usize>>
pub fn eapol_mic_range(&self) -> Option<Range<usize>>
Get the range in which the EAPOL MIC field is in the serialized data frame.
Sourcepub fn eapol_key_data_length_range(&self) -> Option<Range<usize>>
pub fn eapol_key_data_length_range(&self) -> Option<Range<usize>>
Get the range in which the EAPOL Key Data Length field is in the serialized data frame.
Sourcepub fn eapol_key_data_range(&self) -> Option<RangeFrom<usize>>
pub fn eapol_key_data_range(&self) -> Option<RangeFrom<usize>>
Get the range in which the EAPOL Key Data field is in the serialized data frame.
Trait Implementations§
Source§impl<DataFramePayload: MeasureWith<()>> MeasureWith<bool> for DataFrame<'_, DataFramePayload>
impl<DataFramePayload: MeasureWith<()>> MeasureWith<bool> for DataFrame<'_, DataFramePayload>
Source§fn measure_with(&self, with_fcs: &bool) -> usize
fn measure_with(&self, with_fcs: &bool) -> usize
Self, given the ctx?