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§

  • Default values for configuration.

Structs§

Enums§

Constants§

  • The maximum time-to-live value allowed.