pub struct AuxSecurityHeader {
pub security_level: u8,
pub key_id_mode: u8,
pub reserved: u8,
pub frame_counter: u32,
pub key_source: u64,
pub key_index: Option<u8>,
}Expand description
Security Control field bit layout (1 byte): Bits 0-2: Security Level (3 bits) Bits 3-4: Key Identifier Mode (2 bits) Bits 5-7: Reserved (3 bits) Parsed representation of an Auxiliary Security Header.
Fields§
§security_level: u8Security level (3 bits).
key_id_mode: u8Key identifier mode (2 bits).
reserved: u8Reserved bits (3 bits).
frame_counter: u32Frame counter (4 bytes).
key_source: u64Key source (0, 4, or 8 bytes depending on key_id_mode).
key_index: Option<u8>Key index (1 byte, present if key_id_mode != 0).
Implementations§
Source§impl AuxSecurityHeader
impl AuxSecurityHeader
Sourcepub fn compute_len(security_control: u8) -> usize
pub fn compute_len(security_control: u8) -> usize
Compute the byte length of the security header given the security control byte (first byte of the header).
Sourcepub fn parse(buf: &[u8], offset: usize) -> Result<(Self, usize), FieldError>
pub fn parse(buf: &[u8], offset: usize) -> Result<(Self, usize), FieldError>
Parse an Auxiliary Security Header from the buffer at the given offset. Returns the parsed header and the number of bytes consumed.
Sourcepub fn write_into(
&self,
buf: &mut [u8],
offset: usize,
) -> Result<usize, FieldError>
pub fn write_into( &self, buf: &mut [u8], offset: usize, ) -> Result<usize, FieldError>
Write the security header into a buffer at the given offset. Returns the number of bytes written.
Trait Implementations§
Source§impl Clone for AuxSecurityHeader
impl Clone for AuxSecurityHeader
Source§fn clone(&self) -> AuxSecurityHeader
fn clone(&self) -> AuxSecurityHeader
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AuxSecurityHeader
impl Debug for AuxSecurityHeader
Source§impl Default for AuxSecurityHeader
impl Default for AuxSecurityHeader
Source§impl PartialEq for AuxSecurityHeader
impl PartialEq for AuxSecurityHeader
impl Eq for AuxSecurityHeader
impl StructuralPartialEq for AuxSecurityHeader
Auto Trait Implementations§
impl Freeze for AuxSecurityHeader
impl RefUnwindSafe for AuxSecurityHeader
impl Send for AuxSecurityHeader
impl Sync for AuxSecurityHeader
impl Unpin for AuxSecurityHeader
impl UnsafeUnpin for AuxSecurityHeader
impl UnwindSafe for AuxSecurityHeader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more