| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
| |
This removes some duplication.
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
Previously we always set `dir_info_missing` to `false` for new
guards, since new guards could only be taken from ones that were
present in the NetDir. But for bridges, we don't download their
info until _after_ we have chosen them as guards.
|
| |
|
|
|
| |
Now we can use a group of bridges as the basis for a sample of
guards.
|
| |
|
|
| |
This will be necessary for bridges.
|
| |
|
|
| |
This is a trickier case, since we have to deal with weights.
|
| |
|
|
| |
Two more simple cases that can use Universe instead of Netdir.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this and the upcoming commits I'll be changing how guards related
to `NetDir` and to `Relay`. Previously, a guard could only come
from (or be updated from) a `Relay` in a `NetDir`. Soon it will be
able to be built from a bridge as well.
To do this, I'm defining a `Universe` trait (name negotiable) that
represents a set of things that may be guards. I'm going to
continue extending its functionality until there are no more
methods in guard.rs or sample.rs that take `NetDir`.
This commit removes most of the usage of `NetDir` and `Relay` in
`guard.rs`.
|
| | |
|
| | |
|
| |
|
|
|
| |
Use a vector, since we may (someday) want to allow a Guard to have
multiple PtTargets.
|
| |\
| |
| |
| |
| | |
Use ByRelayIds to hold guards in GuardSet
See merge request tpo/core/arti!808
|
| | |
| |
| |
| | |
These will need a bigger overhaul: see #612 and #611.
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
This has subtleties; the comments try to explain them.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
This is necessary for the (somewhat undesirable) lookup_ids function
to return an ID that the dirmgr can actually use to report successes
and failures.
As noted, lookup_ids will create problems down the road when we
implement relays. We should refactor it out before then.
|
| | |
| |
| |
| |
| |
| | |
To see if we can add a relay as a guard, we need a conservative
test: any IDs in common with the given relay prevent us from adding
it.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This required a number of changes, which I've tried to document.
I've taken a conservative approach to modification, and I'm not
using any of the by_*_mut() functions (yet). For cases which
potentially modify the whole set, I'm using into_values() and
collect() to ensure that it's re-indexed correctly, even though the
identities don't change.
I introduce some "TODO pt-client" comments here which I will resolve
in the next commit(s).
|
| | | |
|
| | |
| |
| |
| | |
This will enable us to impl FlagEvent for it.
|
| | |
| |
| |
| |
| | |
The bridge descriptor manager wants to index data structures by the
BridgeConfig.
|
| | | |
|
| |/
|
|
| |
And explain what this all means.
|
| |\
| |
| |
| |
| | |
Allow GuardMgr to expose bridges as guards (part 1)
See merge request tpo/core/arti!785
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Now it contains either an `OwnedChanTarget` or an `OwnedCircTarget`,
which will let `GuardMgr` return bridges that can be used to make
circuits.
As part of this change, it was necessary to revise some
address-modification functions that applied to filters and
`OwnedChanTarget`. Now they do the smart thing, and remove only the
address that are in the `ChanMethod`. This means that the addresses
from HasAddrs are still accurate about which addresses the relay
"has".
|
| | |
| |
| |
| | |
This resolves an old TODO, and will simplify our work a little.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The most important part of this commit is to make sure that each
`FirstHopId` includes the `GuardSetSelector` from which the guard
was selected. Doing this lets us be certain that when we report
that a guard has succeeded or failed, we're reporting it in the
right context.
Additionally, this commit uses strum to make an iterator over the
samples, so that we can make sure that our "for each sample" code is
robust against future changes, and we don't miss the bridge sample.
|
| | | |
|
| |/ |
|
| |\
| |
| |
| |
| | |
Use BridgeConfig to identify bridges in two places
See merge request tpo/core/arti!781
|
| | |
| |
| |
| |
| |
| |
| | |
Now keyed by Arc<BridgeConfig>, and the values can be errors.
Currently there is no implementation so there can't be any errors,
but the error enum will become nonempty.
|
| |/ |
|
| | |
|
| |\
| |
| |
| |
| |
| |
| | |
Abolish maint/readme and use doc include
Closes #603
See merge request tpo/core/arti!768
|
| | |
| |
| |
| |
| |
| |
| | |
Apparently cargo fmt doesn't like these, which my perl rune didn't
delete.
This commit is precisely the result of `cargo fmt`.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
| |
| |
| | |
Fixes #599
|
| |/ |
|
| |
|
|
|
| |
Callers could `use` it as `tor_guardmgr::config::BridgeParseError` but
it seems unecessary to force them to.
|
| |
|
|
|
|
|
| |
This lint exists for perf reasons, and this is rarely relevant in
tests.
Using double quoted str is generally cognitively less burdensome.
|
| |
|
|
|
|
|
| |
Now each `ChanTarget` has at most one `ChannelMethod`, and only
`Direct` `ChannelMethods` can have multiple addresses.
Closes #600.
|
| | |
|
| |
|
|
| |
These are now builders.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
HasAddr used to mean "Here are addresses that I have, at which I can
be contacted." But "Where (and how) can I be contacted?" is now a
question for HasChannelMethod to answer.
(We still need to have "HasAddr", though, so we can answer things
like "what country is this relay in" and "are these relays in the
same /8?")
So this commit introduces:
* A new trait for adding an implementation of HasChannelMethod in
terms of HasAddr.
* A requirement on ChanTarget that it needs to implement
HasChannelMethod.
There is some temporary breakage here, marked with "TODO pt-client",
that I'll fix later in this branch.
|
| |\
| |
| |
| |
| | |
Start implementing more data structures to hold Bridge descriptors.
See merge request tpo/core/arti!755
|
| | | |
|
| | |
| |
| |
| | |
See comment for an explanation of the next issue here.
|