Traceroute.Sockets.ICMP (traceroute v0.2.3)

View Source

A GenServer that sends an ICMP traceroute probe and waits for a response.

Uses the ICMPConn singleton socket to send ICMP packets and receive responses using asynchronous message handling.

Response Filtering

When multiple ICMP probes run in parallel, each probe registers with ICMPConn using its ICMP identifier. ICMPConn routes incoming ICMP responses to the correct probe process based on the identifier in the response packet.

Summary

Functions

Returns a specification to start this module under a supervisor.

Sends an ICMP probe packet and waits for a response.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

send(packet, ip, ttl, timeout, ip_protocol, opts \\ [])

Sends an ICMP probe packet and waits for a response.

Returns {:ok, time_microseconds, reply_packet} on success, or {:error, reason} on failure.

Options

  • :identifier - The ICMP identifier used in the probe packet (required for response filtering)

start_link(args)