aboutsummaryrefslogtreecommitdiff
path: root/src/app/config/resolve_addr.h
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2020-07-06 11:09:39 -0400
committerDavid Goulet <dgoulet@torproject.org>2020-07-07 10:52:43 -0400
commit809c8647079e3e84d401db25055144c5180aa75d (patch)
treeadfabf89ab5f12e7b719143839f7595921440dab /src/app/config/resolve_addr.h
parentbc63f59f3c45c61296aac94411f9ab73cfbda322 (diff)
downloadtor-809c8647079e3e84d401db25055144c5180aa75d.tar.gz
tor-809c8647079e3e84d401db25055144c5180aa75d.zip
addr: Attempt to learn our address with ORPort
If no Address statement are found in the configuration file, attempt to learn our address by looking at the ORPort address if any. Specifying an address is optional so if we can't find one, it is fine, we move on to the next discovery mechanism. Note that specifying a hostname on the ORPort is not yet supported at this commit. Closes #33236 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.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/app/config/resolve_addr.h b/src/app/config/resolve_addr.h
index 54f55ba36c..e6f8a72554 100644
--- a/src/app/config/resolve_addr.h
+++ b/src/app/config/resolve_addr.h
@@ -9,8 +9,14 @@
#ifndef TOR_CONFIG_RESOLVE_ADDR_H
#define TOR_CONFIG_RESOLVE_ADDR_H
+#include "app/config/config.h"
+#include "core/mainloop/connection.h"
+
#include "app/config/or_options_st.h"
+#define get_orport_addr(family) \
+ (get_first_advertised_addr_by_type_af(CONN_TYPE_OR_LISTENER, family))
+
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);