pub struct IpOption<T>{
pub flag_reserved: u8,
pub address: T,
pub reserved: u8,
pub l4_proto: u8,
pub port_number: u16,
}
Expand description
An arbitrary IP Option.
This type is a single representation for all the Ipv4 and Ipv6 options.
Fields§
§flag_reserved: u8
Discardable flag and reserved bits. Split into 1 bit (discardable) and 7 bits (reserved). Both shall be set to 0.
address: T
IPv4-address. Shall contain the unicast IP-address.
reserved: u8
Reserved bytes. Shall be set to 0x00.
l4_proto: u8
Transport protocol type. Shall be set to the transport layer protocol (ISO/OSI layer 4) based on the IANA/IETF types (0x06: TCP, 0x11: UDP).
port_number: u16
Transport protocol port number. Shall be set to the port of the layer 4 protocol.
Trait Implementations§
Source§impl<'a, T> Parse<'a> for IpOption<T>
impl<'a, T> Parse<'a> for IpOption<T>
Source§fn parse_partial(reader: &mut ByteReader<'a>) -> Result<IpOption<T>, ParseError>
fn parse_partial(reader: &mut ByteReader<'a>) -> Result<IpOption<T>, ParseError>
Parses a SOME/IP payload type from a given slice of bytes. Read more
Source§impl<T> Serialize for IpOption<T>
impl<T> Serialize for IpOption<T>
Source§fn required_length(&self) -> usize
fn required_length(&self) -> usize
Returns the number of bytes required to store the serialized version of self.
Source§fn serialize_partial(
&self,
writer: &mut ByteWriter<'_>,
) -> Result<(), SerializeError>
fn serialize_partial( &self, writer: &mut ByteWriter<'_>, ) -> Result<(), SerializeError>
Serializes to a byte writer.
impl<T> Eq for IpOption<T>
impl<T> StructuralPartialEq for IpOption<T>
Auto Trait Implementations§
impl<T> Freeze for IpOption<T>where
T: Freeze,
impl<T> RefUnwindSafe for IpOption<T>where
T: RefUnwindSafe,
impl<T> Send for IpOption<T>where
T: Send,
impl<T> Sync for IpOption<T>where
T: Sync,
impl<T> Unpin for IpOption<T>where
T: Unpin,
impl<T> UnwindSafe for IpOption<T>where
T: UnwindSafe,
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