arti-client: add exit selection with GeoIP country codes
This threads the country codes work through the rest of the codebase:
-
tor-dirmgr
will now enable GeoIP with the embedded database when thegeoip
future is enabled- This can be extended later using the
DirMgrConfig
to allow specifying a custom database; this is not done here, though
- This can be extended later using the
-
tor-circmgr
'sSupportedCircUsage
andTargetCircUsage
fields gain newcountry_code
members to allow filtering circuits by country- These are
()
in builds where thegeoip
feature is not enabled -- doing it this way means we don't have to copy and paste huge swathes of code, since we can't use#[cfg]
in patterns
- These are
-
ExitPathBuilder
gains (hacked-in) support for choosing a relay with the correct country code- Due to the lack of conjuction, we just copy and paste a small bit, pending further refactoring
-
StreamPrefs
now lets you specify a country code, letting embedders make use of the feature