summaryrefslogtreecommitdiff
path: root/tor-circmgr/src/path/exitpath.rs
Commit message (Collapse)AuthorAgeFilesLines
* More tests and a little code-golf for coverage on tor-circmgrNick Mathewson2021-06-201-0/+20
|
* Fix some warnings about needless & from nightly clippyNick Mathewson2021-06-181-1/+1
|
* more improvements to circmgr tests.Nick Mathewson2021-06-161-0/+3
|
* More tests on circmgr::path.Nick Mathewson2021-06-161-0/+61
|
* Enormous tor-circmgr rewrite.Nick Mathewson2021-06-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As with the tor-chanmgr code, the circuit manager is now implemented using an AbstractCircMgr type that uses traits to abstract the particular behavior of other types that it uses. (Specifically: circuits, building circuits, and telling whether one circuit usage is compatible with another.) Abstracting out the dependencies in this ways makes it possible to test the circuit manager without having to actually build real circuits. This commit also introduces new behavior for handling pending circuit requests. Upon getting a new request, first we check to see if there's an existing circuit we can use. If there isn't, we look for pending circuits and wait for them. If there aren't any pending circuits we can use, we launch one or more, and wait for them. So far, that's the same as the old behavior. But here's a change: if, while we are waiting for some pending circuits, a different circuit is completed, and it's one we could use, then the task that was building _that_ circuit will tell us: "please look at this circuit". This gives us better changes of getting a usable circuit fast. Minor changes: * The Error type in CircMgr no longer uses anyhow; several errors have been simplified. * We've gotten more formal about the relationship between circuit usage and target usage.
* Broaden type of from_target_portsNick Mathewson2021-05-201-2/+2
|
* Refactor TorPath code to have explicit constructors.Alexander Færøy2021-05-201-15/+40
| | | | | | | | | This patch refactors the internal representation of the TorPath type to use an enum for representing its state. We add explicit constructor methods to create the different types of path's, such that client users can write code that uses different paths based on their need. This work was done together with Nick as part of the Arti hackathon.
* Prefer "relay" over "node" in most circumstances.Nick Mathewson2021-05-181-2/+2
|
* Check ipv6 exit policies when trying to connect to an ipv6 port specificallyNick Mathewson2020-12-221-1/+1
|
* Simplification: Every relay is in the same family as itself.Nick Mathewson2020-12-171-7/+2
|
* Make sure that a circuit doesn't use relays in the same familyLunar2020-12-161-3/+7
| | | | | | | | | | | | | We implement `Relay::in_same_family` which is in turn used by `ExitPathBuilder::pick_path` to avoid picking relays in the same family. Compared to the original C implementation, we are missing support for options EnforceDistinctSubnets and NodeFamilySets. This has only been very lightly tested so far. Closes: #43
* Basic support for IPv6 and begin flags.Nick Mathewson2020-12-151-3/+0
| | | | | | We now have a way to tell a circuitmgr whether we require ipv4/ipv6 support for a target address in an exit policy, and we use similar logic to set begin flags.
* Remember the actual usable ports for an exit after we've built a circuitNick Mathewson2020-12-141-5/+5
| | | | | | | | Previously we'd just remember the port that we _wanted_ a circuit for, and forget all the ports that it _could_ support. This is part of a bigger circmgr revision/refactoring pass; there should be cleanups before I merge this.
* Mark some XXXX issues as XXXX-A1.Nick Mathewson2020-12-071-1/+1
|
* Fix typo in pick_path().Alexander Færøy2020-12-051-1/+1
| | | | | | This patch fixes a minor typo in the error case when looking for a middle relay for a 3-hop circuit where the error message should say "No middle relay found" and not "No exit relay found".
* Implement correct (?) weighting for path selection.Nick Mathewson2020-12-021-18/+5
|
* Add support for using fallback directories in path constructionNick Mathewson2020-11-191-4/+8
| | | | | | This is mainly a refactoring commit, with a little new code. It also adds #[derive(Copy,Clone)] for a few types.
* Document tor-circmgrNick Mathewson2020-11-021-0/+10
|
* Add a new circuit-manager crate and move path selection there.Nick Mathewson2020-11-021-0/+53