Crate trippy_core

Crate trippy_core 

Source
Expand description

Trippy - A network tracing library.

This crate provides the core network tracing facility used by the standalone Trippy application.

Note: the public API is not stable and is highly likely to change in the future.

§Example

The following example builds and runs a tracer with default configuration and prints out the tracing data for each round:

use trippy_core::Builder;

let addr = IpAddr::from_str("1.1.1.1")?;
Builder::new(addr)
    .build()?
    .run_with(|round| println!("{:?}", round))?;

The following example traces using the UDP protocol with the Dublin ECMP strategy with fixed src and dest ports. It also operates in unprivileged mode (only supported on some platforms):

use trippy_core::{Builder, MultipathStrategy, Port, PortDirection, PrivilegeMode, Protocol};

let addr = IpAddr::from_str("1.1.1.1")?;
Builder::new(addr)
    .privilege_mode(PrivilegeMode::Unprivileged)
    .protocol(Protocol::Udp)
    .multipath_strategy(MultipathStrategy::Dublin)
    .port_direction(PortDirection::FixedBoth(Port(33434), Port(3500)))
    .build()?
    .run_with(|round| println!("{:?}", round))?;

§See Also

Modules§

defaults
Default values for configuration.

Structs§

Builder
Build a tracer.
Extensions
The ICMP extensions for a probe response.
Flags
Probe flags.
FlowId
Identifies a tracing Flow.
Hop
Information about a single Hop within a Trace.
MaxInflight
MaxInflight newtype.
MaxRounds
MaxRound newtype.
MplsLabelStack
The members of a MPLS probe response extension.
MplsLabelStackMember
A member of a MPLS probe response extension.
PacketSize
PacketSize newtype.
PayloadPattern
PayloadPattern newtype.
Port
Port newtype.
Probe
An incomplete network tracing probe.
ProbeComplete
A complete network tracing probe.
Round
The output from a round of tracing.
RoundId
Round newtype.
Sequence
Sequence number newtype.
State
The state of a trace.
Strategy
Trace a path to a target.
TimeToLive
TimeToLive (ttl) newtype.
TraceId
TraceId newtype.
Tracer
A traceroute implementation.
TypeOfService
TypeOfService (aka DSCP & ECN) newtype.
UnknownExtension
An unknown ICMP extension.

Enums§

CompletionReason
Indicates what triggered the completion of the tracing round.
Dscp
Differentiated Services Code Point (DSCP).
Ecn
Explicit Congestion Notification (ECN).
Error
A tracer error.
Extension
A probe response extension.
FlowEntry
An entry in a Flow.
IcmpExtensionParseMode
The ICMP extension parsing mode.
IcmpPacketType
The type of ICMP packet received.
MultipathStrategy
The Equal-cost Multi-Path routing strategy.
NatStatus
The state of a NAT detection for a Hop.
PortDirection
Whether to fix the src, dest or both ports for a trace.
PrivilegeMode
The privilege mode.
ProbeStatus
A network tracing probe.
Protocol
The tracing protocol.

Constants§

MAX_TTL
The maximum time-to-live value allowed.