pub struct Ipv4Repr {
pub src_addr: Address,
pub dst_addr: Address,
pub next_header: Protocol,
pub payload_len: usize,
pub hop_limit: u8,
}
Expand description
A high-level representation of an Internet Protocol version 4 packet header.
Fields§
§src_addr: Address
§dst_addr: Address
§next_header: Protocol
§payload_len: usize
§hop_limit: u8
Implementations§
source§impl Repr
impl Repr
sourcepub fn parse<T: AsRef<[u8]> + ?Sized>(
packet: &Packet<&T>,
checksum_caps: &ChecksumCapabilities
) -> Result<Repr>
pub fn parse<T: AsRef<[u8]> + ?Sized>(
packet: &Packet<&T>,
checksum_caps: &ChecksumCapabilities
) -> Result<Repr>
Parse an Internet Protocol version 4 packet and return a high-level representation.
sourcepub const fn buffer_len(&self) -> usize
pub const fn buffer_len(&self) -> usize
Return the length of a header that will be emitted from this high-level representation.