summaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | | proto: Add client specific handshake channel structsDavid Goulet2025-11-193-7/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the UnverifiedClientChannel and VerifiedClientChannel mirroring the relay API for channels. It plainly uses the generic object underneath as for now those objects are client only. Followup commits will make things more client specific. No behavior change. Signed-off-by: David Goulet <[email protected]>
| * | | | | | | proto: Move client handshake into client channel moduleDavid Goulet2025-11-195-129/+222
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This only moves code from src/channel to src/client/channel. It introduces a ClientChanBuilder that is used to launch client specific channel by the public ChanBuilder. The followup commits will add a VerifiedClientChannel and UnverifiedClientChannel in order to again decouple client and relay code from the generic objects. Signed-off-by: David Goulet <[email protected]>
| * | | | | | | proto: Add VerifiedRelayChannel implementationDavid Goulet2025-11-192-2/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the finish() function that for now simply calls the generic finish(). There is a bunch of TODO in the code in this commit explaining why we haven't made the implementation relay specific just yet. Signed-off-by: David Goulet <[email protected]>
| * | | | | | | proto: Add UnverifiedRelayChannel implementationDavid Goulet2025-11-194-125/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commits takes out the relay specific code out of UnverifiedChannel and puts it in UnverifiedRelayChannel. In order to pull this off, we added some fiels to the VerifiedChannel struct so the relay code get back generated data from the UnverifiedChannel::check() in order to do its validation work and yield a VerifiedRelayChannel. This also lead to a cleanup of expect() and ChannelType::is_initiator(). Signed-off-by: David Goulet <[email protected]>
| * | | | | | | proto: Introduce relay specific channel structsDavid Goulet2025-11-191-2/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new UnverifiedRelayChannel and VerifiedRelayChannel struct are added to decouple the client code and put the relay component in its module. Both objects hold the to become generic object that both client and relay will use to create a channel. Signed-off-by: David Goulet <[email protected]>
* | | | | | | | Merge branch 'relay-or-config' into 'main'opara2025-11-196-72/+252
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | arti-relay: Add config options for OR port See merge request tpo/core/arti!3466
| * | | | | | | arti-relay: remove checks on "advertise" addressesSteven Engler2025-11-191-53/+8
| | | | | | | |
| * | | | | | | arti-relay: update comment about "auto" port optionSteven Engler2025-11-181-2/+1
| | | | | | | |
| * | | | | | | arti-relay: fix doc commentsSteven Engler2025-11-181-5/+5
| | | | | | | |
| * | | | | | | arti-relay: remove builder testsSteven Engler2025-11-121-20/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't plan to use the builders.
| * | | | | | | arti-relay: remove `Default` tests from configSteven Engler2025-11-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | arti-relay has required config options, which means that `TorRelayConfig` cannot have a default.
| * | | | | | | arti-relay: listen at configured OR portsSteven Engler2025-11-122-13/+56
| | | | | | | |
| * | | | | | | arti-relay: `TorRelay::run` now takes an owned `self`Steven Engler2025-11-121-1/+1
| | | | | | | |
| * | | | | | | arti-relay: remove `Clone` from `TorRelay`Steven Engler2025-11-121-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I don't expect that we'll need this.
| * | | | | | | arti-relay: added config options for OR port and advertiseSteven Engler2025-11-122-0/+200
| | | | | | | |
| * | | | | | | arti-relay: move `iter_join` to a new `util` moduleSteven Engler2025-11-122-28/+34
| | | | | | | |
| * | | | | | | arti-relay: update some commentsSteven Engler2025-11-121-7/+5
| | | | | | | |
* | | | | | | | Merge branch 'refactor-http-errors' into 'main'Nick Mathewson2025-11-195-83/+124
|\ \ \ \ \ \ \ \ | | |_|_|/ / / / | |/| | | | | / | |_|_|_|_|_|/ |/| | | | | | http-connect: Improve error reporting. See merge request tpo/core/arti!3476
| * | | | | | error: Improve http error status code docs.Nick Mathewson2025-11-191-0/+10
| | | | | | |
| * | | | | | http_connect: Report end reasons for HTTP CONNECT failures.Nick Mathewson2025-11-192-7/+30
| | | | | | |
| * | | | | | tor-error: rustfmtNick Mathewson2025-11-181-63/+64
| | | | | | |
| * | | | | | tor-error: Provide a more reasonable API for http status codes.Nick Mathewson2025-11-183-8/+11
| | | | | | |
| * | | | | | tor-error: Add support for ErrorKind->HTTP status conversionNick Mathewson2025-11-185-80/+84
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It makes more sense to have the conversion here, so it can use an exhaustive match over ErrorKind. This isn't the final API; I'm just moving the code from `arti`.
* | | | | | tor-netdoc: encode: Explain why NetdocEncoder contains a ResultIan Jackson2025-11-191-1/+2
| | | | | |
* | | | | | tor-netdoc: parse2 docs: Clarify that these are for parsingIan Jackson2025-11-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | We're going to have separate traits for encoding.
* | | | | | tor-netdoc: parse2 docs: Fix ItemObjectParseableIan Jackson2025-11-191-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | Once upon a time this trait handled multiplicity. But it doesn't any more.
* | | | | | tor-netdoc: parse2 docs: Improve `#[deftly(netdoc(rest))]` docsIan Jackson2025-11-191-0/+2
| | | | | |
* | | | | | tor-netdoc: parse2 docs: Fix docs for ItemArgumentParseableIan Jackson2025-11-191-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | This is not impl for all FromStr. We have NormalItemArgument now.
* | | | | | tor-netdoc: parse2 docs: Document BTreeSet in multiplicityIan Jackson2025-11-191-2/+3
| |_|_|/ / |/| | | | | | | | | | | | | | This was added at some point, but not documented.
* | | | | Merge branch 'pub-encode' into 'main'Ian Jackson2025-11-198-32/+68
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | tor-netdoc: Make much more of encode module public See merge request tpo/core/arti!3471
| * | | | | tor-netdoc: Add a blank line for reading clarityIan Jackson2025-11-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3471#note_3288716
| * | | | | tor-netdoc: impl Default for NetdocEncoderIan Jackson2025-11-181-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clippy points out that if argument-less `new` can exist, so should Default.
| * | | | | tor-netdoc: Make much more of the encode module contents publicIan Jackson2025-11-183-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | My planned new derive for encoding will be pub, but cfg gated, like parse2 is.
| * | | | | tor-netdoc: Add a note about the nature of NetdocBuilderIan Jackson2025-11-181-1/+13
| | | | | |
| * | | | | tor-netdoc: Implement KeywordEncodable for &'static strIan Jackson2025-11-181-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | My planned encoding derive macro is going to provide keywords as literal strings. (The purpose of this trait is to allow the old parser to be generic over its keyword constants, not to provide type-safety against passing non-keyword strings to document encoders. Such bugs aren't very likely and will be especially unlikely when we're deriving encoders.)
| * | | | | tor-netdoc: Split off Keyword::to_str into its own trait (fmt)Ian Jackson2025-11-181-1/+3
| | | | | |
| * | | | | tor-netdoc: Split off Keyword::to_str into its own traitIan Jackson2025-11-187-12/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | My planned encoding derive macro is not going to use `decl_keyword!` but will need to call `NetdocEncoder::item`.
| * | | | | tor-netdoc: Split off Keyword::to_str - prep code motionIan Jackson2025-11-181-8/+8
| | | | | |
| * | | | | 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.
* | | | | | 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-181-1/+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-182-71/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.