aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-guardmgr/src
Commit message (Collapse)AuthorAgeFilesLines
...
| * Document Clone semantics of GuardMgr and DirMgrIan Jackson2022-11-111-0/+1
| |
| * cfg-ify an importIan Jackson2022-11-111-0/+1
| |
* | GuardMgr: Explain why we timestamp BridgeSets as we do.Nick Mathewson2022-11-102-10/+12
| |
* | GuardMgr: Downgrade a pt-client TODO about an internal APINick Mathewson2022-11-101-2/+4
| |
* | GuardMgr Document why a BridgeSet has trivial weight thresholds.Nick Mathewson2022-11-102-3/+4
| | | | | | | | | | | | This is the only way I could find in which parameter interpretation differs between bridge guards and relay guards; with it documented, I can remove a TODO about identifying such ways.
* | GuardMgr: once more, fix our n_primary_dir_info check.Nick Mathewson2022-11-101-3/+25
| | | | | | | | | | Have the check only apply to non-bridge universes, and explain why in a bunch more comments.
* | GuardMgr: remove redundant call to extend_sample_as_neededNick Mathewson2022-11-102-32/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we would call extend_sample_as_needed in only two places, one of which called the other unconditionally. That's obviously not necessary. I've selected just one of them (`update_guardset_internal`) since it fits better with the theme if that function. I've added comments explaining what is going on. This commit also introduces a yes/no enum for "were any guards added while extending this set". Formerly we had a boolean, but it got passed around so many times that I think its intent became obscure.
* | GuardMgr: rename n_primary_without_dir_infoNick Mathewson2022-11-102-7/+12
| | | | | | | | | | | | | | | | | | | | | | What this function actually does is return the number of primary guards whose presence (by identity) is ambiguous in a current universe. The new name and documentation should help avoid confusion. The method's old name had led me astray when identifying whether it should apply to bridges in one case. This commit also removes the corresponding `TODO pt-client`.
* | Remove TODO to rename for_circuit_usage in favor of #623Nick Mathewson2022-11-101-1/+0
| |
* | GuardMgr: Remove TODO to move `mod bridge` to another crateNick Mathewson2022-11-101-3/+0
| | | | | | | | The code seems happy enough here for now.
* | Resolve todo!()s and TODOs around BridgeRelay::HasAddrs.Nick Mathewson2022-11-101-15/+35
| | | | | | | | | | | | | | Also, add a bunch of reminders around these implementations that `HasAddrs` returns all the address associated with you for GeoIp or family purposes, even if they are _not_ ones that we should actually contact you at.
* | GuardMgr: Docs for BridgeDescProviderNick Mathewson2022-11-081-2/+12
| |
* | GuardMgr: Remove a TODO pt-client comment.Nick Mathewson2022-11-081-2/+0
|/ | | | | The BridgeSet type does not necessarily need further changes... and if it gets them, it won't be because of this comment.
* Merge branch 'store' into 'main'Nick Mathewson2022-11-081-2/+2
|\ | | | | | | | | | | | | Persistently cache bridge descriptors Closes #619 See merge request tpo/core/arti!831
| * bridge descs: Rename BridgeDescMgr from BridgeDescManagerIan Jackson2022-11-081-2/+2
| | | | | | | | | | | | This is more consistent with our naming elsewhere. Suggested-by: Nick Mathewson <[email protected]>
* | Try to explain exactly what lookup_bridge_circ_target doesNick Mathewson2022-11-081-0/+11
| |
* | GuardMgr: Try to explain what is going on with update()Nick Mathewson2022-11-081-10/+45
| | | | | | | | | | | | | | | | | | | | This explanation is slightly complicated by the fact that I think that one of the calls to update_guardset_internal() is possibly unnecessary, and that one of the calls that it makes is potentially ill-advised. I'm not going to make those changes right now, however, because they are potentially a little destabilizing.
* | Refactor configured_bridgesNick Mathewson2022-11-081-30/+42
| | | | | | | | | | | | | | Now it is an Option, and is set to None if bridges aren't enabled. This simplifies `replace_bridge_config` a bit, and forces us to check for `None` in a few more places.
* | GuardMgr: Document that providers should only be installed once.Nick Mathewson2022-11-081-0/+14
| | | | | | | | Enforce this with assert!() and a documented panics section.
* | GuardMgr: Fix build with bridge-client disabled.Nick Mathewson2022-11-082-1/+4
| |
* | GuardMgr: Remove no-longer-relevant `TODO pt-client` commentsNick Mathewson2022-11-084-21/+0
| | | | | | | | | | Also remove a bunch of now-unnecessary `allow(dead_code)` annotations.
* | GuardMgr: Rename an error variantNick Mathewson2022-11-081-2/+2
| |
* | GuardMgr: Spelling fixes and normalizations.Nick Mathewson2022-11-084-7/+8
| |
* | GuardMgr: do not use fallbacks when in bridge mode.Nick Mathewson2022-11-081-5/+5
| |
* | GuardMgr: When possible, return a FirstHop that can be a CircTargetNick Mathewson2022-11-083-5/+29
| | | | | | | | | | | | We do this by checking the FirstHops we're about to return, and when they correspond to bridges, looking up an appropriate BridgeRelay in the current BridgeSet (if we can).
* | GuardMgr: Refactor UniverseRef to contains Arcs.Nick Mathewson2022-11-083-27/+31
| | | | | | | | | | | | We already _have_ these Arc<>s whenever we construct a UniverseRef, so there's no real point in using &refs and making these so hard to construct.
* | GuardMgr: Remove an outdated "Limitations" comment.Nick Mathewson2022-11-081-10/+0
| | | | | | | | Found while grepping for NetDir.
* | GuardMgr: do not block netdir if we are using bridgesNick Mathewson2022-11-081-0/+4
| | | | | | | | | | | | | | The `GuardMgr` code has functionality to tell the DirMgr "Hey, don't switch to the new NetDir yet: we still need more guard information!" But we never want to do that if we're selecting bridges, since they don't come from the NetDir.
* | GuardMgr: Add UniverseType to make code more explicit.Nick Mathewson2022-11-081-7/+28
| | | | | | | | | | | | Instead of duplicating the logic about which guard sample uses which universe, we explicitly ask it, and then use that universe. This will avoid trouble if/when we introduce more samples.
* | GuardMgr: Launch a background task to keep the list of bridgeNick Mathewson2022-11-082-1/+38
| | | | | | | | descriptors updated as appropriate.
* | GuardMgr: Exit keep-netdir-updated task early if GuardMgr disappears.Nick Mathewson2022-11-081-0/+2
| |
* | GuardMgr: Pass correct universe to "Bridges" `GuardSet`.Nick Mathewson2022-11-084-15/+115
| | | | | | | | | | | | This can probably be done in a simpler way, but for the moment I would prefer to try to minimize the amount of code I'm changing here.
* | GuardMgr: Change BridgeSet, BridgeRelay to use more referencesNick Mathewson2022-11-082-29/+27
| | | | | | | | | | | | | | This will match our needs better and help avoid some `Arc<>`s. It will be especially helpful for avoiding `Arc`s we don't actually have.
* | GuardMgr: Store bridge configuration.Nick Mathewson2022-11-081-15/+56
| | | | | | | | | | | | | | | | | | | | I'm using an Arc<[]> here though I think that there's a chance that a simple Vec<> would suffice. Since it's an internal type, nothing will break if we change it later. Also, we now switch into and out of the Bridges guard sample as needed. However, that selection is not (yet) built from the list of bridges. That will come soon.
* | GuardMgr: Remove duplicate code in set_filterNick Mathewson2022-11-081-13/+2
| |
* | GuardMgr: Clarify intent with update_active_set.Nick Mathewson2022-11-081-4/+5
| | | | | | | | Also fix its behavior when using bridges.
* | GuardMgr: Split `update_internal` into two functions.Nick Mathewson2022-11-081-27/+50
| | | | | | | | | | | | The first part changes which guard set is active based on based on the parameters, which always come from a NetDir; the second changes the contents of the active guard set, based on a Universe.
* | Refactor external guardmgr APIs: Stop taking NetDir arguments.Nick Mathewson2022-11-082-59/+44
| | | | | | | | | | | | | | | | | | These arguments were used only for legacy (testing) purposes; the tests now use `TestNetDirProvider`. This lets us simplify our internal logic for passing a `NetDir` to our samples, and prepare for having a `BridgeSet` to pass there instead. This is a breaking change to `guardmgr` and `circmgr`.
* | Add an accessor for the latest BridgeDescList.Nick Mathewson2022-11-081-0/+12
| |
* | Implement GuardMgr::install_bridge_desc_providerNick Mathewson2022-11-081-6/+25
| |
* | Require Send+Sync for BridgeDescProviderNick Mathewson2022-11-081-1/+1
| | | | | | | | We require these for NetDirProvider, so this shouldn't be a big reach.
* | bridge desc: Make BridgeDescProvider DynCloneIan Jackson2022-11-071-1/+3
| | | | | | | | | | This allows the use of Box<dyn BridgeDescProvider> in callers, since Box<dyn BridgeDescProvider> is now Clone.
* | Fix typosDimitris Apostolou2022-11-061-2/+2
|/
* Merge branch 'warning' into 'main'Nick Mathewson2022-11-031-1/+1
|\ | | | | | | | | tor-guardmgr: use imported WeightThreshold in one place See merge request tpo/core/arti!825
| * tor-guardmgr: use imported WeightThreshold in one placeIan Jackson2022-11-031-1/+1
| | | | | | | | | | Without this, an unused import warning is generated when building without features.
* | guardmgr config: Provide bridge information to new and reconfigureIan Jackson2022-11-032-1/+25
| |
* | bridges config: Provide uninhabited placeholderIan Jackson2022-11-031-0/+14
| | | | | | | | | | This will avoid having to make bridge-related trait features in GuardMgr conditional, which would be non-additive.
* | guardmgr config: Introduce and require new GuardMgrConfig traitIan Jackson2022-11-032-11/+64
| | | | | | | | | | It doesn't seem to me like it makes sense to provide the backward compatibility here.
* | guardmgr config: Pass fallback list from config by referenceIan Jackson2022-11-032-11/+11
|/ | | | | This does involve additional cloning. However, soon it will mean that we can pass the whole `TorClientConfig` by reference.
* Run add_warnings.Nick Mathewson2022-11-031-0/+1
|