diff options
author | David Goulet <dgoulet@torproject.org> | 2020-06-18 13:39:20 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2020-06-24 13:51:37 -0400 |
commit | 9e85056de9ffe4858e2a07a5fd5e5fd4d144e688 (patch) | |
tree | e6aecde5cc551c255f5859ddd24f692389f5a381 /src/app/config/resolve_addr.h | |
parent | d08d7e1535fe7b47319e67ca31d4b8f64fdea465 (diff) | |
download | tor-9e85056de9ffe4858e2a07a5fd5e5fd4d144e688.tar.gz tor-9e85056de9ffe4858e2a07a5fd5e5fd4d144e688.zip |
addr: New find_my_address() to support multiple address families
resolve_my_address() was beyond repair in terms of refactoring. Way too
complex and doing too many things.
This commit implements find_my_address() which in theory does the same as
resolve_my_address() but in a more clean, concise and modern way using the
tor_addr_t interface and for multiple address family.
The caller needs to pass the address family (IPv4 or IPv6) which this
interface supports. For both, a last resolved cache is used as well.
Implements #33233
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/app/config/resolve_addr.h')
-rw-r--r-- | src/app/config/resolve_addr.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/app/config/resolve_addr.h b/src/app/config/resolve_addr.h index 6c94fe06ba..2cd27d1700 100644 --- a/src/app/config/resolve_addr.h +++ b/src/app/config/resolve_addr.h @@ -15,6 +15,10 @@ int resolve_my_address_v4(int warn_severity, const or_options_t *options, uint32_t *addr_out, const char **method_out, char **hostname_out); +bool find_my_address(const or_options_t *options, int family, + int warn_severity, tor_addr_t *addr_out, + const char **method_out, char **hostname_out); + uint32_t get_last_resolved_addr_v4(void); void reset_last_resolved_addr_v4(void); |