| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | | | |
|
| | | |
| | |
| | |
| | | |
To test the padding control we will want this.
|
| | | |
| | |
| | |
| | | |
Now it's not just cfg(test), but feature testing.
|
| | | |
| | |
| | |
| | |
| | | |
We are going to want this for through-the-layers padding control
testing.
|
| | | |
| | |
| | |
| | |
| | | |
This allows test cases to describe precisely the contents of the
negotiation cell ought to be generated.
|
| | | |
| | |
| | |
| | |
| | | |
We're going to want this for testing netdirs with padding parameters
that diff ere from the spec's default.
|
| | | |
| | |
| | |
| | |
| | | |
Otherwise a caller who has a set of parameters must open-code the
loop.
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
We're going to want to call this at startup as well as during
reconfigurations.
Code motion.
|
| | | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
| | |
| | |
| | |
| | | |
Whoops. This bug was completely masked by the fact that we don't
actually enable padding yet.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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".
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
| | |
| | |
| | |
| | | |
This will allow the padding parameter computation to have access to
the config, which is within the inner lock.
|
| | | |
| | |
| | |
| | |
| | | |
The top-level global config is going to want to see whether its
machinations have the right effect.
|
| | | |
| | |
| | |
| | |
| | | |
We introduce the per-channel state that is used to keep track of
channel usage, and defer padding setup until it's wanted.
|
| | | |
| | |
| | |
| | |
| | | |
Nothing actually reads this yet, and we also want a client-global
default for padding.
|
| | | |
| | |
| | |
| | |
| | | |
This commit is just the necessary plumbing. The config is currently
empty. We'll add something to it, for padding control, later.
|
| | | |
| | |
| | |
| | | |
This will be used for controlling channel padding, for now.
|
| | | |
| | |
| | |
| | | |
Reconfigurations might fail due to internal errors.
|
| | | |
| | |
| | |
| | |
| | | |
Right now this is just furniture. We're going to put channel padding
control state here.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Channel padding depends on what the channel is being used for. We
therefore need to let the channel code know this information.
The implementation of the per-channel padding control logic will be in
the new note_usage function, which for now is simply a stub.
A future commit will introduce a `PaddingControlState` which lives in
the channel frontend; consult the doc comment for that type to see why
the plumbing through the channel manager terminates in the channel
frontend.
|
| | | |
| | |
| | |
| | | |
This is going to be useful in a moment.
|
| | | |
| | |
| | |
| | | |
This is going to be able to fail in other ways too, sadly.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The chanmgr remembers the last dormancy state it was told.
We invent a chanmgr-specific Dormancy which the arti-client code knows
how to convert from the richer top-level dormant status. This avoids
having to have everyone know all the variants of the top-level state.
To call reconfigure_general, we must also obtain and plumb through a
netdir. Right now we must return an internal error if there is in
fact no netdir, because reconfigure_general does not yet cope with a
missing netdir.
Nothing actually *uses* the dormancy yet.
|
| | | |
| | |
| | |
| | |
| | |
| | | |
We're going to need to reuse this, so we can plumb the dormancy to
more places. Breaking it out avoids having repeat the initial
dormancy value in two places.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This function is going to become the code for controlling channels, in
general. (Including padding control.) Right now it doesn't do most
of the things.
In this commit:
* Change the prototype and the name now.
* Pass `()` for the dormancy and config, adding TODOs.
* Provide update_netdir method on AbstractChanMgr, and call that,
rather than having the ChanMgr go directly into the channel.
(That will enable us to test that `update_netdir` method
with test cases that don't have a complete ChanMgr.)
|
| | | |
| | |
| | |
| | |
| | | |
We're going to need this because the frontend is going to need to
defer some channel padding parameters updates.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
Unfortunately, because we don't have derive-adhoc here yet, rustfmt
didn't get to notice that this comma was needed.
We are going to add field(s), so add the comma now.
|
| | | |
| | |
| | |
| | | |
The semantics of this are going to become a bit more subtle.
|
| | | |
| | |
| | |
| | |
| | | |
This exists so that we handle this case specially, as we will need to,
and so that we can represent disablement in a Parameters.
|
| | | |
| | |
| | |
| | |
| | | |
The channel manager is going to use this as part of constructing the
right cell for padding neogotiattion.
|
| | | |
| | |
| | |
| | | |
We're going to want this so that we can do reduced padding.
|
| | | |
| | |
| | |
| | |
| | | |
As proposed in
https://gitlab.torproject.org/tpo/core/torspec/-/merge_requests/77
|
| | | |
| | |
| | |
| | |
| | | |
This gets rid of some random hardcoded literals. We're going to want
to reuse this, too.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We don't really want the caller to pass ignored timeout parameters.
And this makes more semantic sense.
The stop constructor uses zero, which is what C Tor does. See
https://gitlab.torproject.org/tpo/core/torspec/-/merge_requests/76
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This will be convenient for managing when to send these negotiation
messages.
While we're here, edit the comment to explain how this is (going to
be) used.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
Much of this does not exist yet. It will do by the end of this
branch.
Expand a doc note for ChannelsParamsUpdates too.
|
| | | |
| | |
| | |
| | | |
This is going to change. Centralise it first.
|
| | | |
| | |
| | |
| | | |
This is going to change. Centralise it first.
|
| | | |
| | |
| | |
| | |
| | |
| | | |
Replaces 4 open-coded call sites.
I am going to add one more.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is more standard. It also provides the ::build() method.
This isn't a config type, and build failures ought not to happen,
so we use Bug for the error.
|
| | |/
| |
| |
| |
| | |
The rustfmt-mandated different formatting of these two very similar
blocks is bad enough, without them being smooshed together.
|
| |\ \
| |/
|/|
| |
| |
| |
| | |
Mark some circuit-building errors as "transient".
Closes #517
See merge request tpo/core/arti!676
|
| | | |
|