51 const char *identity_digest)
66 if (!router_addr_is_trusted_dir(peer_addr) ||
67 (identity_digest && !router_digest_is_trusted_dir(identity_digest))) {
73 if (tor_addr_is_internal(suggested_addr, 0)) {
80 "A relay endpoint %s is telling us that their address is ours.",
143 if (!(flags & RELAY_FIND_ADDR_CACHE_ONLY)) {
158 static ratelim_t rlim = RATELIM_INIT(3600);
160 "Unable to find %s address for ORPort %u. "
161 "You might want to specify %sOnly to it or set an "
162 "explicit address or set Address.",
177 #define DUMMY_DOWNLOAD_INTERVAL (20*60)
180 relay_addr_learn_from_dirauth(
void)
182 static time_t last_dummy_circuit = 0;
184 time_t now = time(NULL);
198 RELAY_FIND_ADDR_CACHE_ONLY,
205 last_dummy_circuit = now;
220 log_info(
LD_GENERAL,
"Can't build a circuit to an authority. Unable to "
221 "learn for now our address from them.");
229 log_debug(
LD_GENERAL,
"Attempting dummy testing circuit to an authority "
230 "in order to learn our address.");
237 extend_info_free(ei);
void tor_addr_make_unspec(tor_addr_t *a)
const char * fmt_af_family(sa_family_t family)
int tor_addr_is_null(const tor_addr_t *addr)
#define tor_addr_eq(a, b)
Header file for circuitlist.c.
#define CIRCUIT_PURPOSE_TESTING
origin_circuit_t * circuit_launch_by_extend_info(uint8_t purpose, extend_info_t *extend_info, int flags)
Header file for circuituse.c.
#define CIRCLAUNCH_ONEHOP_TUNNEL
#define CIRCLAUNCH_IS_INTERNAL
const or_options_t * get_options(void)
Header file for config.c.
Header file for control_events.c.
Client/server directory connection structure.
Header file for dirlist.c.
extend_info_t * extend_info_from_node(const node_t *node, int for_direct_connect)
Header for core/or/extendinfo.c.
#define log_fn(severity, domain, args,...)
#define log_fn_ratelim(ratelim, severity, domain, args,...)
Header file for mainloop.c.
const routerstatus_t * router_pick_trusteddirserver(dirinfo_type_t type, int flags)
Header file for node_select.c.
const node_t * node_get_by_id(const char *identity_digest)
Header file for nodelist.c.
Master header file for Tor-specific functionality.
bool relay_find_addr_to_publish(const or_options_t *options, int family, int flags, tor_addr_t *addr_out)
void relay_address_new_suggestion(const tor_addr_t *suggested_addr, const tor_addr_t *peer_addr, const char *identity_digest)
#define DUMMY_DOWNLOAD_INTERVAL
Header file for relay_find_addr.c.
void resolved_addr_set_suggested(const tor_addr_t *addr)
bool find_my_address(const or_options_t *options, int family, int warn_severity, tor_addr_t *addr_out, resolved_addr_method_t *method_out, char **hostname_out)
Attempt to find our IP address that can be used as our external reachable address.
void resolved_addr_get_suggested(int family, tor_addr_t *addr_out)
void resolved_addr_get_last(int family, tor_addr_t *addr_out)
Header file for resolve_addr.c.
uint16_t routerconf_find_or_port(const or_options_t *options, sa_family_t family)
Header file for router.c.
int server_mode(const or_options_t *options)
Header file for routermode.c.
Routerstatus (consensus entry) structure.
char identity_digest[DIGEST_LEN]
#define MOCK_IMPL(rv, funcname, arglist)