Skip to main content

create_icmp

Function create_icmp 

Source
pub fn create_icmp(
    src: &Address,
    dst: &Address,
    identifier: u16,
    seq: u16,
    payload: &ProbePayload<'_>,
    ttl: u8,
) -> Vec<u8> 
Expand description

Creates a ping packet to send.

§Arguments

  • src - the source address for the ping packet
  • dst - the destination address for the ping packet
  • identifier - the identifier to use in the ICMP header
  • seq - the sequence number to use in the ICMP header
  • payload - information to encode in the payload
  • ttl - the time-to-live (TTL) value to set in the IP header

§Returns

A ping packet (including the IP header) as a byte vector.