Nick Mathewson
7d5829b0a8
netdir: remove interior mutability.
2020-11-04 11:32:12 -05:00
Nick Mathewson
6120a2ceac
circmgr: Make sure circmgr can be shared among threads
2020-11-04 11:31:39 -05:00
Nick Mathewson
d658532f84
chanmgr: Make sure chanmgr can be shared among threads
2020-11-04 11:30:57 -05:00
Nick Mathewson
7128c14f49
Make 'netdir' no longer a field in circmgr.
2020-11-02 14:25:49 -05:00
Nick Mathewson
80b70881af
Add a tiny bit of cleanup logic to tor-circmgr
2020-11-02 14:21:14 -05:00
Nick Mathewson
8ab8c52193
Document tor-circmgr
2020-11-02 14:11:31 -05:00
Nick Mathewson
7d2b2391ab
Implement rudimentary circuit-manager functionality
...
This code is meant to "get or launch a circuit as appropriate."
It's super dodgy, but it is probably good enough for a first pass.
2020-11-02 11:54:02 -05:00
Nick Mathewson
d9dafa0a28
Add a new circuit-manager crate and move path selection there.
2020-11-02 10:44:31 -05:00
Nick Mathewson
f6b5386ee7
Add missing testing.rs file
2020-10-30 16:30:44 -04:00
Nick Mathewson
fbbc14d4fb
Tests for tor-chanmgr.
2020-10-30 15:45:53 -04:00
Nick Mathewson
8d8ce482c9
chanmgr: don't return closing channels.
2020-10-30 09:51:52 -04:00
Nick Mathewson
d0a18a65c5
Use chanmgr in client-demo
2020-10-30 09:51:52 -04:00
Nick Mathewson
f399851bcf
Implement a channel-manager type to get or launch channels on request.
2020-10-30 09:51:31 -04:00
Nick Mathewson
67e39450fb
Remove duplication of ipaddr argument in handshake.
2020-10-29 17:03:12 -04:00
Nick Mathewson
0db18afa39
tor-cell: In netinfo, unspecified addresses are None.
2020-10-29 17:03:12 -04:00
Nick Mathewson
f8d526a85a
Function to check whether a channel matches a target.
2020-10-29 17:03:12 -04:00
Nick Mathewson
4cf972d69b
tor-proto API: Use new_ref, not clone.
...
Semantically, cloning a Channel or Circuit is actually increasing an
internal reference count. We should name the functions to reflect
that, to be more explicit about what we're doing.
2020-10-29 12:11:36 -04:00
Nick Mathewson
06675c180c
update the TODO
2020-10-27 14:58:34 -04:00
Nick Mathewson
5989b843cc
Add a simple test for stream creation.
2020-10-27 14:40:23 -04:00
Nick Mathewson
705d9c061f
Add a test for extending a circuit with ntor.
2020-10-27 14:26:22 -04:00
Nick Mathewson
911185ec38
circuit: test meta-cell receiving
2020-10-27 13:41:31 -04:00
Nick Mathewson
b90ca2acd7
Downgrade an XXXXM3 message.
2020-10-27 13:11:57 -04:00
Nick Mathewson
f8e1e6976f
Unify interface for detecting stream close.
2020-10-27 13:09:17 -04:00
Nick Mathewson
4cded7a05a
Add a test for sending a cell.
2020-10-27 13:03:39 -04:00
Nick Mathewson
8f5d239c21
Expand test to handle building circuit with ntor.
2020-10-27 12:23:18 -04:00
Nick Mathewson
483425ba4b
Make a test for create_firsthop_fast. WOW that was hard.
2020-10-27 11:55:24 -04:00
Nick Mathewson
dcf0936396
Make circuit reactors also have a run_once() method for testing.
2020-10-27 11:54:11 -04:00
Nick Mathewson
5bd85e57ec
Add a fake, reactorless channel, for use in testing circuits
2020-10-27 10:16:05 -04:00
Nick Mathewson
e2f7fe3827
Remove use of Cell<> in tor_proto.
...
I was confused about what this was for, I guess.
2020-10-27 10:14:28 -04:00
Nick Mathewson
94042b60b8
Rename CircIDRange to CircIdRange
2020-10-27 09:51:28 -04:00
Nick Mathewson
ee9ad7f59d
Run "cargo upgrade".
2020-10-26 14:56:06 -04:00
Nick Mathewson
b93e4b76c8
Remove a bunch of dbg! calls.
2020-10-26 14:33:14 -04:00
Nick Mathewson
a796f7bf6a
Use event_listener to find out about sendme replenishment.
...
Previously we would fail if a sendme window was exhausted and two
tasks were waiting for it to be replenished at the same time.
2020-10-26 14:25:46 -04:00
Nick Mathewson
4348faff3c
Resolve a bunch of XXXM3 comments in tor-proto.
2020-10-26 14:03:25 -04:00
Nick Mathewson
4d9c08669e
Improve documentation in tor-proto
2020-10-26 13:08:46 -04:00
Nick Mathewson
d3b71bc177
More documentation in tor-netdoc.
2020-10-26 11:51:53 -04:00
Nick Mathewson
94231230b0
Improve documentation in tor-cell
2020-10-26 11:51:11 -04:00
Nick Mathewson
db94abadcc
rudimentary test for channelbuilder.
2020-10-26 09:29:59 -04:00
Nick Mathewson
1b86818085
Tests for sending bad/good cell types on a channel
2020-10-26 09:23:42 -04:00
Nick Mathewson
498bc3633d
Clean up some XXXXs in channel::reactor.rs
2020-10-26 09:23:10 -04:00
Nick Mathewson
6d6cff5176
Tests for receving incoming DESTROY cell.
2020-10-26 09:06:52 -04:00
Nick Mathewson
937d924b0a
channel::reactor: Tests for handling incoming RELAY cells
2020-10-26 09:06:52 -04:00
Nick Mathewson
46c991a087
Test for rejecting CREATED cells
2020-10-26 09:06:52 -04:00
Nick Mathewson
494c4679b5
Add a CircEnt::DestroySent circuit state.
...
A circuit enters DestroySent after it's sent a DESTROY cell. We use
this state to make sure that we don't receive too many cells on a
destroyed circuit, _and_ so that we don't block such cells
completely.
2020-10-26 09:06:52 -04:00
Nick Mathewson
32b025de1d
Use better return type in advance_from_opening
2020-10-25 23:37:25 -04:00
Nick Mathewson
8c09981427
Use from_bytes name for Ed25519Identity
2020-10-25 20:32:47 -04:00
Nick Mathewson
fa01a50f32
Rename CircID and StreamID to end with Id instead, for consistency
2020-10-25 20:29:01 -04:00
Nick Mathewson
fbf200ae6f
Add some tests for channel reactor and related code.
2020-10-25 15:09:06 -04:00
Nick Mathewson
0e91d97f76
Add a test for running and shutting down reactors.
...
This took a long time since I needed to learn about futures and
executors, but I think it'll work out okay.
2020-10-25 14:12:51 -04:00
Nick Mathewson
e20bfaab0f
channel: Refactor the point when we split the framed codec.
...
We used to do this during creating the channel in Channel::new, but
now we do it one step before, so that it's easier to construct
channels for testing.
2020-10-25 12:42:53 -04:00