aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-chanmgr/src/mgr/state
Commit message (Collapse)AuthorAgeFilesLines
* multiple crates: Fix clippy warningshjrgrn2026-07-101-3/+3
|
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+1
| | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* rtmock, chanmgr: Allow use of deprecated try_next() in testsGabriela Moldovan2026-03-031-0/+1
| | | | | | | | futures 0.3.32 has deprecated UnboundedReceiver::try_next() in favor of UnboundedReceiver::try_recv(), but try_recv() was only introduced in 0.3.32, so using it would cause our minimal versions checks to fail (rightfully so, because our code wouldn't build with futures 0.3.x for x < 32).
* chanmgr: Responder relay channel now use the builder my_addrsDavid Goulet2026-02-241-2/+1
| | | | | | No need to pass from the arti relay binary our addresses when handling an incoming channel, use the one in the channel builder that an initiator channel uses.
* tor-chanmgr: add `HasAddrs` bound to `AbstractChannelFactory::BuildSpec`Steven Engler2026-02-111-3/+3
| | | | | This will be needed later so that our channel selection functions can take a `HasAddrs`.
* chanmgr: Make a padding test function non-asyncGabriela Moldovan2026-01-271-3/+2
|
* relay: Pass advertised addresses to the channel handlerDavid Goulet2026-01-221-1/+2
| | | | | | | | | | | We need the advertised addresses for the NETINFO cell when opening a relay channel. Keep them in the TorRelay object so we can pass them to the ChanMgr channel handler. This will also help with config reload where only the local values in TorRelay will need to be updated. Signed-off-by: David Goulet <[email protected]>
* chanmgr: Introduce a ChanMgrConfig structDavid Goulet2026-01-131-1/+1
| | | | | | | | | | | | This struct is used to pass configuration parameters to the ChanMgr when building it. At the moment, it holds the ChannelConfig and RelayIdentities (feature gated) which will be used in subsequent commits. Note that relays do require RelayIdentities to build channels. Signed-off-by: David Goulet <[email protected]>
* Merge branch 'relay-bin-4' into 'main'opara2025-11-111-1/+3
|\ | | | | | | | | arti-relay: Add OR port listener task See merge request tpo/core/arti!3396
| * tor-chanmgr: wrap the peer address in `Sensitive`Steven Engler2025-11-051-1/+3
| | | | | | | | | | For incoming connections, wrap the peer address in `Sensitive` as it could be a client.
* | Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
|/ | | | Run maint/add_warning
* proto: Propagate PaddingCtrl into ChannelSender.Nick Mathewson2025-10-011-7/+37
| | | | We'll need it to tell the channel padder when padding is queued.
* proto: Add ChannelType enumDavid Goulet2025-08-201-1/+1
| | | | | | | | | | | | | | | | 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]>
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-2/+2
| | | | | | | | | | | | | | 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.
* memquota: Change ToplevelAccount to be an alias for Arc<MemoryQuotaTracker>Ian Jackson2024-10-151-1/+2
| | | | Fixes a TODO.
* tor-chanmgr: Make a memquota::ChannelAcocunt per channelIan Jackson2024-10-031-1/+3
| | | | | This delivers a fresh account per channel to the places where channels are actually made, but doesn't pass them to tor-proto yet.
* memquota: Add a toplevel account in tor-chanmgrIan Jackson2024-10-031-0/+2
| | | | | | | | | Plumb through a top-level account. This doesn't have any channel-specific, circuit-specific or stream-specific accounts yet. tor-circmgr's and tor-hsclient's *tests* need fake account. In arti-relay, use a dummy account for now.
* tor-chanmgr: add experimental `ChanMgr::handle_incoming`Steven Engler2024-09-111-0/+10
| | | | | | | | | The channel manager in the future will need to be able to receive incoming streams. The type of the stream depends on an associated type within `ChannelFactory`, so this commit exposes this associated type through several other types, eventually to the `ChanMgr`. The new methods are behind the experimental "relay" feature flag.
* tor-netdir: Allow access to the `ConsensusBuilder` when building test netdirs.Gabriela Moldovan2024-09-091-2/+2
| | | | | This allows us to set SRVs for example (needed because by default, the test `NetDir` is built from a consensus that doesn't contain any SRVs).
* proto: Make Channel explicitly Arc<.>Nick Mathewson2024-05-161-4/+6
| | | | | | | | | | | | | | | | Previously, Channel was a type that you could Clone that implicitly its state. Now, Channel always appears as an Arc<Channel>. This change has several benefits: * It makes the relationship between Channel struct and the underlying channel more clear. * It enables Channel to participate in the RPC system, where everything has to be an Arc<.> * It enables us to have a Weak<Channel>, if we ever want to. * It will let us move various members out of ChannelDetails. We did this change a while ago with ClientCirc.
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* tor-netdir: Update tests to parse the descriptor, make test consensus ↵Gabriela Moldovan2023-05-031-1/+2
| | | | | | lifetime configurable. Signed-off-by: Gabriela Moldovan <[email protected]>
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* tor-chanmgr: Introduce the BootstrapReporter API, publicize ChanBuildereta2022-11-281-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | This commit makes the `ChanBuilder` type in `tor-chanmgr` usable by consumers outside of that crate, like the doc comment for `ChannelFactory` says you need to be able to do in order to turn your `TransportHelper` into something useful. As part of doing this, the `event_sender` its constructor takes needed to be dealt with, since it was a crate-internal type that came from inside the `ChanMgr`. Enter `BootstrapReporter`: an opaque wrapper around that sender, now provided as an additional argument to `ChannelFactory::connect_via_transport`. You can now construct a `ChanBuilder` outside this crate, and it'll still be able to report its bootstrap status by unwrapping this new type that's threaded through from the `ChanMgr`. (This was a fair deal of manually threading the type through all the layers in this crate!) Note that you cannot implement bootstrap updating using something that isn't `ChanBuilder` yet due to the type being entirely opaque (but, of course, we can figure out exactly what API the reporter should have later, and add that capability in).
* ChanMgr: move the AbstractChanFactory into MgrState.Nick Mathewson2022-11-221-0/+1
| | | | | | We will want the freedom to replace this, so it needs to go behind a lock. We need to be able to Clone it cheaply now, so we're using an Arc instead of a Box.
* ChanMgr: Rename map.rs to state.rsNick Mathewson2022-11-161-0/+370
This is another pure renaming.