aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-linkspec/src/transport.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* linkspec: Always expose PT-related types.Nick Mathewson2022-10-201-44/+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).
* impl HasAddrs for PtChannelAddr and ChannelMethodIan Jackson2022-10-201-0/+29
|
* linkspec: Fix typo in error messages.Nick Mathewson2022-10-181-2/+2
|
* 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"?
* Change multiplicity of ChannelMethod and addressesNick Mathewson2022-10-111-5/+7
| | | | | | | Now each `ChanTarget` has at most one `ChannelMethod`, and only `Direct` `ChannelMethods` can have multiple addresses. Closes #600.
* Clarify limits on socket address from ChannelMethodNick Mathewson2022-10-061-2/+8
|
* ChannelMethod: Add method to access the (optional) SocketAddrNick Mathewson2022-10-061-0/+18
|
* pt: transport ID error: Fix style to remove full stopIan Jackson2022-10-031-1/+1
|
* pt: Check PT key=value syntaxIan Jackson2022-10-031-2/+27
| | | | | This is not perfect but it at least ensures that our own parsing and printing code works correctly with all the values we accept.
* pt: Make PtTarget::push_setting fallible, and take IntoIan Jackson2022-10-031-2/+18
| | | | | | It has its own error type PtTargetInvalidSetting. In check_doc_features, adjust suppression to new code.
* pt: PtTransportAddr: change None string to "-"Ian Jackson2022-10-031-2/+2
| | | | | This is going to appear in config files etc. We don't want the user to have to type "<none>" in a bridge line.
* pt: Provide accessors for PtTargetIan Jackson2022-09-301-1/+15
|
* pt: Make some more types EqIan Jackson2022-09-301-3/+3
| | | | I wanted this for testing. I think it's reasonable to promise this.
* pt: Provide constructors for PtTargetIan Jackson2022-09-301-5/+23
| | | | | | | | Make PtTargetSettings be Default. No longer wrap it in Arc. We want to be able to update it here during construction. If we want to save memory with copies of the same bridge line, we should do this for the whole Bridge I think.
* pt: Reject a pluggable transport named BridgeIan Jackson2022-09-271-0/+5
| | | | https://gitlab.torproject.org/tpo/core/torspec/-/merge_requests/91
* Remove docsrs thing which is in wrong place?Ian Jackson2022-09-271-1/+0
|
* pt: Try to fix docsrs problemIan Jackson2022-09-271-0/+1
|
* pt: Use PtTransportName in PtTargetIan Jackson2022-09-271-1/+1
|
* pt: Use PtTransportName in TransportIdIan Jackson2022-09-271-2/+2
|
* pt: PtTransportName: Provide TryFrom, into_inner, AsRefIan Jackson2022-09-271-4/+27
| | | | This seems a minimal API for such a thing.
* pt: tor-linkspec: Shorten some names with useIan Jackson2022-09-271-12/+17
| | | | This repetition was getting repetitive.
* pt: Introduce PtTransportNameIan Jackson2022-09-271-4/+32
| | | | | The config parsing wants this. Also there are some anomalies in the types here that ought to be tidied up.
* Add a few comments based on review.Nick Mathewson2022-09-231-0/+8
|
* Clarify and combine PtTargetAddr constructors.Nick Mathewson2022-09-231-16/+23
|
* Rename various Transport* types to Pt*.Nick Mathewson2022-09-231-39/+40
| | | | | This clarifies that the types apply to pluggable transports only, and not (typically) to the default plain-old-TCP transport.
* Clarify note on "none" transport ID.Ian Jackson2022-09-231-0/+3
|
* New data types to describe transport targets.Nick Mathewson2022-09-231-0/+48
| | | | | I've tried to name and structure these for consistency, and comment reasonably well. We'll still probably want to make changes.
* Add TransportTargetAddr as the target address for a PT-using channelNick Mathewson2022-09-231-0/+117
| | | | | | As with `TransportId`, this type only gets complicated when `pt-client` is enabled: it's meant to stay simple for relays and non-PT-using clients.
* Create an API for TransportIdNick Mathewson2022-09-231-0/+160