pub struct DoipHeader {
pub protocol_version: ProtocolVersion,
pub inverse_protocol_version: u8,
pub payload_type: PayloadType,
pub payload_length: u32,
}Expand description
The definitive fields of a DoIP frame.
The definition of a DoIP frame is found in the DoipHeader, this contains each
key field which a parser uses to identify the bytes which pertain to a DoIP
frame.
Fields§
§protocol_version: ProtocolVersionprotocol_version acts a pair with the inverse_protocol_version to create
a validation check to ensure the packet is constructed correctly. There
are specific versions available within the DoipVersion enum.
inverse_protocol_version: u8Calculated using bitwise inversion, the inverse_protocol_version acts
as a validation technique for validating the packet.
payload_type: PayloadTypeThe type of payload alongside the header, this defines what is contained within the message, and directs the parser to accurately identify fields.
A list of valid Payload Types are available in the PayloadType enum.
payload_length: u32The payload_length is automatically calulated on the construction of a
DoipHeader and is taken from the payload the header was initiated with.
This tells the parser how many bytes to expect after the header.
Trait Implementations§
Source§impl Clone for DoipHeader
impl Clone for DoipHeader
Source§fn clone(&self) -> DoipHeader
fn clone(&self) -> DoipHeader
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more