Traceroute (traceroute v0.2.5)

View Source

Performs a traceroute request to a given domain.

Summary

Functions

Run a traceroute on a given domain.

Functions

run(domain_or_ip, opts \\ [])

@spec run(
  String.t() | tuple(),
  keyword()
) ::
  {:ok, Traceroute.Result.trace()}
  | {:error, :max_hops_exceeded, Traceroute.Result.trace()}

Run a traceroute on a given domain.

(Default) Options

  • protocol: :icmp|:udp|:tcp (default :udp). Which protocol to use for sending the pings.
  • max_hops: 20. After how many hops traceroute should abort.
  • max_retries: 3. How often to retry each hop before moving to the next hop.
  • min_ttl: 1. Which Time-to-live value to start with.
  • timeout: 1. How long to wait for a response in seconds.
  • print_output: true. Whether to print the output to STDOUT or not.
  • ip_protocol: :ipv4|:ipv6. Whether to trace a domain over IPv4 or IPv6. Ignored if an IP-tuple is provided.
  • probes: 3. Number of probes to send in parallel for each TTL.

Returns

  • {:ok, trace} if destination is reached, where trace is a list of Result.t().
  • {:error, :max_hops_exceeded, trace} if max hops are exceeded.