summaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
| * chanmgr parameterize: Correct doc commentIan Jackson2022-08-171-1/+4
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826164
| * Rename PaddingParameters::all_zeroes constructor to disabledIan Jackson2022-08-171-4/+2
| |
| * chamgr NetParamsExtract: Replace direct nf_ito accessIan Jackson2022-08-171-4/+23
| | | | | | | | | | It turns out that the TryFrom was infallible, which wasn't obvious with the previous code structure.
| * Channel: Make mutable() and engage_padding_activities infallibleIan Jackson2022-08-175-18/+12
| | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826151 This gets rid of quite some Bug error paths.
| * Move ChannelUsage from tor_proto to tor_chanmgrIan Jackson2022-08-179-76/+85
| | | | | | | | | | | | | | | | | | | | | | Replace Channel::note_usage with Channel::engage_padding_activities, which unconditionally causes the channel to (start to) do netflow padding things. The condition now lives in chanmgr. Addresses https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826094
| * tor-chanmgr: Expand docs for map::Inner dormancy fieldIan Jackson2022-08-171-0/+4
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826093
| * 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-174-6/+9
| |
| * chanmgr padding_parameters: Use OptionIan Jackson2022-08-172-40/+41
| | | | | | | | | | | | | | | | | | The network consensus parameters use (0,0) to mean "no padding" (which is not the same as (0,0) means in a PADDING_NEGOTIATE cell). Representing "no padding" this way is actually quite convoluted and un-Rustic. Ensure that we convert (0,0) to None, and do the primary logic in Option.
| * tor-cell: PaddingNegotiate: give better spec xrefsIan Jackson2022-08-171-0/+6
| |
| * channel: Clarify (and in some places replace) "frontend" terminologyIan Jackson2022-08-173-7/+10
| |
| * 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
| * chanmgr: padding: Split IEFI into named functionIan Jackson2022-08-171-19/+27
| | | | | | | | | | | | | | Roughly as suggested in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826160 IMO this is less clear, because of the way it splits the logic up.
| * chanmgr: NetParamsExtract: extend docs for nf_itoIan Jackson2022-08-171-2/+2
| |
| * chanmgr: Get rid of final Result relating to netdir/netparamsIan Jackson2022-08-172-32/+29
| | | | | | | | No functional change. (The error tyep was Void.)
| * chanmgr: Use NetDirProvider::params and Arc<dyn..Netparameters>Ian Jackson2022-08-177-91/+100
| | | | | | | | | | | | | | | | | | This gets rid of many Result(). Many parameters are renamed. Test cases of the now-impossible branch are removed. Deleting the match from padding_parameters will come in a moment. I've split off that commit since it has much whitespace noise. for now, change the error type to Void.
| * chanmgr: Add a TODO for renaming NetDirExtractIan Jackson2022-08-171-0/+3
| |
| * chanmgr ChannelUsage: Fix and clarify docsIan Jackson2022-08-171-2/+3
| |
| * chanmgr set_dormancy: Remove obsolete commentIan Jackson2022-08-171-4/+0
| |
| * chanmgr: Extend doc comments for DormancyIan Jackson2022-08-171-0/+6
| | | | | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2825962
| * Fix typos in comments.eta2022-08-172-2/+2
| |
| * channel padding: Rename low_ms and high_msIan Jackson2022-08-174-23/+27
| | | | | | | | | | These have the unit in the type. Putting that in the field name too is otiose.
| * channel padding: Test through most of the layersIan Jackson2022-08-173-0/+366
| |
| * chanmgr testing: FakeChannel: retain the ChannelsParamsUpdatesIan Jackson2022-08-161-1/+4
| |
| * tor-proto, testing: Provide accessors for ChannelsParamsUpdatesIan Jackson2022-08-161-0/+11
| |
| * tor-proto, testing: Provide new_fake_channelIan Jackson2022-08-161-0/+22
| | | | | | | | To test the padding control we will want this.
| * tor-proto, testing: Make fake_channel_details availableIan Jackson2022-08-161-16/+18
| | | | | | | | Now it's not just cfg(test), but feature testing.
| * tor-proto: Make "testing" feature that exports some thingsIan Jackson2022-08-164-5/+26
| | | | | | | | | | We are going to want this for through-the-layers padding control testing.
| * tor-cell, testing: Provide PaddingNegotiate::from_rawIan Jackson2022-08-161-0/+8
| | | | | | | | | | This allows test cases to describe precisely the contents of the negotiation cell ought to be generated.
| * tor-netdir, testnet: Provide construct_custom_netdir_with_paramsIan Jackson2022-08-161-2/+16
| | | | | | | | | | We're going to want this for testing netdirs with padding parameters that diff ere from the spec's default.
| * tor-netdoc: NetParams: impl FromIteratorIan Jackson2022-08-161-0/+8
| | | | | | | | | | Otherwise a caller who has a set of parameters must open-code the loop.
| * channel padding: Send negotiation cellsIan Jackson2022-08-165-9/+68
| |
| * tor-proto channel: Make arrangements to send PADDING_NEGOTIATEIan Jackson2022-08-162-2/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * channel padding: Send padding iff requiredIan Jackson2022-08-161-11/+13
| | | | | | | | | | | | | | | | | | | | Now all the information is plumbed to the right place, and we can actually decide if we're sending padding. Additionally, we conditionalise sending timing parameters on whether padding is actually enabled, so in dormant mode we do not generate updates (broadcast to all channels) just to reconfigure unused timing parameters.
| * chanmgr configuration: Avoid sending needless initial update(s)Ian Jackson2022-08-162-7/+11
| | | | | | | | | | | | | | | | | | | | | | 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.
| * chanmgr configuration: Initialise correctlyIan Jackson2022-08-161-2/+7
| | | | | | | | | | | | This arranges that the ChannelsParams we have retain, and which we send to every newly created channel, actually has the right parameters, even if they're not the default.
| * chanmgr configuration: Break out parameterizeIan Jackson2022-08-161-8/+40
| | | | | | | | | | | | | | We're going to want to call this at startup as well as during reconfigurations. Code motion.
| * chanmgr configuration: Hadle lack of a NetDirIan Jackson2022-08-163-18/+11
| | | | | | | | | | | | Now that the code that actually handles the netdir information can cope with its lack, we can change the types of the various netdir parameters and get rid of the foolish Bugs.
| * chanmgr padding: Support reduced and disabled padding (prep)Ian Jackson2022-08-161-3/+9
| | | | | | | | | | | | | | | | | | | | Now we actually honour the configuration variable. However, when it is set to None, we lack proper handling. This will be done bh turning None into 0,0 and then treating that as disabled. There is a TODO for that. Note that we *still* don't actually do or negotiate padding.
| * chanmgr padding: Fix low vs high comparisonIan Jackson2022-08-161-3/+2
| | | | | | | | | | Whoops. This bug was completely masked by the fact that we don't actually enable padding yet.
| * chanmgr: Break out padding_parameters fnIan Jackson2022-08-161-33/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move some logic out of reconfigure_general into what was update_padding_parameters_from_netdir, and rename that function. We're going to want to call this twice, shortly... * Move out the PaddingParametersBuilder * Have it handle missing netdir, though we currently always pass Ok * Have it handle the error cases It still ignores the config for now. No overall functional change. "git show -b" may be a useful way to review the changes in what becomes "padding_parameters".
| * chanmgr: Postpone padding parameters computationIan Jackson2022-08-161-12/+12
| | | | | | | | | | | | | | | | Now that we make an extract from the incoming NetDir, we can move the padding parameters computation to after we take the lock. This will be necessary for it to be able to depend on the config and dormancy, records of which are protected by the chanmgr lock.
| * chanmgr: Introduce NetDirExtractIan Jackson2022-08-161-16/+52
| | | | | | | | | | This will allow the padding parameter computation to have access to the config, which is within the inner lock.
| * chanmgr, testing: Provide config accessor for testingIan Jackson2022-08-162-0/+9
| | | | | | | | | | The top-level global config is going to want to see whether its machinations have the right effect.
| * channel: Use channel usage to control channel paddingIan Jackson2022-08-161-8/+111
| | | | | | | | | | We introduce the per-channel state that is used to keep track of channel usage, and defer padding setup until it's wanted.
| * channel: Introduce padding configIan Jackson2022-08-162-7/+19
| | | | | | | | | | Nothing actually reads this yet, and we also want a client-global default for padding.
| * Introduce ChannelConfigIan Jackson2022-08-169-13/+131
| | | | | | | | | | This commit is just the necessary plumbing. The config is currently empty. We'll add something to it, for padding control, later.
| * tor-config: Introduce PaddingLevelIan Jackson2022-08-163-0/+115
| | | | | | | | This will be used for controlling channel padding, for now.
| * tor-config: Introduce ReconfigureError::BugIan Jackson2022-08-161-0/+4
| | | | | | | | Reconfigurations might fail due to internal errors.
| * channel: Provide somewhere for the frontend's mutable stateIan Jackson2022-08-161-0/+24
| | | | | | | | | | Right now this is just furniture. We're going to put channel padding control state here.