pub fn parse_icmp(
packet_bytes: &[u8],
m_id: u32,
is_traceroute: bool,
meta: ReplyMeta,
) -> Option<Reply>Expand description
Parse ICMP ping packets into a Reply result. Filters out spoofed packets and only parses ICMP echo replies valid for the current measurement.
§Arguments
packet_bytes- the bytes of the packet to parsem_id- the ID of the current measurementis_traceroute- handle echo reply as traceroute target replymeta- received packet metadata (source address, TTL, kernel receive time)
§Returns
Option<Reply>- the received ping reply, None if invalid
§Remarks
The function returns None if the packet is not an ICMP echo reply or if the packet is too short to contain the necessary information.