| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | |
| |
| |
| |
| | |
This commit implements ItemArgumentParseable for RelayPlatform which we
will need in the parse2 version of RouterDesc eventually.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
We will need this type in public fields of the router descriptor data
type at one point, most notably for the `fingerprint` item.
No need to update semver.md because this type is, for whatever reason,
already contained there (in main)?
|
| | |
| |
| |
| |
| | |
This commit adds a test for the recent parse2 accumulator to see whether
it accumulates the policies as expected.
|
| | |
| |
| |
| |
| |
| | |
This commit implements NetdocParseableFields for AddrPolicy, which will
be required, because this field accumulates exit policies in a firewall
like order, making the use of it necessary.
|
| | |
| |
| |
| |
| | |
This commit implements NormalItemArgument for AddrPortPattern because we
will need it later for an accumulator.
|
| | |
| |
| |
| |
| | |
This commit derives PartialEq and Eq for a few types in addrpolicy.rs,
as we will need these for a few unit tests later on.
|
| | |
| |
| |
| |
| | |
The inner Vec ought to be better of as a BTreeSet as that would save us
dedup and sort calls.
|
| | |
| |
| |
| |
| | |
We will need this later for outputting RelayFamilyIds in a fashion
compatible with the current API.
|
| | |
| |
| |
| |
| | |
We will need this later for outputting RelayFamilyIds in a fashion
compatible with the current API.
|
| | |
| |
| |
| |
| |
| | |
This commit adds the ExtraInfoDigests structure storing the, if present,
mandatory SHA-1 hash and optional SHA-256 hash of the extra-info
document associated with the router descriptor it is referenced from.
|
| | |
| |
| |
| |
| |
| |
| | |
This commit adds RouterDescIntroItem which will serve as the
introduction item for router descriptors, that is, a line with the
keyword "router" followed by the nickname, the IPv4 address, and a few
ports.
|
| | |
| |
| |
| |
| | |
This derives Eq for Nickname because we will need it for unit tests that
will be added later on.
|
| | |
| |
| |
| |
| |
| | |
This type comes from the specification and indicates overload
information about a relay. We will use it in router descriptors at one
point, hence why we are adding it already.
|
| | |
| |
| |
| |
| | |
This commit adds a test to verify the 10x4 character requirement for
SpFingerprint.
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| | |
This commit introduces FixedB16U which is a FixedB64 pedant for B16U.
It will be required for ExtraInfoDigests.
|
| | |
| |
| |
| |
| | |
This commit adds a round-trip test for NumericBoolean to ensure that 0
is false and 1 is true.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit adds a new type, NumericBoolean, which implements
NormalItemArgument in order to be parseable with parse2.
It works very simple, namely it can be used to decode/encode a boolean
as a `0` (false) or `1` (true) which is found in a few places around
tor-netdoc.
The reason why this is its own type instead of implementing
NormalItemValue for the bool primitive is, that booleans are special
numerical types and to be future-proof against other oddities, a
separate wrapper type makes most sense.
|
| | |
| |
| |
| |
| |
| | |
Part of #2492 phase 1.
No semver note because this is an experimental feature.
|
| |/
|
|
|
|
| |
Part of #2492 phase 1.
No semver note because this is an undocumented transitional phase.
|
| |\
| |
| |
| |
| | |
Fix new warnings from Rust 1.95
See merge request tpo/core/arti!3902
|
| | | |
|
| | |
| |
| |
| |
| | |
See torspec#401 and
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3864#note_3397715
|
| | |
| |
| |
| |
| | |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3864#note_3397714
|
| | |
| |
| |
| |
| |
| |
| | |
Now it follows, rather than precedes, the parse2_impls and
encode_impls modules that it imports things from.
Pure code motion apart from deleting the todo.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
This is going to be used for encoding too.
|
| | |
| |
| |
| | |
We don't need the helper struct for this.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We're going to want this macrology to generate a encoder
implmeentation too. It's most convenient to make this its own module,
separating it from parse2_impls.
Enable the module if encoding is enabled, decorating its
parsing-related contents with the appropriate cfg.
Use pub(super) to export the encoding-related imports, so that we
don't end up with endlessly duplicated import lists.
Now there is place where we can put the encoder.
|
| | | |
|
| | |
| |
| |
| |
| |
| | |
Start a new encode_impls module.
The pub(super) will be used in a moment.
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
This is what we did for authcert.rs and it worked well there.
|
| | | |
|
| | | |
|
| | | |
|
| |\ \
| | |
| | |
| | |
| | | |
Add debugging support to ItemValueParseable derive
See merge request tpo/core/arti!3881
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
With
cargo test --all-features -p tor-netdoc -- --no-capture test2
the output now contains, amongst many other things:
netdoc TestItem parse: item start, "test-item", "N", Some("TEST OBJECT")
netdoc TestItem parse: field needed, normal, args=1, "N"
netdoc TestItem parse: field optional, normal, args=Option<_>, ""
netdoc TestItem parse: field rest, normal, args=Vec<_>, ""
netdoc TestItem parse: field object, object, object=1, Some(("TEST OBJECT", Ok(5)))
netdoc TestItem parse: item complete Ok
|
| | | | |
|
| | | |
| | |
| | |
| | | |
So far this just abolishes a duplicate P.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
We're going to want tio reuse dtrace from here in the
ItemValueParseable derive (which doesn't use
NetdocSomeItemsParseableCommon because it derives for one item type,
not a document containing multiple items).
|
| | | | |
|