summaryrefslogtreecommitdiff
path: root/crates/tor-linkspec
Commit message (Collapse)AuthorAgeFilesLines
...
* bump rust-version to 1.60 in every crate.Nick Mathewson2022-11-101-1/+1
|
* linkspec: Rename "maybe rename this?" TODOs in favor of #623Nick Mathewson2022-11-072-5/+0
|
* PtTargetSettings: Enforce correctness at lower level.Nick Mathewson2022-11-071-19/+49
| | | | This resolves a number of TODOs.
* Remove a blank lineNick Mathewson2022-11-071-1/+0
|
* Downgrade TODO on chan_methodNick Mathewson2022-11-071-1/+1
| | | | | This is not something we need to solve for 1.1.0 (and it might not need to be solved ever).
* Remove TODO about third ChannelMethod variant.Nick Mathewson2022-11-071-2/+0
| | | | We didn't find a use for this.
* Remove TODO about inlining PtTargetSettings.Nick Mathewson2022-11-071-7/+0
| | | | | Since there are (or soon will be) parsing restrictions on this type, we don't want to inline it as a simple Vec.
* Run add_warnings.Nick Mathewson2022-11-031-0/+1
|
* Require derive_more 0.99.3Ian Jackson2022-11-031-1/+1
| | | | | | | | 0.99.[012] have a bug https://github.com/JelteF/derive_more/issues/114 which makes the Deref derive for bridgedesc::StateGuard not work and therefore breaks minimal-versions CI. It seems simpler to require the newer version everywhere.
* Merge branch 'guards_as_bridges_part2' into 'main'Nick Mathewson2022-10-272-1/+57
|\ | | | | | | | | Use ByRelayIds to hold guards in GuardSet See merge request tpo/core/arti!808
| * ByRelayIds: Add additional accessor functions.Nick Mathewson2022-10-251-0/+51
| | | | | | | | | | These are the ones that turned out to be necessary while converting guard samples to use ByRelayIds.
| * linkspec: add HasRelayIds::has_any_identity.Nick Mathewson2022-10-251-1/+6
| |
* | impl Hash for BridgeConfig and various PT informationIan Jackson2022-10-271-3/+3
|/ | | | | The bridge descriptor manager wants to index data structures by the BridgeConfig.
* linkspec: specify sort order for HasRelayIds.Nick Mathewson2022-10-241-2/+13
|
* linkspec: Remove now-useless declared_peer_addrNick Mathewson2022-10-241-5/+0
| | | | The singleton variation here is almost never what we want.
* guardmgr: Refactor the interior of FirstHop.Nick Mathewson2022-10-243-26/+89
| | | | | | | | | | | | | Now it contains either an `OwnedChanTarget` or an `OwnedCircTarget`, which will let `GuardMgr` return bridges that can be used to make circuits. As part of this change, it was necessary to revise some address-modification functions that applied to filters and `OwnedChanTarget`. Now they do the smart thing, and remove only the address that are in the `ChanMethod`. This means that the addresses from HasAddrs are still accurate about which addresses the relay "has".
* linkspec: Add compare-by-relay-ids function to HasRelayIdsNick Mathewson2022-10-213-3/+74
|
* Merge branch 'pt-serde' into 'main'Nick Mathewson2022-10-203-72/+25
|\ | | | | | | | | serde support for PtTarget See merge request tpo/core/arti!780
| * Implement serde for PtTarget and its members.Nick Mathewson2022-10-202-5/+20
| | | | | | | | This will let us remember bridges that use pluggable transports.
| * Inline now-needless variant constructors for PtTargetAddrNick Mathewson2022-10-201-22/+2
| |
| * Remove a now-needless `allow(dead_code)`Nick Mathewson2022-10-201-1/+0
| |
| * linkspec: Always expose PT-related types.Nick Mathewson2022-10-202-46/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `PtTarget` type and its contents (`TransportName`, `PtTargetAddr`, `PtSettings`) are now unconditionally compiled and exposed. This will allow us to serialize and deserialize them in our guard-state files even when we have been built without explicit PT support. The `pt-client` feature controls whether `TransportName` is a variant of `TransportId`, and whether `PtTarget` is a variant of `ChanMethod`: this in turn means that we'll still have simpler binary code and smaller structures when we're building without PT support (which is what we wanted when we initially made these types conditional).
* | Merge branch 'bridge-internal-apis' into 'main'Ian Jackson2022-10-201-1/+7
|\ \ | |/ |/| | | | | Use BridgeConfig to identify bridges in two places See merge request tpo/core/arti!781
| * tor-linkspec: impl From<&ChanTarget> for OwnedChanTargetIan Jackson2022-10-201-1/+7
| | | | | | | | | | | | This lets us write functions which can either take an existing owned OwnedChanTarget, or copy out of some other kind of ChanTarget passed by reference.
* | impl HasAddrs for PtChannelAddr and ChannelMethodIan Jackson2022-10-201-0/+29
| |
* | HasAddrs: Make it clear that the set of addresses can be emptyIan Jackson2022-10-201-1/+4
|/ | | | Eg, a PT bridge may not have an address.
* linkspec: Fix typo in error messages.Nick Mathewson2022-10-181-2/+2
|
* linkspec: Add ByRelayIds::remove_exact.Nick Mathewson2022-10-181-0/+65
| | | | | We need a function to remove an entry if it appears with _exactly_ the same relay Ids, but not otherwise. This method will do that.
* linkspec: Add an "all_overlapping" accessor to ByRelayIds.Nick Mathewson2022-10-183-1/+117
| | | | | | | Also, add a few tests for this and the other accessors. We'll need this accessor to find whether we have any channels to _any_ of the identities that we're trying to connect to.
* Write more tests for RelayId and RelayIdRef.Nick Mathewson2022-10-151-0/+138
|
* Write tests for RelayIdSet.Nick Mathewson2022-10-152-0/+121
|
* Fix deserialize impl for RelayId.Nick Mathewson2022-10-151-1/+1
| | | | | | | We need to handle String, not just str, since some deserializers have to handle escapes and generate new strings. Found while writing tests; fixes #605.
* linkspec: impl Hash for RelayIdRefNick Mathewson2022-10-152-1/+3
|
* Fix some rustdoc errors.Nick Mathewson2022-10-131-1/+1
| | | | | | In addition to the usual "You named that method wrong!" errors, we have a new rustdoc error that complains about bogus "HTML tags" that are actually unquoted usage of types like `Result<Foo>`.
* Merge branch 'factory_redux' into 'main'Nick Mathewson2022-10-131-0/+33
|\ | | | | | | | | chanmgr: Build and use chanmgr factory APIs See merge request tpo/core/arti!769
| * Add several accessors to ChannelMethod.Nick Mathewson2022-10-121-0/+33
| | | | | | | | | | | | * Get `TransportId` * Get the target address (of any type) * Ask, "is this a direct connection"?
* | cargo fmt to remove blank linesIan Jackson2022-10-121-1/+0
| | | | | | | | | | | | | | Apparently cargo fmt doesn't like these, which my perl rune didn't delete. This commit is precisely the result of `cargo fmt`.
* | Replace all README copies in src/lib.rs with includesIan Jackson2022-10-121-55/+1
|/ | | | | | | | The feature we want is `#[doc = include_str!("README.md")]`, which is stable since 1.54 and our MSRV is now 1.56. This commit is precisely the result of the following Perl rune: perl -i~ -0777 -pe 's{(^//!(?!.*\@\@).*\n)+}{#![doc = include_str!("../README.md")]\n}m' crates/*/src/lib.rs
* Fix a warning that I reintroduced.Nick Mathewson2022-10-111-0/+1
| | | | | It looks like this got fixed, but my branch for !759 reintroduced it by refactoring.
* Change multiplicity of ChannelMethod and addressesNick Mathewson2022-10-114-34/+35
| | | | | | | Now each `ChanTarget` has at most one `ChannelMethod`, and only `Direct` `ChannelMethods` can have multiple addresses. Closes #600.
* Allow two useless pattern matches that are going to be not uselessIan Jackson2022-10-111-0/+1
|
* Clarify limits on socket address from ChannelMethodNick Mathewson2022-10-061-2/+8
|
* Move two users of HasAddrs to HasChannelMethodsNick Mathewson2022-10-061-2/+4
| | | | All the other users of HasAddrs are correct.
* tor-linkspec: Remove the old OwnedFoo::new() functionsNick Mathewson2022-10-061-56/+21
| | | | These are now builders.
* ChannelMethod: Add method to access the (optional) SocketAddrNick Mathewson2022-10-061-0/+18
|
* Add builders for OwnedChanTarget/OwnedCircTargetNick Mathewson2022-10-063-13/+63
| | | | | This will become the preferred way to make one of these objects, and insulate us against future API changes.
* Begin revising HasAddr and its relationship to ChanTargetNick Mathewson2022-10-064-15/+62
| | | | | | | | | | | | | | | | | | | HasAddr used to mean "Here are addresses that I have, at which I can be contacted." But "Where (and how) can I be contacted?" is now a question for HasChannelMethod to answer. (We still need to have "HasAddr", though, so we can answer things like "what country is this relay in" and "are these relays in the same /8?") So this commit introduces: * A new trait for adding an implementation of HasChannelMethod in terms of HasAddr. * A requirement on ChanTarget that it needs to implement HasChannelMethod. There is some temporary breakage here, marked with "TODO pt-client", that I'll fix later in this branch.
* tor-linkspec: ByRelayIds<> type to hold a set of HasRelayIdsNick Mathewson2022-10-045-1/+68
| | | | | This is based on the type generated with n_key_set, with a couple of extra methods to take advantage of RelayId and RelayIdRef.
* Merge branch 'bridge-parse' into 'main'Ian Jackson2022-10-032-10/+83
|\ | | | | | | | | Parse (and format) bridge lines See merge request tpo/core/arti!745
| * pt: transport ID error: Fix style to remove full stopIan Jackson2022-10-031-1/+1
| |