Loading crates/tor-proto/Cargo.toml +2 −1 Original line number Diff line number Diff line Loading @@ -40,8 +40,9 @@ full = [ "caret/full", ] experimental = ["experimental-api", "ntor_v3", "stream-ctrl", "testing", "bench"] experimental = ["experimental-api", "ntor_v3", "conflux", "stream-ctrl", "testing", "bench"] ntor_v3 = ["__is_experimental"] conflux = ["__is_experimental"] hs-client = ["hs-common"] hs-service = ["hs-common"] Loading crates/tor-proto/src/tunnel.rs +32 −1 Original line number Diff line number Diff line Loading @@ -17,12 +17,43 @@ use crate::crypto::cell::HopNum; use crate::{Error, Result}; use circuit::ClientCirc; use circuit::{handshake, StreamMpscSender, CIRCUIT_BUFFER_SIZE}; use reactor::CtrlMsg; use reactor::{CtrlMsg, LegId}; use tor_async_utils::SinkCloseChannel as _; use tor_cell::relaycell::msg::AnyRelayMsg; use tor_cell::relaycell::StreamId; // TODO(#1857): Make this pub and not `allow(dead_code)`. /// A precise position in a tunnel. #[allow(dead_code)] #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub(crate) enum HopLocation { /// A specific position in a tunnel. #[cfg(not(feature = "conflux"))] Hop(HopNum), /// A specific position in a tunnel. #[cfg(feature = "conflux")] Leg((LegId, HopNum)), /// The join point of a multi-path tunnel. #[cfg(feature = "conflux")] JoinPoint, } // TODO(#1857): Make this pub and not `allow(dead_code)`. /// A position in a tunnel. #[allow(dead_code)] #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub(crate) enum TargetHop { /// A specific position in a tunnel. Hop(HopLocation), /// The last hop of a tunnel. /// /// This should be used only when you don't care about what specific hop is used. /// Some tunnels may be extended or truncated, /// which means that the "last hop" may change at any time. LastHop, } /// Internal handle, used to implement a stream on a particular circuit. /// /// The reader and the writer for a stream should hold a `StreamTarget` for the stream; Loading crates/tor-proto/src/tunnel/reactor.rs +1 −0 Original line number Diff line number Diff line Loading @@ -430,6 +430,7 @@ pub(super) enum MetaCellDisposition { // // TODO(#1857): make this pub #[allow(unused)] #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub(crate) struct LegId(pub(crate) LegIdKey); slotmap_careful::new_key_type! { Loading Loading
crates/tor-proto/Cargo.toml +2 −1 Original line number Diff line number Diff line Loading @@ -40,8 +40,9 @@ full = [ "caret/full", ] experimental = ["experimental-api", "ntor_v3", "stream-ctrl", "testing", "bench"] experimental = ["experimental-api", "ntor_v3", "conflux", "stream-ctrl", "testing", "bench"] ntor_v3 = ["__is_experimental"] conflux = ["__is_experimental"] hs-client = ["hs-common"] hs-service = ["hs-common"] Loading
crates/tor-proto/src/tunnel.rs +32 −1 Original line number Diff line number Diff line Loading @@ -17,12 +17,43 @@ use crate::crypto::cell::HopNum; use crate::{Error, Result}; use circuit::ClientCirc; use circuit::{handshake, StreamMpscSender, CIRCUIT_BUFFER_SIZE}; use reactor::CtrlMsg; use reactor::{CtrlMsg, LegId}; use tor_async_utils::SinkCloseChannel as _; use tor_cell::relaycell::msg::AnyRelayMsg; use tor_cell::relaycell::StreamId; // TODO(#1857): Make this pub and not `allow(dead_code)`. /// A precise position in a tunnel. #[allow(dead_code)] #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub(crate) enum HopLocation { /// A specific position in a tunnel. #[cfg(not(feature = "conflux"))] Hop(HopNum), /// A specific position in a tunnel. #[cfg(feature = "conflux")] Leg((LegId, HopNum)), /// The join point of a multi-path tunnel. #[cfg(feature = "conflux")] JoinPoint, } // TODO(#1857): Make this pub and not `allow(dead_code)`. /// A position in a tunnel. #[allow(dead_code)] #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub(crate) enum TargetHop { /// A specific position in a tunnel. Hop(HopLocation), /// The last hop of a tunnel. /// /// This should be used only when you don't care about what specific hop is used. /// Some tunnels may be extended or truncated, /// which means that the "last hop" may change at any time. LastHop, } /// Internal handle, used to implement a stream on a particular circuit. /// /// The reader and the writer for a stream should hold a `StreamTarget` for the stream; Loading
crates/tor-proto/src/tunnel/reactor.rs +1 −0 Original line number Diff line number Diff line Loading @@ -430,6 +430,7 @@ pub(super) enum MetaCellDisposition { // // TODO(#1857): make this pub #[allow(unused)] #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub(crate) struct LegId(pub(crate) LegIdKey); slotmap_careful::new_key_type! { Loading