summaryrefslogtreecommitdiff
path: root/crates/tor-proto
Commit message (Collapse)AuthorAgeFilesLines
...
* | proto: Add restricted channel message setsDavid Goulet2025-08-202-3/+211
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the msg.rs file containing all the allowed message sets based on the channel type and direction. They are also namespaced by link protocol version. Unused at this commit. They will be used by the channel reactor along the channel type and link protocol version in order to know if the message is allowed or not. See is_allowed() helper function in this commit. Part of #1597 Signed-off-by: David Goulet <[email protected]>
* | proto: Add ChannelType enumDavid Goulet2025-08-203-10/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ChannelType indicates the type of channel in order to dictate which message is allowed on it. The value use the Initiator and Responder terminology from tor-spec documents. At this commit, we only have client channel meaning the "ClientInitiator" type. In future commits, the channel type will be used by the channel reactor to restrict which message is allowed or not. Part of #1597 Signed-off-by: David Goulet <[email protected]>
* | chan: Rename channel launch to launch_clientDavid Goulet2025-08-202-2/+3
|/ | | | Signed-off-by: David Goulet <[email protected]>
* tor-proto: add comments to `CC_XOFF_CLIENT`Steven Engler2025-08-181-0/+29
| | | | | | This tries to explain that the amount of incoming data we choose to buffer on an arti stream doesn't really matter for arti's socks proxy, since the amount of data buffered by the kernel is significantly higher.
* misc: cleanup now that `_report!` macros support fieldsSteven Engler2025-08-181-3/+2
|
* tor-proto: report tunnel/channel id as a fieldSteven Engler2025-08-182-4/+4
| | | | This restores the pre-374889d34aa0 behaviour.
* Merge branch 'relay-reactor-placeholder' into 'main'David Goulet2025-08-1842-143/+472
|\ | | | | | | | | proto: Add a placeholder for the relay reactor. See merge request tpo/core/arti!3162
| * proto: Reformat a paragraph in the README.Gabriela Moldovan2025-08-181-5/+5
| | | | | | | | Wraps an overly-long line for consistency.
| * proto: Update README with new DataStream path.Gabriela Moldovan2025-08-181-1/+1
| |
| * proto: Fix tests post-crate reorg (fmt).Gabriela Moldovan2025-08-182-2/+2
| |
| * proto: Fix tests post-crate reorg.Gabriela Moldovan2025-08-182-2/+2
| |
| * 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: Move the `stream` module under `client` (fmt).Gabriela Moldovan2025-08-188-20/+20
| |
| * proto: Move the `stream` module under `client` (breaking).Gabriela Moldovan2025-08-1821-38/+40
| | | | | | | | | | | | | | | | | | | | | | | | The `stream` module is client-specific, for the most part, so I am moving it under `client`. Later on, we will factor out the parts that can be shared with the relay implementation. Note: this is a breaking change as the deleted `stream` module was `pub`. We could've kept the module and reexported from it the public types from `tor_proto::client::stream`, but I think it's better to have this `client` namespacing, because it makes the separation between the client and relay parts clearer.
| * proto: Rename the `tunnel` module to `client` (fmt).Gabriela Moldovan2025-08-1816-46/+46
| |
| * proto: Rename the `tunnel` module to `client`.Gabriela Moldovan2025-08-1836-96/+95
| | | | | | | | | | | | 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-184-15/+17
| | | | | | | | | | | | | | 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
| * proto: Add a placeholder for the relay reactor.Gabriela Moldovan2025-08-181-0/+231
| | | | | | | | | | | | | | | | | | | | This is a placeholder, and will likely change quite a bit in the near future. In particular, much of this is copied from the client tunnel reactor (a future change will refactor both of them to reduce/minimize code duplication). I'm adding this placeholder because the channel code will soon need the ability to create and launch circuit reactors.
| * proto: Make unwrap_or_shutdown pub(crate).Gabriela Moldovan2025-08-181-0/+6
| | | | | | | | We will soon need this in the relay reactor.
| * proto: Add a ChannelProvider trait.Gabriela Moldovan2025-08-183-0/+74
| | | | | | | | Part of #1447
| * proto: Add a new relay_tunnel module.Gabriela Moldovan2025-08-182-0/+13
| | | | | | | | | | | | | | The new relay tunnel reactor will live in this module for now. This is temporary, as I expect we will soon need to reorganize this crate a little bit, to more clearly separate the client-specific parts from the relay ones.
| * proto: Add an experimental relay feature.Gabriela Moldovan2025-08-151-0/+2
| | | | | | | | | | The relay-specific logic, including the new relay tunnel/circuit reactor, will be gated behind this feature.
* | Merge branch 'fix-nightly-warn' into 'main'Nick Mathewson2025-08-183-3/+0
|\ \ | |/ |/| | | | | Fix clippy errors on nightly See merge request tpo/core/arti!3148
| * clippy: fix `clippy::duplicated_attributes` warningsSteven Engler2025-08-113-3/+0
| | | | | | | | | | | | | | | | | | | | ```text warning: duplicated attribute --> crates/tor-hsservice/src/timeout_track.rs:630:14 | 630 | #![allow(clippy::needless_pass_by_value)] // TODO hoist into standard lint block | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ```
* | proto: Consolidate all send_unbounded() calls in send_msg().Gabriela Moldovan2025-08-131-2/+1
|/ | | | | | | | | This replaces a `send_unbounded()` call with `send_msg()`. Now `send_msg()` is the only place where we call `send_unbounded()` in the tunnel reactor, which makes it a bit easier to see which callsites have the potential to cause buffering in the channel sink. Prompted by #2112
* tor-proto: use error report in tunnel/channel reactorSteven Engler2025-08-073-18/+31
|
* tor-proto: fix failing cargo fmtSteven Engler2025-08-071-1/+1
|
* Merge branch 'enable-cgo' into 'main'Nick Mathewson2025-08-075-53/+35
|\ | | | | | | | | Enable counter-galois onion negotiation and make it work. See merge request tpo/core/arti!3133
| * proto: In CircuitExtender, derive relay crypt protocol from settings.Nick Mathewson2025-08-072-40/+25
| | | | | | | | | | | | | | | | | | This change fixes a CGO bug: when extending circuits with ntorv3, we were never actually using CGO encryption for the newly constructed layer. This change also simplifies the code a bit, by un-parameterizing CircuitExtender a bit.
| * proto: List CGO-related features in supported_client_protocolsNick Mathewson2025-08-061-3/+9
| |
| * proto: Make CGO feature require CCNick Mathewson2025-08-061-1/+1
| | | | | | | | (We can't negotiate the one without the other.)
| * proto: remove code that had disabled CGO.Nick Mathewson2025-08-061-9/+0
| | | | | | | | Now that we can negotiate CC, we can negotiate CGO.
* | Revert confusing change to use of StreamExt::into_futureNick Mathewson2025-08-071-2/+5
| | | | | | | | | | We're not sure why `cargo fix` did this, but it doesn't seem necessary.
* | Fix warnings and errors from edition 2024.Nick Mathewson2025-08-072-5/+8
| | | | | | | | | | | | | | | | | | | | The two main causes of errors were: - Since some of the lifetime rules have changed, we no longer need to do as many "bind a variable and immediately return it" patterns, and so clippy now warns about them. - We needed to adjust the explicit captures (`use<...>`) in a couple of our RPIT instances.
* | Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-0755-184/+237
| | | | | | | | | | | | | | | | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* | Update code for Edition 2024Nick Mathewson2025-08-0710-14/+13
|/ | | | | | | | | | | | | | | | | | 1. Run cargo fix --edition 2. Selectively revert the "if let"->"match" changes. These changes are meant to protect us from the lifetime changes for "if let" bindings in Rust 2024. But we're not actually relying on the old lifetime rules anywhere, and the match syntax here is quite ugly. 3. Automatically revert `$pat:expr_2021` to `$pat:expr`. (We don't actually want to restrict the expression syntax that our macros accept). Done with `git grep -l expr_2021 | xargs perl -i -pe 's/expr_2021/expr/g;'` 4. Run cargo fmt.
* tor_proto: add FLOWCTRL_CC to supported_client_protocolsNick Mathewson2025-08-061-5/+15
| | | | | Since we now allow it to be turned on, we can include it among our supported protocols.
* Merge branch 'msrv-1.85' into 'main'Nick Mathewson2025-08-051-2/+2
|\ | | | | | | | | | | | | Bump MSRV to Rust 1.85 Closes #2095 See merge request tpo/core/arti!3128
| * Bump to hex-literal 1.0Nick Mathewson2025-08-051-1/+1
| | | | | | | | | | (We were unable to do this before, since it required a rust version we didn't have.)
| * Set MSRV to 1.85.Nick Mathewson2025-08-051-1/+1
| |
* | tor-proto: make stream recv queues unbounded if "flowctl-cc" enabledSteven Engler2025-08-055-15/+54
|/
* Merge branch 'use-cc' into 'main'Nick Mathewson2025-08-051-11/+0
|\ | | | | | | | | Use congestion control when "flowctl-cc" is enabled See merge request tpo/core/arti!3118
| * tor-proto: use congestion control when "flowctl-cc" is enabledSteven Engler2025-08-041-11/+0
| |
* | test: Fix build issues likely due to past rebase conflictsDavid Goulet2025-08-051-1/+2
| | | | | | | | Signed-off-by: David Goulet <[email protected]>
* | proto: Deferred fmtGabriela Moldovan2025-08-052-4/+3
| |
* | conflux: Adjust docs and fix doc links.Gabriela Moldovan2025-08-056-18/+18
| |
* | proto: abolish path_ref() in favor of all_paths().Gabriela Moldovan2025-08-052-24/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | Until now, we've been using `ClientCirc::path_ref()` to get the *only* path of a circuit. Now that `ClientCirc` is a handle to a tunnel reactor (which may or may not be multi-path), we need to decide for each call site of `path_ref()`, if we actually want *all* paths in the tunnel, or if we expect the tunnel to be single-path and thus want the *only* path in the tunnel. I've added two new APIs to address this: `all_paths()`, for getting all the paths in the tunnel, and `single_path()` for getting the only path in the tunnel, or an error if the tunnel is single-path.
* | proto: Use UserMsgHandler instead of MsgHandler throughout.Gabriela Moldovan2025-08-051-8/+8
| |
* | proto: Make UserMsgHandler pub if send-control-msg is enabled.Gabriela Moldovan2025-08-051-0/+1
| | | | | | | | | | When the `send-control-msg` feature is enabled, we reexport it from `tor-proto`, so it needs to be made `pub`.
* | proto, circmgr: Fix feature-gating.Gabriela Moldovan2025-08-051-1/+2
| |