aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-proto/src
Commit message (Collapse)AuthorAgeFilesLines
...
* 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: Fix doc links post-refactoringGabriela Moldovan2025-10-212-3/+7
|
* 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: Move StreamMpsc{Sender,Receiver} to stream module (fmt)Gabriela Moldovan2025-10-215-5/+5
|
* proto: Move StreamMpsc{Sender,Receiver} to stream moduleGabriela Moldovan2025-10-218-11/+18
| | | | These will be shared with the relay code.
* 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 hop settings into a shared moduleGabriela Moldovan2025-10-217-306/+328
|
* proto: Move streammap out of the client module (fmt)Gabriela Moldovan2025-10-213-5/+3
|
* proto: Add TODO about future code motionGabriela Moldovan2025-10-211-0/+4
|
* proto: Move halfstream under streammapGabriela Moldovan2025-10-213-3/+4
| | | | | | That way we don't need to make halfstream `pub(crate)` (we only really use it in streammap, and in the client reactor, because of the `handle_msg()` kludge).
* proto: Move streammap out of the client moduleGabriela Moldovan2025-10-2110-13/+15
|
* proto: Move dumb pipes to top-lvl stream module (fmt)Gabriela Moldovan2025-10-217-7/+7
|
* proto: Move dumb pipes to top-lvl stream moduleGabriela Moldovan2025-10-2110-9/+10
|
* proto: Give the relay reactor a stream mapGabriela Moldovan2025-10-213-4/+12
| | | | | | 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.
* Cleanup: Remove a variable renameNick Mathewson2025-10-201-4/+2
|
* Refactor: turn circ_extensions_from_settings into a methodNick Mathewson2025-10-203-63/+62
| | | | Closes #2067.
* proto: Rename data cmd checkers to {Inbound,Outbound}DataCmdChecker (fmt)Gabriela Moldovan2025-10-161-1/+2
|
* proto: Rename data cmd checkers to {Inbound,Outbound}DataCmdCheckerGabriela Moldovan2025-10-167-19/+19
| | | | | | The previous "incoming" terminology was rather ambiguous. Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3348#note_3275337
* proto: Fix docs to refer to the right stream:: paths.Gabriela Moldovan2025-10-162-2/+2
|
* proto: Move IncomingDataCmdChecker to top-level stream module.Gabriela Moldovan2025-10-164-49/+55
| | | | | | | This will be used by relays too (for validating incoming messages on streams). This is just code motion, so it's best reviewed with `--color-moved`.
* proto: Split out DataCmdChecker into multiple types (fmt).Gabriela Moldovan2025-10-161-1/+1
|
* proto: Split out DataCmdChecker into multiple types.Gabriela Moldovan2025-10-163-13/+51
| | | | | | | | | | | The incoming one will be used for the exit relay implementation too. Also, with this change, receiving `CONNECTED` on an incoming stream will result in a clearer error message. Previously, the check against receiving `CONNECTED` on an incoming stream was bundled with the double-CONNECTED check for client data streams, so in the incoming stream case, the error message was misleading ("Received CONNECTED twice on a stream.").
* proto: Do not fully-qualify Arc.Gabriela Moldovan2025-10-161-3/+3
| | | | | `Arc` is already in scope, and not fully-qualifying it makes it more readable.
* proto: Replace fully-qualified paths with use (fmt).Gabriela Moldovan2025-10-162-8/+2
|
* proto: Replace fully-qualified paths with use.Gabriela Moldovan2025-10-162-8/+8
|
* proto: Reformat imports post-move.Gabriela Moldovan2025-10-1610-12/+11
|
* proto: Avoid crate-pub reexports of shared types from the client module.Gabriela Moldovan2025-10-1611-20/+19
| | | | | This makes it easier to see which parts are implementation-agnostic (i.e. do not import from crate::client).
* proto: Move cmdchecker under top-level stream module.Gabriela Moldovan2025-10-163-2/+2
| | | | | The CmdChecker will be used by relays too, so I am moving it to the shared `stream` module.
* Merge branch 'outbound-relay-doc-fix' into 'main'Nick Mathewson2025-10-161-1/+1
|\ | | | | | | | | proto: Fix typo in OutboundRelayLayer docs. See merge request tpo/core/arti!3346
| * proto: Fix typo in OutboundRelayLayer docs.Gabriela Moldovan2025-10-081-1/+1
| | | | | | | | | | `OutboundRelayLayer::decrypt_outbound()` is for decrypting cells moving *away* from the client (in the "forward direction").
* | tor-proto: update unit testSteven Engler2025-10-141-27/+24
| |
* | tor-proto: relax XON limitsSteven Engler2025-10-141-3/+13
| |
* | tor-proto: remove `StreamEndpointType`Steven Engler2025-10-143-31/+12
| |
* | tor-proto: relax XOFF limitsSteven Engler2025-10-141-22/+30
| |
* | tor-proto: add derives for `CellCount`Steven Engler2025-10-141-1/+1
| |
* | Merge branch 'rm-allow' into 'main'Ian Jackson2025-10-141-1/+0
|\ \ | | | | | | | | | | | | proto: Remove an allow that is no longer needed See merge request tpo/core/arti!3356
| * | proto: Remove an allow that is no longer neededGabriela Moldovan2025-10-141-1/+0
| | |
* | | Merge branch 'celltypes' into 'main'gabi-2502025-10-1410-11/+13
|\ \ \ | | | | | | | | | | | | | | | | proto: Move celltypes out of client See merge request tpo/core/arti!3355
| * | | proto: Move celltypes out of clientGabriela Moldovan2025-10-1310-11/+13
| |/ / | | | | | | | | | | | | Some of these are relay-specific, so it makes more sense to pull this into a top-level module.