summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | tor-netdoc: Keyword: Say that to_str is the actual document keywordIan Jackson2025-11-181-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NetdocEncoder::item uses it this way. Presumably it is right at least in those cases where this method is called. The only implementor of this trait right now is the output from `decl_keyword!` in the old parser, which is (generally) expected to be the actual keyword.
* | | | | | | Merge branch 'relayflags-enumset' into 'main'Ian Jackson2025-11-1815-258/+177
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace RelayFlags, using enumset See merge request tpo/core/arti!3477
| * | | | | | | tor-netdoc: Add a message to a panic callIan Jackson2025-11-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3477#note_3289536
| * | | | | | | tor-netdoc: Remove bitflags from Cargo.tomlIan Jackson2025-11-182-2/+0
| | | | | | | |
| * | | | | | | tor-netdoc: document RelayFlags changesIan Jackson2025-11-181-2/+3
| | | | | | | |
| * | | | | | | tor-netdoc: RelayFlag: rustfmt to correct the indentationIan Jackson2025-11-181-59/+59
| | | | | | | |
| * | | | | | | tor-netdoc: derive PartialEq for DocRelayFlagsIan Jackson2025-11-181-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EnumSet<RelayFlag> implements PartialEq, so we can derive this rather than open-coding it.
| * | | | | | | tor-netdoc: Abolish relay_flags_keywords macroIan Jackson2025-11-181-78/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The only thing generated by this macro is `set_iter_keywords` which is only used in the test to check that the macro call is correct. Abolish it all.
| * | | | | | | tor-netdoc: Abolish anomalous RelayFlag::from_str_oneIan Jackson2025-11-181-15/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This existed because it was once an impl on the old RelayFlags. Now, it's on RelayFlag which is sensibly FromStr.
| * | | | | | | RelayFlags: Use RelayFlag enum variant names everywhereIan Jackson2025-11-1810-46/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Abolish the constants with the transitional names. This also abolishes the controversial name `H_S_DIR`, which Rust case transformation rules generated from `HSDir`.
| * | | | | | | tor-netdoc: Replace RelayFlag with an enum and RelayFlags with an EnumSetIan Jackson2025-11-183-71/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now: `RelayFlag` is a single flag, which is a different type to `RelayFlags`. `FromStr` and `Display` are now implemented in a normal way for a single flag. We don't use bitflags, with its funky input syntax, any more. Instead, we have a normal enum. No longer is it possible to have a `RelayFlags` with "unknown bits" set (whatever that means). (Therefore, an associated test case for this is now gone.) The names are principally specified just as enum variant names. The enum variant names can be identical to the network document keywords. Briefly, we provide constants in capitals, for the benefit of all the call sites. That means that *this* commit can contain only the primary changes. A few macro-generated things have been adjusted in this commit, but they are actually going to go away. Indentation is now wrong. We'll fix that at the end.
| * | | | | | | tor-netdoc: RelayFlags: Preparatory changes to iter_keywords and from_str_oneIan Jackson2025-11-181-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will reduce noise in the actual functional change commit. (But, this is all going to go away. That will bei justified on its merits, after the overhaul is done.)
| * | | | | | | tor-netdoc: RelayFlags: Introduce .as_repr() method and use itIan Jackson2025-11-181-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bitflags provides .bits() but enumset provides .as_repr(). Make this change at all call sites now.
| * | | | | | | RelayFlags: Use the singular RelayFlag for naming individual flagsIan Jackson2025-11-1811-47/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're going to separate RelayFlag from RelayFlags. We could continue to provide a bunch of constant values for RelayFlags, for each individual type, but that would involve an ad-hoc derive, and would still be a bit of an unusual API. Instead, we're going to make ``RelayFlag` a normal enum. In this commit, we change everyone to refer to it by its singular name. Hopefully separating out this bulk change makes both this, and the core commit, easier to review.
| * | | | | | | tor-netdoc: rs builder: Take Into<RelayFlags>Ian Jackson2025-11-181-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many call sites pass one flag. We're going to have a type-level distinction between a single flag and a set. But that's annoying at many of the call sites which want to specify a fixed single flag. Note that `set_flags` doesn't only set flags. It replaces them.
| * | | | | | | tor-netdoc: RelayFlags: Tidy up from_item for flagsIan Jackson2025-11-182-3/+5
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement this on DocRelayFlags instead, since that's what it returns. And change the name to from_item_consensus to highlight its semantic restriction. (It's not generic over the implied flags, so it can only do one thing.)
* | | | | | | Merge branch 'upgrade-bigint' into 'main'Nick Mathewson2025-11-181-3/+2
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | maint: Upgrade num-bigint-dig to 0.8.6 Closes #2110 See merge request tpo/core/arti!3475
| * | | | | | maint: upgrade num-bigint-dig to 0.8.6Steven Engler2025-11-181-3/+2
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This appears to resolve the warning: > warning: the following packages contain code that will be rejected by a future version of Rust: num-bigint-dig v0.8.4
* | | | | | Merge branch 'p2-relayflags' into 'main'Ian Jackson2025-11-1827-221/+700
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | | | | | | | tor-netdoc: Overhaul RelayFlags, and provide for conditionally retaining unknown info See merge request tpo/core/arti!3454
| * | | | | tor-netdoc: Add an explanation about RelayFlags's PartialEqIan Jackson2025-11-181-0/+13
| | | | | |
| * | | | | tor-netdoc: Rename relay flags omitted/implicit const params (rustfmt)Ian Jackson2025-11-181-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | Some of the new formatting is a bit unfortunate. Ah well.
| * | | | | tor-netdoc: Rename relay flags omitted/implicit const paramsIan Jackson2025-11-181-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3454#note_3288967
| * | | | | tor-netdoc: semver.md updates for RelayFlags overhaulIan Jackson2025-11-181-0/+6
| | | | | |
| * | | | | tor-netdoc: Be able to retain unknown flagsIan Jackson2025-11-184-11/+25
| | | | | |
| * | | | | tor-netdoc: Introduce Unknown and retain_unknown_values optionIan Jackson2025-11-184-3/+143
| | | | | |
| * | | | | tor-netdoc: Add experimental retain-unknown featureIan Jackson2025-11-181-0/+4
| | | | | |
| * | | | | tor-netdoc: parse2: Introduce ParseOptions (fmt)Ian Jackson2025-11-181-1/+5
| | | | | |
| * | | | | tor-netdoc: parse2: Introduce ParseOptionsIan Jackson2025-11-183-8/+63
| | | | | | | | | | | | | | | | | | | | | | | | There are currently no options.
| * | | | | tor-netdoc: parse2: Introduce ParseInput intermediate structIan Jackson2025-11-187-26/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're going to add options arguments, effectively, to the parsing entrypoints. To avoid a proliferation of entrypoints (eg, parse_multiple_with_options), encapsulate the run-time input values in this structure.
| * | | | | tor-netdoc: Remove the RelayFlags type alias in netstatusIan Jackson2025-11-188-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | I would do `#[deprecated]` but empirically that has no effect...
| * | | | | tor-netdoc: Introduce DocRelayFlags for relay flags in a network documentIan Jackson2025-11-186-12/+39
| | | | | | | | | | | | | | | | | | | | | | | | This will have space for unknown flags.
| * | | | | tor-netdoc: Make the weird parser not be a FromStr implIan Jackson2025-11-181-11/+9
| | | | | | | | | | | | | | | | | | | | | | | | This is the minimal change to provide sanity.
| * | | | | tor-netdoc: Improve and expose RelayFlagsParserIan Jackson2025-11-181-7/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the only exposed API for parsing RelayFlags is the FromStr impl which is very strange. I'm going to remove it. But there should be a replacement. So improve RelayFlagsParser: * Derive Debug and Clone. * Replace the `&'static str` error. * Make sure unknown `IMPLIED | IMPLICIT` is detected at compile time. * Make it pub.
| * | | | | tor-netdoc: Separate ConsensusRelayFlagsParser and VoteRelayFlagsParserIan Jackson2025-11-183-10/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide a per-variety alias and use it for parsing; no longer impl ItemValueParseable for RelayFlags.
| * | | | | tor-netdoc: Paramterise RelayFlagsParser for varying omitted/implied bitsIan Jackson2025-11-181-5/+28
| | | | | | | | | | | | | | | | | | | | | | | | Which bits are implied/omitted depends on the document!
| * | | | | tor-netdoc: Introduce a RelayFlagsBits type aliasIan Jackson2025-11-181-1/+4
| | | | | |
| * | | | | tor-netdoc: Test RelayFlags coherence and encodingIan Jackson2025-11-181-0/+41
| | | | | |
| * | | | | tor-netdoc: Provide for encoding RelayFlagsIan Jackson2025-11-181-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | The API is a bit clumsy, but we're mostly going to use it internally.
| * | | | | tor-netdoc: RelayFlags: add a macro for keyword parsingIan Jackson2025-11-181-19/+43
| | | | | |
| * | | | | tor-netdoc: Rename RelayFlags elements for regularity vs specIan Jackson2025-11-186-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add underscores so that the spec keywords and the flag constants correspond (according to `paste`'s case-changing rules).
| * | | | | tor-netdoc: Improve docs for RelayFlagsIan Jackson2025-11-181-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Document the bizarre FromStr impl. That isn't in my way, so I don't intend to fix it. So I've documented it instead. * Mention the naming discrepancy.
| * | | | | tor-netdoc: Move RelayFlags into its own moduleIan Jackson2025-11-183-161/+185
|/ / / / / | | | | | | | | | | | | | | | | | | | | We're going to do a lot more with this and it's less confusing to have it all together.
* | | | | Merge branch 'circ-hops' into 'main'David Goulet2025-11-1816-521/+807
|\ \ \ \ \ | |_|_|_|/ |/| | | | | | | | | | | | | | proto: Split CircHop into inbound and outbound components See merge request tpo/core/arti!3470
| * | | | proto: Fix up doc links post-refactoringGabriela Moldovan2025-11-172-9/+9
| | | | |
| * | | | proto: Temporarily silence a few warningsGabriela Moldovan2025-11-171-0/+3
| | | | |
| * | | | proto: Use CircHopInbound in the ForwardReactor (fmt)Gabriela Moldovan2025-11-173-6/+4
| | | | |
| * | | | proto: Use CircHopInbound in the ForwardReactorGabriela Moldovan2025-11-172-19/+15
| | | | |
| * | | | proto: Use CircHopOutbound in BackwardReactorGabriela Moldovan2025-11-172-34/+24
| | | | |
| * | | | proto: Make cc state shared between CircHop{Inbound,Outbound}Gabriela Moldovan2025-11-173-27/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The relay reactor needs the cc state to be shared between the inbound and outbound components (i.e. the forward and backward reactors), so we need to put the cc state behind a mutex. There will never be any contention on this mutex in the client impl, because the client reactor doesn't split the `CircHop` into `CircHopInbound` and `CircHopOutbound`. In the future, we should work on trying to reduce the number of locks in the `CircHop` states.
| * | | | proto: Make CongestionWindow CopyGabriela Moldovan2025-11-173-8/+8
| | | | |