summaryrefslogtreecommitdiff
path: root/crates/tor-proto/src/util.rs
Commit message (Collapse)AuthorAgeFilesLines
* Revert "proto: Add a new ToRelayMsg util"Gabriela Moldovan2026-02-121-1/+0
| | | | | | | | | | This reverts commit 04ab3cd848d7977baf58dd64ebfcad6aa54ecb17. Reverted because we no longer need to "peek" into the opaque `CircChanMsg` of a circuit reactor: now the implementation-dependent part of the reactor is in charge of handling the channel messages, and extracting `Relay` objects out of RELAY/RELAY_EARLY cells, which then get processed in the base reactor.
* proto: Add a new ToRelayMsg utilGabriela Moldovan2026-01-291-0/+1
| | | | | | | | | This will be used in a future commit, inside the new generic circuit reactor. We need it because RELAY cells are handled very similarly, so we need some way of finding out if a given generic chancell is actually a RELAY cell that we can handle in an implementation-agnostic way.
* proto: Move TimeoutEstimator to utilGabriela Moldovan2026-01-291-0/+1
| | | | | This will be used in the stream reactor too (and the stream reactor will eventually replace the corresponding client impl).
* tor-proto: Track information on when tunnels were last usedNick Mathewson2025-11-121-0/+1
| | | | This is part of an implementation for proposal 368.
* proto: Add PollAll helper for driving futures in lockstep.Gabriela Moldovan2025-09-251-0/+1
|
* proto: Use the CBT to compute half-stream timeouts.Gabriela Moldovan2025-09-161-0/+14
|
* proto: Define a new composable SinkBlocker type.Nick Mathewson2025-09-041-0/+1
| | | | | | | | This type wraps a futures::Sink, and allows it to be temporarily blocked and unblocked. I'm going to use this to implement padding-based circuit blocking, according to the designs in !3225.
* tor-proto: add `Notify{Sender,Receiver}` channelSteven Engler2025-06-231-0/+1
| | | | | | An async notification channel. This uses `postage::watch::{Sender,Receiver}` internally.
* tor-proto: add a `TokenBucket`Steven Engler2025-06-051-0/+1
|
* tor-proto: add 'oneshot_broadcast' util moduleSteven Engler2024-12-101-0/+1
|
* tor-proto: Plumb the ChannelAccount through to queue creation siteIan Jackson2024-10-031-0/+9
| | | | | This gets it as far as the outbound circuit->channel mpsc queue creation. Also, we provide an accessor for it.
* Add StreamPollSetJim Newsome2024-08-011-0/+1
|
* Add KeyedFuturesUnorderedJim Newsome2024-08-011-0/+1
|
* Implmeent SometimesUnboundedSinkIan Jackson2024-05-291-0/+1
|
* ChannelSender::poll_ready_unpin_bool: add otiose ext trait docIan Jackson2024-05-291-0/+1
|
* ChannelSender::poll_ready_unpin_bool: move to utilIan Jackson2024-05-291-0/+23
| | | | This is where it belongs.
* tor-proto: add a backend to detect reported clock skew.Nick Mathewson2022-03-231-0/+1
| | | | | | | | | | | | | | | | NETINFO cells, which are sent in every handshake, may contain timestamps. This patch adds an accessor for the timestamp in the Netinfo messages, and teaches the tor-proto code how to compute the minimum clock skew in the code. The computation isn't terribly precise, but it doesn't need to be: Tor should work fine if your clock is accurate to within a few hours. This patch also notes a Y2038 problem in the protocol: see torspec#80. Part of #405.
* Make coarsetime dependency and traffic-timestamping non-optional.Nick Mathewson2022-02-251-1/+0
| | | | | | | | | | | | | | Previously coarsetime and the traffic-timestamp feature were enabled, since they were only required for a small corner of the guardmgr algorithm. But in 1.0 and beyond we'll be adding a bunch of other features (eg, netflow padding, DoS prevention) that will need coarsetime all over the place. And since we're going to be doing coarsetime all over the place, the previous justification for making traffic-timestamping optional (the tiny performance hit) is no longer relevant.
* Use coarsetime to build an incoming traffic timestamp.Nick Mathewson2021-11-021-0/+2
| | | | | | | | | | | | | | | | We need this for the circuit timeout estimator (#57). It needs to know "how recently have we got some incoming traffic", so that it can tell whether a circuit has truly timed out, or whether the entire network is down. I'm implementing this with coarsetime, since we need to update these in response to every single incoming cell, and we need the timestamp operation to be _fast_. (This reinstates an earlier commit, f30b2280, which I reverted because we didn't need it at the time.) Closes #179.
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+4
This will cause some pain for now, but now is really the best time to do this kind of thing.