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
Builder- Build aTracer.Tracer::run- Run the tracer on the current thread.Tracer::run_with- Run the tracer with a custom round handler.Tracer::spawn- Run the tracer on a new thread.Tracer::spawn_with- Run the tracer on a new thread with a custom round handler.
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
Hopwithin aTrace. - MaxInflight
MaxInflightnewtype.- MaxRounds
MaxRoundnewtype.- Mpls
Label Stack - The members of a MPLS probe response extension.
- Mpls
Label Stack Member - A member of a MPLS probe response extension.
- Packet
Size PacketSizenewtype.- Payload
Pattern PayloadPatternnewtype.- Port
- Port newtype.
- Probe
- An incomplete network tracing probe.
- Probe
Complete - A complete network tracing probe.
- Round
- The output from a round of tracing.
- RoundId
Roundnewtype.- Sequence
Sequencenumber newtype.- State
- The state of a trace.
- Strategy
- Trace a path to a target.
- Time
ToLive TimeToLive(ttl) newtype.- TraceId
TraceIdnewtype.- Tracer
- A traceroute implementation.
- Type
OfService TypeOfService(akaDSCP&ECN) newtype.- Unknown
Extension - An unknown ICMP extension.
Enums§
- Completion
Reason - 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.
- Flow
Entry - An entry in a
Flow. - Icmp
Extension Parse Mode - The ICMP extension parsing mode.
- Icmp
Packet Type - The type of ICMP packet received.
- Multipath
Strategy - The Equal-cost Multi-Path routing strategy.
- NatStatus
- The state of a NAT detection for a
Hop. - Port
Direction - Whether to fix the src, dest or both ports for a trace.
- Privilege
Mode - The privilege mode.
- Probe
Status - A network tracing probe.
- Protocol
- The tracing protocol.
Constants§
- MAX_TTL
- The maximum time-to-live value allowed.