Skip to content

tor-linkspec: Refactor HasAddrs, HasChanMethods, and Owned* objects

Nick Mathewson requested to merge nickm/arti:addrs-api into main

This is a hefty diff, but a fairly simple (I hope) set of changes.

  • HasAddrs now represents something that has an address, not necessarily something that can be connected to at that address. ("Having" an address is relevant for family decisions and geoip.)
  • HasChannelMethods now represents something that we can open a channel to in some way, either with TLS-over-TCP or a pluggable transport. It is now a required supertrait for ChanTarget.
  • The OwnedChanTarget, OwnedCircTarget, and RelayIds types now have builders instead of new functions. (Their constructors were marked for removal, and had proven to be unstable.)
    • (This last part required a bunch of other code to change)
  • tor_proto::Channel now keeps track of the ChannelMethods it was asked to connect to, not the address.
  • Our HasAddr users, where appropriate, now use ChannelMethod::Direct instead.

@Diziet @eta since this involves API changes in key tor-linkspec traits, I'd like both of your feedback on that part before I merge.

Merge request reports

Loading