80 router_get_fallback_dir_servers_mutable(
void)
89 router_get_trusted_dir_servers(
void)
95 router_get_fallback_dir_servers(
void)
97 return router_get_fallback_dir_servers_mutable();
199 } SMARTLIST_FOREACH_END(dir);
216 return (!type) || ((type & ent->type) != 0);
229 const char *hostname,
232 const char *digest,
const char *v3_auth_digest,
238 char *hostname_ = NULL;
253 hostname_ = tor_strdup(hostname);
264 ent->weight = weight;
267 log_warn(
LD_BUG,
"Hey, I got a non-ipv6 addr as addrport_ipv6.");
282 tor_asprintf(&ent->description,
"directory server \"%s\" at %s:%d",
285 tor_asprintf(&ent->description,
"directory server at %s:%d",
311 const char *digest,
const char *v3_auth_digest,
321 &a, NULL, &hostname) < 0) {
323 "Couldn't find a suitable address when adding ourself as a " 324 "trusted directory server.");
332 "Unable to lookup address for directory server at '%s'",
336 hostname = tor_strdup(address);
344 v3_auth_digest, type, weight);
356 const char *id_digest,
double weight)
361 NULL, ALL_DIRINFO, weight);
380 #define dir_server_free(val) \ 381 FREE_AND_NULL(dir_server_t, dir_server_free_, (val)) 402 dir_server_free(ent));
416 dirlist_free_all(
void)
void dir_server_add(dir_server_t *ent)
routerstatus_t * router_get_mutable_consensus_status_by_id(const char *digest)
#define SMARTLIST_FOREACH_BEGIN(sl, type, var)
#define MOCK_IMPL(rv, funcname, arglist)
void tor_addr_make_unspec(tor_addr_t *a)
void router_dir_info_changed(void)
int authdir_mode(const or_options_t *options)
static smartlist_t * fallback_dir_servers
int get_n_authorities(dirinfo_type_t type)
Header file for nodelist.c.
static dir_server_t * dir_server_new(int is_authority, const char *nickname, const tor_addr_t *addr, const char *hostname, uint16_t dir_port, uint16_t or_port, const tor_addr_port_t *addrport_ipv6, const char *digest, const char *v3_auth_digest, dirinfo_type_t type, double weight)
Header file for directory.c.
void smartlist_add(smartlist_t *sl, void *element)
char nickname[MAX_NICKNAME_LEN+1]
static void dir_server_free_(dir_server_t *ds)
Node information structure.
Header file for config.c.
int router_digest_is_fallback_dir(const char *digest)
const or_options_t * get_options(void)
static uint32_t tor_addr_to_ipv4h(const tor_addr_t *a)
smartlist_t * smartlist_new(void)
dir_server_t * router_get_trusteddirserver_by_digest(const char *digest)
char v3_identity_digest[DIGEST_LEN]
Header file for routerset.c.
Header file for directory authority mode.
smartlist_t * router_get_trusted_dir_servers_mutable(void)
Trusted/fallback directory server structure.
Header file for policies.c.
int router_digest_is_trusted_dir_type(const char *digest, dirinfo_type_t type)
#define tor_addr_from_ipv4h(dest, v4addr)
int tor_memeq(const void *a, const void *b, size_t sz)
int tor_asprintf(char **strp, const char *fmt,...)
dir_server_t * trusted_dir_server_new(const char *nickname, const char *address, uint16_t dir_port, uint16_t or_port, const tor_addr_port_t *ipv6_addrport, const char *digest, const char *v3_auth_digest, dirinfo_type_t type, double weight)
Master header file for Tor-specific functionality.
static smartlist_t * trusted_dir_servers
dir_server_t * fallback_dir_server_new(const tor_addr_t *addr, uint16_t dir_port, uint16_t or_port, const tor_addr_port_t *addrport_ipv6, const char *id_digest, double weight)
int resolve_my_address(int warn_severity, const or_options_t *options, uint32_t *addr_out, const char **method_out, char **hostname_out)
unsigned int is_authority
void router_reset_status_download_failures(void)
int control_event_networkstatus_changed_single(const routerstatus_t *rs)
char * tor_addr_to_str_dup(const tor_addr_t *addr)
#define SMARTLIST_FOREACH(sl, type, var, cmd)
Header file for router.c.
dir_server_t * router_get_fallback_dirserver_by_digest(const char *digest)
char identity_digest[DIGEST_LEN]
int router_digest_is_me(const char *digest)
Header file for dirlist.c.
dir_server_t * trusteddirserver_get_by_v3_auth_digest(const char *digest)
void mark_all_dirservers_up(smartlist_t *server_list)
routerstatus_t fake_status
void clear_dir_servers(void)
node_t * node_get_mutable_by_id(const char *identity_digest)
unsigned int is_authority
void tor_addr_copy(tor_addr_t *dest, const tor_addr_t *src)
Header file for control_events.c.
void smartlist_clear(smartlist_t *sl)
Header file for networkstatus.c.
Header file for routerlist.c.
static sa_family_t tor_addr_family(const tor_addr_t *a)
int tor_lookup_hostname(const char *name, uint32_t *addr)
char * tor_dup_ip(uint32_t addr)