Expand description
Module exposing the relay circuit reactor subsystem.
See reactor for a description of the overall architecture.
All cells moving in the forward direction (i.e. away from the client) are handled by the forward reactor, which deals with
- unrecognized RELAY* cells, by moving them in the forward direction (towards the exit)
- recognized RELAY* cells, by splitting each cell into messages, and handling each message individually as described in the table below (Note: since prop340 is not yet implemented, in practice there is only 1 message per cell).
- DESTROY cells, by tearing down the circuit, and causing a DESTROY to be sent forward, to the next hop, if there is one
- PADDING_NEGOTIATE cells (not yet implemented)
Legend: `F` = "forward reactor", `B` = "backward reactor", `S` = "stream reactor"
`FH` = `ForwardHandler`
| RELAY cmd | Received in | Handled in | Description |
|------------|-------------|-----------------------|----------------------------------------|
| DROP | F | FH::handle_meta_msg() | Passed to PaddingController for |
| | | | validation |
|------------|-------------|-----------------------|----------------------------------------|
| EXTEND2 | F | FH::handle_meta_msg() | Handled by the ExtendRequestHandler |
| | | | See [forward::extend_handler]. |
|------------|-------------|-----------------------|----------------------------------------|
| TRUNCATE | F | FH::handle_meta_msg() | Not supported: TRUNCATE is considered |
| | | | a protocol violation, because none of |
| | | | of our implementations send it. |
|------------|-------------|-----------------------|----------------------------------------|
| SENDME | F | B | Sent to BackwardReactor for handling. |
| (sid = 0) | | | See the [crate::circuit::reactor] docs |
|------------|-------------|-----------------------|----------------------------------------|
| Other | F | FH::handle_meta_msg() | Rejected as unrecognized |
| (sid = 0) | | | |
|------------|-------------|-----------------------|----------------------------------------|
| Other | F | S | Handled in the `StreamReactor` |
| (sid != 0) | | | |Re-exportsΒ§
use std::sync::Arc;πuse std::time::Duration;πuse futures::StreamExt as _;πuse futures::channel::mpsc;πuse tor_cell::chancell::CircId;πuse tor_cell::relaycell::RelayCmd;πuse tor_linkspec::OwnedChanTarget;πuse tor_memquota::mq_queue::ChannelSpec;πuse tor_memquota::mq_queue::MpscSpec;πuse tor_rtcompat::DynTimeProvider;πuse tor_rtcompat::Runtime;πuse crate::channel::Channel;πuse crate::circuit::circhop::ReactorStreamComponents;πuse crate::circuit::circhop::CircHopOutbound;πuse crate::circuit::circhop::HopSettings;πuse crate::circuit::reactor::Reactor as BaseReactor;πuse crate::circuit::reactor::hop_mgr::HopMgr;πuse crate::circuit::reactor::stream;πuse crate::circuit::CircuitRxReceiver;πuse crate::circuit::UniqId;πuse crate::congestion::sendme::StreamRecvWindow;πuse crate::crypto::cell::InboundRelayLayer;πuse crate::crypto::cell::OutboundRelayLayer;πuse crate::memquota::CircuitAccount;πuse crate::memquota::SpecificAccount;πuse crate::relay::RelayCirc;πuse crate::relay::channel_provider::ChannelProvider;πuse crate::relay::reactor::backward::Backward;πuse crate::relay::reactor::forward::Forward;πuse crate::stream::flow_ctrl::state::WithSidechannelMitigations;πuse crate::stream::flow_ctrl::xon_xoff::reader::XonXoffReaderCtrl;πuse crate::stream::incoming::IncomingCmdChecker;πuse crate::stream::incoming::IncomingStream;πuse crate::stream::incoming::IncomingStreamRequestFilter;πuse crate::stream::incoming::IncomingStreamRequestHandler;πuse crate::stream::incoming::StreamReqInfo;πuse crate::stream::raw::StreamReceiver;πuse crate::stream::RECV_WINDOW_INIT;πuse crate::stream::StreamComponents;πuse crate::stream::StreamTarget;πuse crate::stream::Tunnel;πuse crate::client::circuit::padding::PaddingController;πuse crate::client::circuit::padding::PaddingEventStream;π
ModulesΒ§
- backward π
- A relayβs view of the backward (towards the client) state of a circuit.
- forward π
- A relayβs view of the forward (away from the client, towards the exit) state of a circuit.
StructsΒ§
- Reactor π
- The entry point of the circuit reactor subsystem.
- Stream
Handler π - A handler customizing the relay stream reactor.
Type AliasesΒ§
- Relay
Base πReactor - Type-alias for the relay base reactor type.