Skip to main content

trace_replies_handler

Function trace_replies_handler 

Source
pub fn trace_replies_handler(
    trace_replies: Vec<TraceReply>,
    worker_stacks: &mut HashMap<u32, VecDeque<Task>>,
    traceroute_config: &mut TracerouteConfig,
    origin_id: u32,
) -> Vec<TraceReply>
Expand description

Awaits Trace replies (i.e., ICMP Time Exceeded). Updates the corresponding TraceSession, including the timeout, and follows up with the next Trace task according to the session’s progress strategy:

  • Linear (anycast-traceroute): probe TTL + 1
  • Binary (tracemap): the responding TTL becomes the new lower search bound; probe the midpoint of the remaining range

If a regular reply (from the target) is received, it closes the TraceSession.

§Arguments

  • trace_replies - A list of traceroute results
  • worker_stacks - Stacks for workers to put follow-up trace tasks into
  • traceroute_config - Configuration and state for the ongoing traceroute measurement

§Returns

The replies that matched an active trace session (to be forwarded to the CLI). Replies without a matching session (stray/foreign packets that passed the worker’s filters, or replies arriving after their session closed) are dropped.