summaryrefslogtreecommitdiff
path: root/crates/tor-circmgr/src/usage.rs
Commit message (Collapse)AuthorAgeFilesLines
* Remove allow(clippy::disallowed_methods) lint.Nick Mathewson2022-03-301-2/+0
|
* Merge branch 'no-system-time' into 'main'eta2022-03-301-7/+13
|\ | | | | | | | | | | | | Don't use SystemTime::now() Closes #306 See merge request tpo/core/arti!365
| * use wallclock where possible in teststrinity-1686a2022-02-261-0/+2
| |
| * fix teststrinity-1686a2022-02-251-4/+6
| |
| * remove most usage of SystemTime::nowtrinity-1686a2022-02-251-3/+5
| |
* | remove usage of 'token' where it's no longer a tokentrinity-1686a2022-03-271-1/+1
| |
* | implement IsolationHelper for StreamIsolationtrinity-1686a2022-03-251-3/+3
| | | | | | | | but don't use it in a dyn Isolation context
* | move StreamIsolation to isolation moduletrinity-1686a2022-03-241-101/+2
| |
* | move isolation in separate moduletrinity-1686a2022-03-241-323/+2
| |
* | seal trait Isolationtrinity-1686a2022-03-241-1/+11
| |
* | rename *_isolation_group to *_isolationtrinity-1686a2022-03-241-2/+2
| |
* | Expand documentation for isolation traitsNick Mathewson2022-03-171-7/+63
| | | | | | | | | | | | | | These aren't complete yet; I'm just making this commit to capture the notes we took on a pad when we were discussing these APIs. Part of #414.
* | Alternative API for set_isolation_group().Nick Mathewson2022-03-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | Instead of requiring a `Box<dyn Isolation>`, it now takes either a `Box<dyn Isolation>`, or an arbitrary `T` that implements `Isolation`. This API still allows the user to pass in a `Box<dyn Isolation>` if that's what they have, but it doesn't require them to Box the isolation on their own. Part of #414.
* | add trait to help test isolation related codetrinity-1686a2022-03-161-21/+127
| |
* | add tests on Isolation and fix conditional compilation issuestrinity-1686a2022-03-161-0/+58
| | | | | | | | | | | | it seems I added conditional compilation without noticing it?? and there was some errors when choosing a prefered runtime depending on feature flags
* | refactor restrict_muttrinity-1686a2022-03-161-14/+15
| |
* | replace Arc with Box and use dyn-clonetrinity-1686a2022-03-161-43/+24
| | | | | | | | this also removes JoinResult
* | add some documentation for new traitstrinity-1686a2022-03-161-12/+18
| |
* | replace isolated with compatibletrinity-1686a2022-03-161-13/+13
| | | | | | | | the inverted logic was too easy to mess up
* | use downcast-rs instead of our own AsAnytrinity-1686a2022-03-161-15/+3
| |
* | fix existing teststrinity-1686a2022-03-161-36/+42
| |
* | add a join() on Isolationtrinity-1686a2022-03-161-4/+65
| |
* | testing new api for isolationTrinity Pointard2022-03-161-9/+67
|/
* Add kinds for *most* circmgr errors.Nick Mathewson2022-02-161-3/+4
| | | | There are a couple of tricky ones I'll do separately.
* Tests for TargetPorts::display()Nick Mathewson2022-02-041-1/+12
|
* tor-circmgr: Introduce TargetPorts with a pretty Display implIan Jackson2022-02-041-1/+34
|
* tor-circmgr: impl Display for TargetPortIan Jackson2022-02-041-0/+7
| | | | This will be used for error handling, and perhaps other things.
* StreamPrefs: rename from ConnectPrefsIan Jackson2022-01-211-3/+3
| | | | | | | | | | | | | The docs even say this is about stream. As @nickm writes in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/252#note_2771289 we generally call end-to-end connections that are tunneled over Tor "Streams" to distinguish them from everything else in the Tor protocols that could possibly be called a "Connection". That seems to apply here too.
* Allow configurability on preemptive circuitsNeel Chauhan2021-12-071-5/+8
|
* Merge remote-tracking branch 'origin/mr/154'Nick Mathewson2021-11-301-4/+77
|\
| * Add tests & address review commentaryeta2021-11-301-15/+28
| |
| * Actually build preemptive circuits (and minor fixes)eta2021-11-291-0/+7
| | | | | | | | | | | | The new CircMgr::build_circuits_preemptively function actually causes preemptive circuits to be built; it gets called from arti-client, like the other daemon tasks the CircMgr has.
| * Introduce PreemptiveCircuitPredictor and TargetCircUsage::Preemptiveeta2021-11-231-1/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In preparation for making Arti build circuits preemptively, this commit introduces `TargetCircUsage::Preemptive`, a circuit usage that works somewhat differently from other ones: it requires at least 2 circuits to exist that can exit the port it contains in order for an existing circuit to match against it (path-spec.txt § 2.1.1); if that's not the case, that usage will require building new circuits (in order that we build enough to have 2 available). This required refactoring how circuit reuse worked; now, `CircList::find_open` uses the new `AbstractSpec::find_supported` trait method, which we customize to implement the above check in the case of `Preemptive` circuit usages. To make that work, `OpenEntry` now takes two type parameters (the spec and circuit types), instead of taking a builder type parameter and using its associated types. (We also got rid of type constraints on that struct, yay!) A WIP implementation of a preemptive circuit predictor that implements path-spec.txt § 2.1.1 is also included, but this will require additional effort to wire it up with the `CircMgr` properly.
* | tor-circmgr: Write a test for BadExit support.Neel Chauhan2021-11-291-6/+20
|/
* Fix typosDimitris Apostolou2021-11-121-1/+1
|
* tor-circmgr: testing for NoUsage and TimeoutTesting usageNick Mathewson2021-11-021-0/+24
| | | | This doesn't add much to coverage, but it's important.
* tor-circmgr: tests for netwoks with no exitsNick Mathewson2021-11-021-25/+45
|
* tor-circmgr::usage: Add a few more tests.Nick Mathewson2021-11-021-2/+66
|
* Improve docs of more (potentially re-exported) arti-client typeseta2021-10-291-3/+37
| | | | | | | | | | | | | | | | | | | | | Most of the structs in `arti-client` have example code now, to give a clearer idea of how they're used. Annoyingly, a lot of the types exposed in `arti-client` are actually re-exports, which makes documentation a bit harder: example code that references other parts of `arti-client` can't actually be run as a doctest, since the crate it's in is a dependency of `arti-client`. We might be able to fix this in future by doing the documentation in `arti-client` itself, but rustdoc seems to have some weird behaviours there that need to be investigated first (for example, it seems to merge the re-export and original documentation, and also put the re-export documentation on the `impl` block for some reason). For now, though, this commit just writes the docs from the point of view of an `arti-client` consumer, removing notes specific to the crate in which they're defined. It's not ideal, but at least the end user experience is decent.
* Turn StreamIsolation into a separate type.Nick Mathewson2021-10-251-33/+88
| | | | | | | | | Now that we have two kinds of isolation tokens (those set on a stream, and those set by the stream's associated TorClient), we need a more sophisticated kind of isolation. This fixes the bug introduced with the previous commit, where per-stream tokens would override per-TorClient tokens.
* Replace references to arti-client in the documentation.Nick Mathewson2021-10-211-2/+2
|
* Implement guards for multihop paths.Nick Mathewson2021-10-131-5/+5
| | | | There are some limitations here, as noted in the comments.
* Actually select guards for directory circuits.Nick Mathewson2021-10-131-2/+2
|
* Pass the guard manager down to the path selection functions.Nick Mathewson2021-10-111-5/+10
|
* WIPNick Mathewson2021-10-111-5/+7
|
* Integrate GuardUsability and GuardMonitor into CircuitBuilder.Nick Mathewson2021-10-101-7/+14
| | | | | | (When we're building a path with a guard, we need to tell the guard manager whether the path succeeded, and we need to wait to hear whether the guard is usable.)
* Re-export configuration types from tor-client.Nick Mathewson2021-10-091-0/+5
|
* fix/silence clippy lints in test modulesDaniel Eades2021-09-081-0/+1
|
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+487
This will cause some pain for now, but now is really the best time to do this kind of thing.