aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-chanmgr/src
Commit message (Collapse)AuthorAgeFilesLines
...
* chanmgr: Remove the Poisoned state from the map type.Nick Mathewson2022-10-182-48/+12
| | | | | | | | The `ByRelayIds` type doesn't have a type equivalent to `hash_map::Entry`, since it's a set type rather than a map type. Therefore, the only plausible way to do entry mutation will be to remove the old entry and insert a new one. And so, we no longer need a "poisoned" state.
* chanmgr: Edit comments, fix docsNick Mathewson2022-10-134-18/+49
|
* chanmgr: Remove RegistryAsFactory.Nick Mathewson2022-10-131-11/+6
| | | | | Since there is no longer a blanket implementation of ChannelFactory for TransportHelper, we no longer need a separate type here.
* ChanMgr: Reorganize factory, builder, transport code.Nick Mathewson2022-10-136-282/+330
| | | | There is no actual code change here: just movement.
* Merge branch 'factory_redux' into 'main'Nick Mathewson2022-10-136-133/+223
|\ | | | | | | | | chanmgr: Build and use chanmgr factory APIs See merge request tpo/core/arti!769
| * Flatten TimeoutChannelFactory into ChannelBuilder.Nick Mathewson2022-10-132-48/+30
| |
| * chanmgr: clean up some TODO pt-client items and documentation.Nick Mathewson2022-10-133-80/+23
| |
| * Allow multiple ChannelBuilders to share a ChanMgrEventSender.Nick Mathewson2022-10-132-4/+9
| |
| * chanmgr: Use ChannelFactory via a Box<dyn<ChannelFactory>>.Nick Mathewson2022-10-132-4/+28
| | | | | | | | | | This will prepare for supporting multiple different ChannelFactory implementations.
| * chanmgr: Move Timeout functionality into a decorator object.Nick Mathewson2022-10-132-12/+51
| |
| * Have ChannelBuilder use TransportHelper.Nick Mathewson2022-10-133-27/+91
| | | | | | | | | | | | This lets us build channels using different TransportHelpers, including the (new) default TransportHelper, which just uses the old connect_to_one() code.
| * Implement ChannelFactory for (a wrapper of) TransportRegistry.Nick Mathewson2022-10-121-1/+23
| | | | | | | | This will let us just have ChanMgr take a `dyn ChannelFactory`.
| * chanmgr: Clean up async-ness on factory types.Nick Mathewson2022-10-121-9/+17
| | | | | | | | | | | | | | | | The traits that launch connections need to be async; the traits that don't, shouldn't be async. Additionally, we need a few more "Sync" annotations here for the futures to work.
| * Rename mgr::ChannelFactory to mgr::AbstractChannelFactoryNick Mathewson2022-10-123-19/+22
| | | | | | | | | | | | | | | | | | This is an internal type (distinct from factory::ChannelFactory) that we use to make the code in `tor_chanmgr::mgr` agnostic about what a channel actually is, and how it is actually launched. Therefore, I'm renaming it and giving better documentation in a couple of places, to prevent confusion.
* | cargo fmt to remove blank linesIan Jackson2022-10-121-1/+0
| | | | | | | | | | | | | | Apparently cargo fmt doesn't like these, which my perl rune didn't delete. This commit is precisely the result of `cargo fmt`.
* | Replace all README copies in src/lib.rs with includesIan Jackson2022-10-121-33/+1
|/ | | | | | | | The feature we want is `#[doc = include_str!("README.md")]`, which is stable since 1.54 and our MSRV is now 1.56. This commit is precisely the result of the following Perl rune: perl -i~ -0777 -pe 's{(^//!(?!.*\@\@).*\n)+}{#![doc = include_str!("../README.md")]\n}m' crates/*/src/lib.rs
* Allow "clippy::single_char_pattern" in tests.Ian Jackson2022-10-123-0/+3
| | | | | | | This lint exists for perf reasons, and this is rarely relevant in tests. Using double quoted str is generally cognitively less burdensome.
* Change multiplicity of ChannelMethod and addressesNick Mathewson2022-10-111-12/+8
| | | | | | | Now each `ChanTarget` has at most one `ChannelMethod`, and only `Direct` `ChannelMethods` can have multiple addresses. Closes #600.
* Allow two useless pattern matches that are going to be not uselessIan Jackson2022-10-111-0/+1
|
* Move two users of HasAddrs to HasChannelMethodsNick Mathewson2022-10-061-2/+11
| | | | All the other users of HasAddrs are correct.
* tor-linkspec: Remove the old OwnedFoo::new() functionsNick Mathewson2022-10-061-1/+8
| | | | These are now builders.
* tor-proto: Preserve the ChannelMethod, not the SocketAddrNick Mathewson2022-10-061-1/+1
|
* Mark all bridge and pt features as experimental for now.Nick Mathewson2022-09-291-0/+17
| | | | | | Also, document the features. Closes #588.
* ChanMgr: new (unimplemented) APIs for pluggable transportsNick Mathewson2022-09-234-0/+150
|
* Improve docs for ChannelUsageNick Mathewson2022-09-221-7/+15
| | | | | | | Try to clarify more that the ChannelUsage is for describing the usage for one particular channel request, not for the channel as a whole. This is a potentially confusing point, so we should spell it out completely.
* tor-chanmgr: don't log addresses so much.Nick Mathewson2022-08-251-2/+3
| | | | | We now log connection attempts at debug!, and mark relay target addresses as sensitive.
* fix nightly lintstrinity-1686a2022-08-241-1/+1
|
* enable doc_auto_cfg feature on every crate when documenting for docs.rstrinity-1686a2022-08-241-0/+1
|
* channel padding: Move initial config of ChannelPaddingInstructionsIan Jackson2022-08-171-1/+1
| | | | | | | | | | | | | Making ChannelPaddingInstructions::default() accurately reflect the initial state of the reactor's padding timer simplifies the code somewhat. (When padding is wanted, parameters are computed and inserted explicitly, so the only change is that if we start out dormant, we defer setting the timer parameters until necessary.) As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2827249
* channel usage: Rename CU::UserTraffic from CU::ExitIan Jackson2022-08-173-19/+31
| | | | | As suggested in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2827246
* chanmgr padding: Correct docs for padding_parameters*Ian Jackson2022-08-171-2/+5
| | | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2827242 These texts were out of date; one of them still mentioned `all_zeroes`.
* Improve comment for ChannelUsage::ExitNick Mathewson2022-08-171-1/+1
|
* Fix typo in commentNick Mathewson2022-08-171-1/+1
|
* tor-chanmgr tests: Fix a minimal-versions failure (actually)Ian Jackson2022-08-171-1/+1
|
* tor-chanmgr tests: Fix a minimal-versions failureIan Jackson2022-08-171-2/+2
|
* channel padding: Correctly always send the timer parametersIan Jackson2022-08-171-5/+5
| | | | Fixes "chanmgr configuration: Avoid sending needless initial update(s)"
* channel engage_padding_activities: swap docs to tor0protoIan Jackson2022-08-171-10/+2
| | | | This allow us to make a working cross-reference.
* Rename ChannelsParams types to ChannelPaddingInstructions (fmt)Ian Jackson2022-08-173-6/+18
| | | | Run rustfmt; no other changes.
* Rename ChannelsParams types to ChannelPaddingInstructionsIan Jackson2022-08-174-20/+20
| | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826167 This makes some lines too long; I will run rustfmt in a separate commit for clarity.
* chanmgr: Fix typoIan Jackson2022-08-171-1/+1
| | | | | Reported here https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826166
* chanmgr parameterize: Correct doc commentIan Jackson2022-08-171-1/+4
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826164
* chamgr NetParamsExtract: Replace direct nf_ito accessIan Jackson2022-08-171-4/+23
| | | | | It turns out that the TryFrom was infallible, which wasn't obvious with the previous code structure.
* Channel: Make mutable() and engage_padding_activities infallibleIan Jackson2022-08-174-12/+7
| | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826151 This gets rid of quite some Bug error paths.
* Move ChannelUsage from tor_proto to tor_chanmgrIan Jackson2022-08-175-15/+54
| | | | | | | | | | | Replace Channel::note_usage with Channel::engage_padding_activities, which unconditionally causes the channel to (start to) do netflow padding things. The condition now lives in chanmgr. Addresses https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826094
* tor-chanmgr: Expand docs for map::Inner dormancy fieldIan Jackson2022-08-171-0/+4
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826093
* chanmgr padding_parameters: Use OptionIan Jackson2022-08-172-40/+41
| | | | | | | | | The network consensus parameters use (0,0) to mean "no padding" (which is not the same as (0,0) means in a PADDING_NEGOTIATE cell). Representing "no padding" this way is actually quite convoluted and un-Rustic. Ensure that we convert (0,0) to None, and do the primary logic in Option.
* chanmgr: padding: Split IEFI into named functionIan Jackson2022-08-171-19/+27
| | | | | | | Roughly as suggested in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826160 IMO this is less clear, because of the way it splits the logic up.
* chanmgr: NetParamsExtract: extend docs for nf_itoIan Jackson2022-08-171-2/+2
|
* chanmgr: Get rid of final Result relating to netdir/netparamsIan Jackson2022-08-172-32/+29
| | | | No functional change. (The error tyep was Void.)
* chanmgr: Use NetDirProvider::params and Arc<dyn..Netparameters>Ian Jackson2022-08-174-85/+92
| | | | | | | | | This gets rid of many Result(). Many parameters are renamed. Test cases of the now-impossible branch are removed. Deleting the match from padding_parameters will come in a moment. I've split off that commit since it has much whitespace noise. for now, change the error type to Void.