summaryrefslogtreecommitdiff
path: root/crates/tor-proto/src/channel
Commit message (Collapse)AuthorAgeFilesLines
* async-utils: rename SinkExt to SinkPrepareExtNick Mathewson2023-04-191-1/+1
|
* Move functionality from tor_basic_utils to tor_async_utilsNick Mathewson2023-03-291-1/+1
| | | | | This commit is mostly code movement; I'd recommend reviewing it with git's `--color-moved` option.
* Fix a bunch of needless-conversion warnings.Nick Mathewson2023-03-101-1/+0
| | | | | Apparently 1.68 now warns when you call into_iter() on something that's already an iterator. Fair enough. Let's stop doing that.
* Rename OpenClientChan{Msg,Cell} => OpenChan{Msg,Cell}S2CNick Mathewson2023-02-091-20/+20
|
* tor-proto: Do not parse forbidden commands on inbound cells.Nick Mathewson2023-02-091-84/+28
| | | | | | | | | | Unlike C tor, we treat unrecognized commands as reason to kill off the connection entirely. That's fine; if we need to add an unrecognized command in the future, we can use VERSIONS to negotiate it. Also, if someday we want this code to support relay channels as well, we can use some type trickery to have that work too.
* tor-proto: only parse allowed ChanMsg types during handshake.Nick Mathewson2023-02-092-28/+97
|
* tor-cell: Rename ChanMsg and ChanCell-related types.Nick Mathewson2023-02-073-42/+42
|
* tor-cell: Remove ChanMsg methods that are duplicated in ChanMsgClass.Nick Mathewson2023-02-073-2/+3
|
* tor-cell: Use macro to generate ChanMsg too.Nick Mathewson2023-02-072-3/+3
|
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-273-0/+3
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* tor-proto: rustfmtIan Jackson2023-01-061-1/+2
| | | | Not sure why the tree didn't have this newline already. "Whatever".
* tor-proto: When relay IDs mismatch, the IDs are sensitive in errorsIan Jackson2023-01-061-2/+4
|
* Merge branch 'test-lints' into 'main'eta2023-01-062-0/+17
|\ | | | | | | | | Add test lint blocks to all "mod test" See merge request tpo/core/arti!937
| * test lint blocks: Add many many automaticallyIan Jackson2022-12-122-0/+17
| | | | | | | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* | Use parse_rfc3339() in the tor-proto crateNeel Chauhan2022-12-161-1/+2
| |
* | Merge branch 'err-dyn-report' into 'main'Ian Jackson2022-12-151-1/+1
|\ \ | | | | | | | | | | | | Error logging (ErrorReport, .report()) POC See merge request tpo/core/arti!936
| * | tor-proto: reactor tests: Use debug fmt on an errorIan Jackson2022-12-121-1/+1
| |/ | | | | | | | | | | | | In tests, debug fmt is usually appropriate. Found while looking for a candidate for https://gitlab.torproject.org/tpo/core/arti/-/issues/680
* / Tackling issue #663 (Use humantime in tests)coral2022-12-121-1/+1
|/
* Merge branch 'rename_for_to_from' into 'main'Nick Mathewson2022-10-251-2/+2
|\ | | | | | | | | tor-cell: Rename for_client and for_relay See merge request tpo/core/arti!793
| * tor-cell: Rename for_client and for_relayEmil Engler2022-10-211-2/+2
| | | | | | | | | | | | | | This commit renames the for_client and for_relay functions to from_client and from_relay respectively, in order to indicate their origin, as the term "for" is more likely to indicate a destination, which is not true in that situation.
* | linkspec: Remove now-useless declared_peer_addrNick Mathewson2022-10-241-3/+4
|/ | | | The singleton variation here is almost never what we want.
* Allow "clippy::single_char_pattern" in tests.Ian Jackson2022-10-121-0/+1
| | | | | | | This lint exists for perf reasons, and this is rarely relevant in tests. Using double quoted str is generally cognitively less burdensome.
* Change multiplicity of ChannelMethod and addressesNick Mathewson2022-10-111-2/+2
| | | | | | | Now each `ChanTarget` has at most one `ChannelMethod`, and only `Direct` `ChannelMethods` can have multiple addresses. Closes #600.
* Clarify limits on socket address from ChannelMethodNick Mathewson2022-10-061-2/+2
|
* tor-linkspec: Remove the old OwnedFoo::new() functionsNick Mathewson2022-10-062-5/+15
| | | | These are now builders.
* tor-proto: Preserve the ChannelMethod, not the SocketAddrNick Mathewson2022-10-061-21/+42
|
* add feature annotation not added by doc_auto_cfgtrinity-1686a2022-08-241-0/+1
|
* channel padding: Only do anything with link protocol 5Ian Jackson2022-08-171-0/+7
| | | | | | | Or rather, if we *didn't* negotiate 4, which is too old. As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2828354
* channel padding: Properly advertise link protocol 5Ian Jackson2022-08-171-3/+2
| | | | | | | | | We already actually send and negotiate the padding, since !657, but we ought to negotiate a protocol version where that's not a violation! As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2828354
* channel padding: Move initial config of ChannelPaddingInstructionsIan Jackson2022-08-171-6/+5
| | | | | | | | | | | | | Making ChannelPaddingInstructions::default() accurately reflect the initial state of the reactor's padding timer simplifies the code somewhat. (When padding is wanted, parameters are computed and inserted explicitly, so the only change is that if we start out dormant, we defer setting the timer parameters until necessary.) As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2827249
* channel padding: Parameters: default_padding replaces Default implIan Jackson2022-08-172-1/+7
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2827249
* channel reactor: Add some commented-out debug for paddingIan Jackson2022-08-171-1/+5
|
* channel padding: Correctly always send the timer parametersIan Jackson2022-08-171-1/+8
| | | | Fixes "chanmgr configuration: Avoid sending needless initial update(s)"
* channel padding: Abolish ARTI_EXPERIMENTAL_CHANNEL_PADDING env varIan Jackson2022-08-171-8/+0
| | | | This was for testing and is no longer needed.
* ChannelPaddingInstructions: Update and expand docsIan Jackson2022-08-172-11/+41
|
* ChannelPaddingInstructions: Rename `params` field to `insns`Ian Jackson2022-08-171-6/+6
|
* Rename ChannelsParams types to ChannelPaddingInstructions (fmt)Ian Jackson2022-08-171-1/+4
| | | | Run rustfmt; no other changes.
* Rename ChannelsParams types to ChannelPaddingInstructionsIan Jackson2022-08-172-38/+38
| | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826167 This makes some lines too long; I will run rustfmt in a separate commit for clarity.
* Rename PaddingParameters::all_zeroes constructor to disabledIan Jackson2022-08-171-4/+2
|
* tor-cell: PaddingNegotiate::default_reducedIan Jackson2022-08-171-10/+0
| | | | | | | | | | | Get rid of unneeded constructor. We never need to use hardcoded reduced padding parameters during negotiation cell construction. If we are using reduced padding parameters, the layers which decide this have netparams to use. Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826092
* tor-cell: PaddingNegotiate::start: take IntegerMillisecondsIan Jackson2022-08-171-2/+1
|
* channel: Clarify (and in some places replace) "frontend" terminologyIan Jackson2022-08-172-3/+5
|
* tor-proto channel padding: Document PADDING_NEGOTIATE overwritingIan Jackson2022-08-171-0/+3
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2825979
* channel padding: Rename low_ms and high_msIan Jackson2022-08-171-13/+13
| | | | | These have the unit in the type. Putting that in the field name too is otiose.
* tor-proto, testing: Provide accessors for ChannelsParamsUpdatesIan Jackson2022-08-161-0/+11
|
* tor-proto: Make "testing" feature that exports some thingsIan Jackson2022-08-161-1/+3
| | | | | We are going to want this for through-the-layers padding control testing.
* channel padding: Send negotiation cellsIan Jackson2022-08-162-0/+9
|
* tor-proto channel: Make arrangements to send PADDING_NEGOTIATEIan Jackson2022-08-161-2/+34
| | | | | | | | | | | | | This is actually a general facility for inserting locally-generated cells into the outgoing stream. It doesn't seem to be possible to do this without adding an additional condition check to the reactor, since we need to insert it into the right place in the stream, giving it priority over data, and only using it up if there was room in the output. We don't engage this machinery yet, because nothing sets special_outgoing.
* chanmgr configuration: Avoid sending needless initial update(s)Ian Jackson2022-08-161-5/+6
| | | | | | | | | | | Change ChannelsParams::initial_update to compare fields with their default values, and, if they're the same as the default, not to include them in the returned update. And if that update is then empty, return None. The overall effect is to avoid the call to chan.reparameterize if we're using the builtin default parameters, which is usual.
* channel params: ChannelsParamssUpdates: provide combine()Ian Jackson2022-08-161-0/+13
| | | | | We're going to need this because the frontend is going to need to defer some channel padding parameters updates.