Skip to main content

Crate tor_circmgr

Crate tor_circmgr 

Source
Expand description

§tor-circmgr

circuits through the Tor network on demand.

§Overview

This crate is part of Arti, a project to implement Tor in Rust.

In Tor, a circuit is an encrypted multi-hop tunnel over multiple relays. This crate’s purpose, long-term, is to manage a set of circuits for a client. It should construct circuits in response to a client’s needs, and preemptively construct circuits so as to anticipate those needs. If a client request can be satisfied with an existing circuit, it should return that circuit instead of constructing a new one.

§Compile-time features

  • specific-relay: Support for connecting to a relay via specifically provided connection instructions, rather than using information from a Tor network directory.

  • full: Enable all features above.

§Experimental and unstable features

Note that the APIs enabled by these features are NOT covered by semantic versioning1 guarantees: we might break them or remove them between patch versions.

  • experimental-api: Add additional non-stable APIs to our public interfaces.

  • experimental: Enable all the above experimental features.

License: MIT OR Apache-2.0


  1. Remember, semantic versioning is what makes various cargo features work reliably. To be explicit: if you want cargo update to only make safe changes, then you cannot enable these features. ↩

Re-exports§

pub(crate) use build::TunnelBuilder; 🔒
pub(crate) use mgr::AbstractTunnel; 🔒
pub(crate) use mgr::AbstractTunnelBuilder; 🔒
pub use config::test_config::TestConfig;
pub use err::Error;
pub use isolation::IsolationToken;
pub use tunnel::ClientDataTunnel;
pub use tunnel::ClientDirTunnel;
pub use tunnel::ClientOnionServiceDataTunnel;
pub use tunnel::ClientOnionServiceDirTunnel;
pub use tunnel::ClientOnionServiceIntroTunnel;
pub use tunnel::ServiceOnionServiceDataTunnel;
pub use tunnel::ServiceOnionServiceDirTunnel;
pub use tunnel::ServiceOnionServiceIntroTunnel;
pub use tunnel::ClientMultiPathDataTunnel;
pub use tunnel::ClientMultiPathOnionServiceDataTunnel;
pub use tunnel::ServiceMultiPathOnionServiceDataTunnel;
pub use usage::TargetPorts;
pub use config::CircMgrConfig;
pub use config::CircuitTiming;
pub use config::CircuitTimingBuilder;
pub use config::PathConfig;
pub use config::PathConfigBuilder;
pub use config::PreemptiveCircuitConfig;
pub use config::PreemptiveCircuitConfigBuilder;
pub(crate) use crate::isolation::StreamIsolation; 🔒
pub(crate) use crate::mgr::TunnelProvenance; 🔒
pub(crate) use crate::preemptive::PreemptiveCircuitPredictor; 🔒
pub(crate) use usage::TargetTunnelUsage; 🔒
pub(crate) use crate::hspool::HsCircKind; 🔒
pub(crate) use crate::hspool::HsCircStemKind; 🔒
pub(crate) use tor_basic_utils::retry::RetryDelay; 🔒
pub(crate) use tor_chanmgr::ChanMgr; 🔒
pub(crate) use tor_dircommon::fallback::FallbackList; 🔒
pub(crate) use error_report; 🔒
pub(crate) use warn_report; 🔒
pub(crate) use tor_guardmgr::RetireCircuits; 🔒
pub(crate) use tor_linkspec::ChanTarget; 🔒
pub(crate) use DirEvent; 🔒
pub(crate) use NetDir; 🔒
pub(crate) use NetDirProvider; 🔒
pub(crate) use Timeliness; 🔒
pub(crate) use tor_proto::circuit::UniqId; 🔒
pub(crate) use tor_proto::client::circuit::CircParameters; 🔒
pub(crate) use tor_rtcompat::Runtime; 🔒
pub(crate) use tor_linkspec::IntoOwnedChanTarget; 🔒
pub(crate) use futures::StreamExt; 🔒
pub(crate) use Arc; 🔒
pub(crate) use Mutex; 🔒
pub(crate) use Weak; 🔒
pub(crate) use std::time::Duration; 🔒
pub(crate) use tor_rtcompat::SpawnExt; 🔒
pub(crate) use debug; 🔒
pub(crate) use info; 🔒
pub(crate) use instrument; 🔒
pub(crate) use instrument; 🔒
pub(crate) use trace; 🔒
pub(crate) use warn; 🔒
pub(crate) use safelog::sensitive as sv; 🔒
pub(crate) use tor_geoip::CountryCode; 🔒
pub(crate) use tor_persist::StateMgr; 🔒
pub(crate) use TaskHandle; 🔒
pub(crate) use TaskSchedule; 🔒
pub(crate) use tor_guardmgr::vanguards::VanguardMgr; 🔒

Modules§

build
Facilities to build circuits directly, instead of via a circuit manager.
config 🔒
Configuration logic for launching a circuit manager.
err 🔒
Declare an error type for tor-circmgr
hspool
Manage a pool of circuits for usage with onion services.
impls 🔒
Implement traits from crate::mgr for the circuit types we use.
isolation
Types related to stream isolation
mgr 🔒
Abstract code to manage a set of tunnels which has underlying circuit(s).
path
Code to construct paths through the Tor network
preemptive 🔒
Tools for determining what circuits to preemptively build.
timeouts
Code for estimating good values for circuit timeouts.
tunnel 🔒
Code related to tunnel object that wraps the tor-proto tunnel.
usage 🔒
Code related to tracking what activities a circuit can be used for.

Structs§

CircMgr
A Circuit Manager (CircMgr) manages a set of circuits, returning them when they’re suitable, and launching them if they don’t already exist.
CircMgrInner 🔒
Internal object used to implement CircMgr, which allows for mocking.
ClockSkewEvents
A stream of SkewEstimate events.
FirstHopId
A unique cryptographic identifier for a selected guard or fallback directory.
SkewEstimate
An estimate of how skewed our clock is, plus a summary of why we think so.
TargetPort
A port that we want to connect to as a client.

Enums§

DirInfo
Represents what we know about the Tor network.
ExternalActivity
An activity that can succeed or fail, and whose success or failure can be attributed to a guard.

Constants§

PARETO_TIMEOUT_DATA_KEY 🔒
Key used to load timeout state information.

Traits§

GuardMgrConfig
Configuration for a guard manager

Type Aliases§

Result
A Result type as returned from this crate.
TimeoutStateHandle 🔒
Type alias for dynamic StorageHandle that can handle our timeout state.