Tor
0.4.7.0-alpha-dev
|
Implement mechanism for a relay to find its address. More...
#include "core/or/or.h"
#include "app/config/config.h"
#include "app/config/resolve_addr.h"
#include "core/mainloop/mainloop.h"
#include "core/or/circuitlist.h"
#include "core/or/circuituse.h"
#include "core/or/extendinfo.h"
#include "feature/control/control_events.h"
#include "feature/dircommon/dir_connection_st.h"
#include "feature/nodelist/dirlist.h"
#include "feature/nodelist/node_select.h"
#include "feature/nodelist/nodelist.h"
#include "feature/nodelist/routerstatus_st.h"
#include "feature/relay/relay_find_addr.h"
#include "feature/relay/router.h"
#include "feature/relay/routermode.h"
Go to the source code of this file.
Macros | |
#define | DUMMY_DOWNLOAD_INTERVAL (20*60) |
Functions | |
void | relay_address_new_suggestion (const tor_addr_t *suggested_addr, const tor_addr_t *peer_addr, const char *identity_digest) |
bool | relay_find_addr_to_publish (const or_options_t *options, int family, int flags, tor_addr_t *addr_out) |
void | relay_addr_learn_from_dirauth (void) |
Implement mechanism for a relay to find its address.
Definition in file relay_find_addr.c.
#define DUMMY_DOWNLOAD_INTERVAL (20*60) |
How often should we launch a circuit to an authority to be sure of getting a guess for our IP?
Definition at line 177 of file relay_find_addr.c.
void relay_address_new_suggestion | ( | const tor_addr_t * | suggested_addr, |
const tor_addr_t * | peer_addr, | ||
const char * | identity_digest | ||
) |
Consider the address suggestion suggested_addr as a possible one to use as our address.
This is called when a valid NETINFO cell is received containing a candidate for our address or when a directory sends us back the X-Your-Address-Is header.
The suggested address is ignored if it does NOT come from a trusted source. At the moment, we only look a trusted directory authorities.
The suggested address is ignored if it is internal or it is the same as the given peer_addr which is the address from the endpoint that sent the NETINFO cell.
The identity_digest is NULL if this is an address suggested by a directory since this is a plaintext connection.
The suggested address is set in our suggested address cache if everything passes.
Definition at line 49 of file relay_find_addr.c.
bool relay_find_addr_to_publish | ( | const or_options_t * | options, |
int | family, | ||
int | flags, | ||
tor_addr_t * | addr_out | ||
) |
Find our address to be published in our descriptor. Three places are looked at:
The AddressDisableIPv6 is checked here for IPv6 address discovery and if set, false is returned and addr_out is UNSPEC.
Before doing any discovery, the configuration is checked for an ORPort of the given family. If none can be found, false is returned and addr_out is UNSPEC.
Return true on success and addr_out contains the address to use for the given family. On failure to find the address, false is returned and addr_out is set to an AF_UNSPEC address.
Definition at line 114 of file relay_find_addr.c.
Referenced by pt_get_extra_info_descriptor_string().