Struct packet_formats::icmp::Icmpv4TimestampRequest
source · pub struct Icmpv4TimestampRequest(/* private fields */);
Expand description
An ICMPv4 Timestamp Request message.
Implementations§
source§impl Icmpv4TimestampRequest
impl Icmpv4TimestampRequest
sourcepub fn new(origin_timestamp: u32, id: u16, seq: u16) -> Icmpv4TimestampRequest
pub fn new(origin_timestamp: u32, id: u16, seq: u16) -> Icmpv4TimestampRequest
Creates an Icmpv4TimestampRequest
.
new
constructs a new Icmpv4TimestampRequest
with the given
parameters, and sets the Receive Timestamp and Transmit Timestamp values
to zero.
sourcepub fn reply(
&self,
recv_timestamp: u32,
tx_timestamp: u32
) -> Icmpv4TimestampReply
pub fn reply( &self, recv_timestamp: u32, tx_timestamp: u32 ) -> Icmpv4TimestampReply
Reply to a Timestamp Request message.
reply
takes the Icmpv4TimestampRequest
from a Timestamp Request
message, and produces the appropriate Icmpv4TimestampReply
value for a
Timestamp Reply message. The original Originate Timestamp, ICMP ID, and
ICMP Sequence Number are retained, while the Receive Timestamp and
Transmit Timestamp are overwritten with the given values.
The Receive Timestamp (recv_timestamp
) indicates the time at which the
Timestamp Request was first received, while the Transmit Timestamp
(tx_timestamp
) indicates the time at which the Timestamp Reply was
last processed before being sent.
Trait Implementations§
source§impl Clone for Icmpv4TimestampRequest
impl Clone for Icmpv4TimestampRequest
source§fn clone(&self) -> Icmpv4TimestampRequest
fn clone(&self) -> Icmpv4TimestampRequest
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Icmpv4TimestampRequest
impl Debug for Icmpv4TimestampRequest
source§impl FromBytes for Icmpv4TimestampRequestwhere
Timestamp: FromBytes,
impl FromBytes for Icmpv4TimestampRequestwhere
Timestamp: FromBytes,
§fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where
Self: Sized + NoCell,
fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>where
Self: Sized + NoCell,
bytes
as a &[Self]
with length
equal to count
without copying. Read more§fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where
Self: Sized + NoCell,
fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>where
Self: Sized + NoCell,
bytes
as a &[Self]
with length
equal to count
without copying. Read more§fn mut_slice_from_prefix(
bytes: &mut [u8],
count: usize
) -> Option<(&mut [Self], &mut [u8])>where
Self: Sized + IntoBytes + NoCell,
fn mut_slice_from_prefix(
bytes: &mut [u8],
count: usize
) -> Option<(&mut [Self], &mut [u8])>where
Self: Sized + IntoBytes + NoCell,
bytes
as a &mut [Self]
with length
equal to count
without copying. Read more§fn mut_slice_from_suffix(
bytes: &mut [u8],
count: usize
) -> Option<(&mut [u8], &mut [Self])>where
Self: Sized + IntoBytes + NoCell,
fn mut_slice_from_suffix(
bytes: &mut [u8],
count: usize
) -> Option<(&mut [u8], &mut [Self])>where
Self: Sized + IntoBytes + NoCell,
bytes
as a &mut [Self]
with length
equal to count
without copying. Read more