Thank you for your interest in contributing to ttl!
- Rust 1.88+ (edition 2024)
- Linux or macOS (Windows not currently supported)
CAP_NET_RAWcapability or root access for testing
git clone https://github.com/lance0/ttl
cd ttl
cargo build# Development build
sudo cargo run -- 8.8.8.8
# Or set capability on release binary
cargo build --release
sudo setcap cap_net_raw+ep target/release/ttl
./target/release/ttl 8.8.8.8This project uses standard Rust formatting and linting:
# Format code
cargo fmt
# Run clippy with warnings as errors
cargo clippy -- -D warningsAll PRs must pass:
cargo buildcargo testcargo clippy -- -D warningscargo fmt -- --check
# Run all tests
cargo test
# Run tests with output
cargo test -- --nocaptureNote: Many features require raw socket access and are difficult to test in CI. Manual testing is often necessary.
See docs/ARCHITECTURE.md for detailed module documentation.
Key directories:
src/probe/- Packet crafting and ICMP parsingsrc/trace/- Probe orchestration and response handlingsrc/state/- Session and hop state managementsrc/tui/- Terminal user interfacesrc/lookup/- ASN, GeoIP, DNS enrichmentsrc/export/- Output formats (JSON, CSV, report)
- Fork the repository
- Create a feature branch from
master - Make your changes
- Ensure all checks pass (
cargo build && cargo test && cargo clippy -- -D warnings && cargo fmt -- --check) - Submit a pull request
- Use clear, descriptive commit messages
- Start with a verb (Add, Fix, Update, Remove, Refactor)
- Keep the first line under 72 characters
Good examples:
Add IPv6 support for TCP probesFix PMTUD binary search off-by-one errorUpdate ratatui to 0.30 for security fix
- Bug fixes: Include steps to reproduce and verify the fix
- New features: Update README.md and relevant docs
- Breaking changes: Note in CHANGELOG.md
When reporting bugs, please include:
- OS and version (e.g., Ubuntu 22.04, macOS 14)
- Rust version (
rustc --version) - ttl version (
ttl --version) - Steps to reproduce
- Expected vs actual behavior
- Any error messages
By contributing, you agree that your contributions will be licensed under the same dual MIT/Apache-2.0 license as the project.