aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-proto/src/relay
Commit message (Collapse)AuthorAgeFilesLines
...
* proto: Move StreamMap split closer to cell_tx docsGabriela Moldovan2025-10-211-3/+5
| | | | This also clarifies why we reroute cells to `BackwardReactor`.
* proto: s/inbound_rx/input for consistency with other reactorsGabriela Moldovan2025-10-211-2/+2
| | | | | Things will get very confusing if every reactor uses different variable names for this, so I am renaming it back to input.
* proto: Move channel provider to ForwardReactorGabriela Moldovan2025-10-213-18/+18
| | | | | | | | The channel provider is used to request outgoing channels from the `ChanMgr` in response to `EXTEND`/`EXTEND2` cells, so it belongs in the `ForwardReactor`. (This was leftover from the old circ reactor architecture)
* proto: Remove no longer needed MutexGabriela Moldovan2025-10-211-7/+5
|
* proto: Remove stray words from docsGabriela Moldovan2025-10-211-1/+1
|
* proto: Disambiguate "channel" and "stream"Gabriela Moldovan2025-10-213-52/+52
|
* proto: Say why there are two reactors instead of just oneGabriela Moldovan2025-10-211-0/+23
|
* proto: Clarify why we may need to forward cells to BackwardReactorGabriela Moldovan2025-10-211-2/+3
|
* proto: Fix docs post-renamingGabriela Moldovan2025-10-211-3/+3
|
* proto: Avoid calling BackwardReactor "primary"Gabriela Moldovan2025-10-211-5/+1
|
* proto: Replace select_biased! with PollAllGabriela Moldovan2025-10-211-32/+124
| | | | | This is the first step towards parallelizing stream reads and writes.
* proto: Replace placeholder () with stream id and msgGabriela Moldovan2025-10-213-8/+16
| | | | | This makes it a bit clearer that `cell_rx` is for moving stream data between `ForwardReactor` and `BackwardReactor`.
* proto: Replace inbound/outbound terminologyGabriela Moldovan2025-10-212-42/+42
| | | | The forward/backward terminology is clearer.
* proto: Write a debug log when the reactor startsGabriela Moldovan2025-10-211-2/+12
|
* proto: Restrict the visibility of BackwardReactorGabriela Moldovan2025-10-211-3/+3
| | | | | BackwardReactor is not meant to be used directly (the channel reactor is supposed to use the `RelayReactor` wrapper instead).
* proto: Move BackwardReactor to its own moduleGabriela Moldovan2025-10-212-443/+466
| | | | | `BackwardReactor` now exists alongside `ForwardReactor`, to make it clearer that they are siblings.
* proto: Add a constructor for BackwardReactorGabriela Moldovan2025-10-211-16/+54
| | | | | We are about to need this, because BackwardReactor will be moved to another module, and we want to keep its internals private.
* proto: Remove no-longer needed Runtime argumentGabriela Moldovan2025-10-211-13/+5
| | | | | | | This is no longer used, and not having it makes the code less generic and easier to read, so I'm removing it for now. If we ever need it again, we can add it back.
* proto: Replace RelayReactor type-alias with structGabriela Moldovan2025-10-211-23/+32
| | | | | | This is the first step towards making `ForwardReactor` and `BackwardReactor` be siblings (rather than being in a primary-subordinate relationship).
* proto: Add spaces in docs to satisfy clippyGabriela Moldovan2025-10-211-3/+3
|
* proto: Add a basic implementation for the relay reactor(s)Gabriela Moldovan2025-10-212-37/+695
| | | | | | | | | | | | | | | | | | | | | This sketches out the "dual" relay reactor implementation, which has: * a `ForwardReactor`, which forwards cells from the client to the exit * a `BackwardReactor`, which deals with streams, control messages, and forwarding cells from the exit to the client The `BackwardReactor` is actually the "primary" reactor. It's the interface we expose to the channel reactor (via the `RelayReactor` type-alias), and it is in charge of spawning the "secondary" `ForwardReactor` task (via its `run()` function). See the module-level docs from `tor_proto::relay::reactor` for more details on the inner workings of the two reactors. This commit also adds the incomplete skeleton of the circuit extension logic. Once #1599 is implemented, we'll be able to uncomment the commented code, or replace it, depending on what the corresponding channel reactor APIs look like.
* proto: Remove explicit returns to appease clippyGabriela Moldovan2025-10-211-6/+5
|
* proto: Boilerplate for control command handlingGabriela Moldovan2025-10-211-7/+29
| | | | | We only have one command right now (`Shutdown`), so this is mostly just boilerplate.
* proto: s/channel_id/circ_idGabriela Moldovan2025-10-211-1/+1
|
* proto: Replace DynTimeProvider with RuntimeGabriela Moldovan2025-10-211-7/+9
| | | | | We will need a handle to the runtime to spawn the "secondary" reactor from the main one.
* proto: Require that chan_provider is SendGabriela Moldovan2025-10-211-2/+2
|
* proto: Use a broadcast channel for the shutdown handleGabriela Moldovan2025-10-211-5/+6
| | | | | | There will soon be multiple systems that need to be notified of reactor shut down, so it's time to change this to a channel type with a cloneable receiver.
* proto: remove extraneous blank lineGabriela Moldovan2025-10-211-1/+0
|
* proto: Remove silly TODO about outgoing chan mgmtGabriela Moldovan2025-10-211-3/+1
| | | | | | The TODO is silly, because there will be no "outgoing channel map". There will be at most *one* outgoing channel, and that is represented by `Option<Outbound>`.
* proto: Move streammap out of the client moduleGabriela Moldovan2025-10-211-2/+1
|
* proto: Give the relay reactor a stream mapGabriela Moldovan2025-10-211-1/+9
| | | | | | We need it for exits and leaky pipe. Part of #2212
* proto: Rename RelayReactor to BackwardReactorGabriela Moldovan2025-10-211-5/+15
| | | | | | | | | "Backward" because this reactor will deal with relaying cells in the backward direction (from exit to client). In addition, this reactor will deal with stream handling and control/command messages. We will soon have another, "forward", reactor, relaying cells in the forward direction.
* proto: Stop using tunnel IDs in relay reactor.Gabriela Moldovan2025-10-131-13/+30
| | | | | | | | | | | | Using a tunnel ID here doesn't make much sense right now, because we don't yet support exit-side conflux (and when we will, it's unclear whether the concept of "tunnel" will be applicable, especially if we refactor things such that multi-path circuits are handled without a ConfluxSet-like type like we have for clients). This change forces us to stop using the client-specific `unwrap_or_shutdown` (because this macro expects `self` to have a tunnel ID), but IMO that is okay.
* proto: Move TunnelId to a separate, shared module (fmt).Gabriela Moldovan2025-08-281-1/+1
|
* proto: Move TunnelId to a separate, shared module.Gabriela Moldovan2025-08-282-2/+2
| | | | | | | | | | | | | The `TunnelId*` types will be reused in the relay reactor (exit relays need to have the concept of a "tunnel ID" because of conflux). Now the `relay::reactor` module only has a single import from `client` (for the `unwrap_or_shutdown` helper, which we should be able to remove soon). From now, we will avoid importing anything from `client` in the `relay` module, and instead prefer refactoring the code as needed (to pull the implementation-agnostic parts outside of `client`). This commit has no functional changes, just code motion.
* proto: Add a circuit module shared between client and relay impls.Gabriela Moldovan2025-08-281-1/+1
| | | | | | | This is just code motion (I suggest reviewing with `--color-moved`). This also moves the implementation-agnostic parts from `tor_proto::client::circuit` to a new `tor_proto::circuit` module.
* proto: Avoid calling the relay reactor a tunnel reactor.Gabriela Moldovan2025-08-181-3/+3
| | | | | A "tunnel" is a higher level concept we'll want to avoid using from now on when talking about the proto implementation.
* proto: Rename the `tunnel` module to `client` (fmt).Gabriela Moldovan2025-08-181-1/+1
|
* proto: Rename the `tunnel` module to `client`.Gabriela Moldovan2025-08-182-4/+4
| | | | | | The implementation from `tunnel` is client-specific, so we are renaming the module accordingly. The more generic parts will be pulled into a separate module in a future commit.
* proto: Reorganize relay_tunnel module.Gabriela Moldovan2025-08-182-0/+301
This reorganizes the `relay_tunnel` module as per @dgoulet's [suggestion]. [suggestion]: https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3162/diffs#note_3240092