|
Tor 0.4.9.3-alpha-dev
|
Header file for dirlist.c. More...
Go to the source code of this file.
Macros | |
| #define | router_addr_is_trusted_dir(d) router_addr_is_trusted_dir_type((d), NO_DIRINFO) |
| #define | router_digest_is_trusted_dir(d) router_digest_is_trusted_dir_type((d), NO_DIRINFO) |
Enumerations | |
| enum | auth_dirport_usage_t { AUTH_USAGE_LEGACY , AUTH_USAGE_UPLOAD , AUTH_USAGE_VOTING , AUTH_USAGE_DOWNLOAD } |
| #define router_addr_is_trusted_dir | ( | d | ) | router_addr_is_trusted_dir_type((d), NO_DIRINFO) |
| #define router_digest_is_trusted_dir | ( | d | ) | router_digest_is_trusted_dir_type((d), NO_DIRINFO) |
| enum auth_dirport_usage_t |
Different usages for an authority's HTTP directory port.
Historically, only legacy ports existed; proposal 330 added multiple types of dirport to better enable authorities to offload work and resist DoS attacks.
| auth_dirport_usage_t auth_dirport_usage_for_purpose | ( | int | purpose | ) |
Return an appropriate usage value describing which authdir port to use for a given directory connection purpose.
Definition at line 304 of file dirlist.c.
Referenced by directory_request_set_dir_from_routerstatus().
| void clear_dir_servers | ( | void | ) |
Remove all members from the list of dir servers.
Definition at line 600 of file dirlist.c.
Referenced by consider_adding_dir_servers().
| void dir_server_add | ( | dir_server_t * | ent | ) |
Add a directory server to the global list(s).
Definition at line 564 of file dirlist.c.
Referenced by init_keys(), parse_dir_authority_line(), and parse_dir_fallback_line().
| void dirlist_add_trusted_dir_addresses | ( | void | ) |
Go over the trusted directory server list and add their address(es) to the nodelist address set. This is called every time a new consensus is set.
Definition at line 87 of file dirlist.c.
Referenced by nodelist_set_consensus().
| dir_server_t * fallback_dir_server_new | ( | const tor_addr_t * | ipv4_addr, |
| uint16_t | ipv4_dirport, | ||
| uint16_t | ipv4_orport, | ||
| const tor_addr_port_t * | addrport_ipv6, | ||
| const char * | id_digest, | ||
| double | weight | ||
| ) |
Return a new dir_server_t for a fallback directory server at addr:or_port/dir_port, with identity key digest id_digest
Definition at line 553 of file dirlist.c.
Referenced by parse_dir_fallback_line().
| int get_n_authorities | ( | dirinfo_type_t | type | ) |
Return the number of directory authorities whose type matches some bit set in type
Definition at line 103 of file dirlist.c.
Referenced by dirvote_compute_consensuses(), fetch_bridge_descriptors(), networkstatus_check_consensus_signature(), networkstatus_compute_consensus(), nodelist_set_consensus(), and should_keep_srv().
| void mark_all_dirservers_up | ( | smartlist_t * | server_list | ) |
Mark as running every dir_server_t in server_list.
Definition at line 232 of file dirlist.c.
Referenced by router_pick_dirserver_generic(), and router_reset_status_download_failures().
| bool router_addr_is_trusted_dir_type | ( | const tor_addr_t * | addr, |
| dirinfo_type_t | type | ||
| ) |
| int router_digest_is_fallback_dir | ( | const char * | digest | ) |
Return 1 if any fallback dirserver's identity key hashes to digest, or 0 if no such fallback is in the list of fallback_dir_servers. (fallback_dir_servers is affected by the FallbackDir and UseDefaultFallbackDirs torrc options.) The list of fallback directories includes the list of authorities.
Definition at line 205 of file dirlist.c.
Referenced by connection_or_client_learned_peer_id().
| int router_digest_is_trusted_dir_type | ( | const char * | digest, |
| dirinfo_type_t | type | ||
| ) |
| const smartlist_t * router_get_fallback_dir_servers | ( | void | ) |
| smartlist_t * router_get_fallback_dir_servers_mutable | ( | void | ) |
| dir_server_t * router_get_fallback_dirserver_by_digest | ( | const char * | digest | ) |
Return the dir_server_t for the fallback dirserver whose identity key hashes to digest, or NULL if no such fallback is in the list of fallback_dir_servers. (fallback_dir_servers is affected by the FallbackDir and UseDefaultFallbackDirs torrc options.) The list of fallback directories includes the list of authorities.
Definition at line 181 of file dirlist.c.
Referenced by authority_certs_fetch_missing(), connection_dir_client_reached_eof(), and router_digest_is_fallback_dir().
| const smartlist_t * router_get_trusted_dir_servers | ( | void | ) |
| smartlist_t * router_get_trusted_dir_servers_mutable | ( | void | ) |
Return a smartlist containing a list of dir_server_t * for all known trusted dirservers. Callers must not modify the list or its contents.
Definition at line 119 of file dirlist.c.
Referenced by router_pick_trusteddirserver().
| dir_server_t * router_get_trusteddirserver_by_digest | ( | const char * | digest | ) |
Return the dir_server_t for the directory authority whose identity key hashes to digest, or NULL if no such authority is known.
Definition at line 160 of file dirlist.c.
Referenced by directory_request_set_dir_from_routerstatus(), handle_response_upload_dir(), init_keys(), and microdesc_note_outdated_dirserver().
| void trusted_dir_server_add_dirport | ( | dir_server_t * | ds, |
| auth_dirport_usage_t | usage, | ||
| const tor_addr_port_t * | dirport | ||
| ) |
Add dirport as an HTTP DirPort contact point for the directory authority ds, for use when contacting that authority for the given usage.
Multiple ports of the same usage are allowed; if present, then only the first one of each address family is currently used.
Definition at line 477 of file dirlist.c.
Referenced by parse_dirauth_dirport(), and trusted_dir_server_new().
| const tor_addr_port_t * trusted_dir_server_get_dirport | ( | const dir_server_t * | ds, |
| auth_dirport_usage_t | usage, | ||
| int | addr_family | ||
| ) |
Return the DirPort of the authority ds for with the usage type usage and address family addr_family. If none is found, try again with an AUTH_USAGE_LEGACY dirport, if there is one. Return NULL if no port can be found.
Definition at line 529 of file dirlist.c.
Referenced by directory_request_set_dir_from_routerstatus().
| const tor_addr_port_t * trusted_dir_server_get_dirport_exact | ( | const dir_server_t * | ds, |
| auth_dirport_usage_t | usage, | ||
| int | addr_family | ||
| ) |
Helper for trusted_dir_server_get_dirport: only return the exact requested usage type.
Definition at line 503 of file dirlist.c.
Referenced by directory_request_set_dir_from_routerstatus(), and trusted_dir_server_get_dirport().
| dir_server_t * trusted_dir_server_new | ( | const char * | nickname, |
| const char * | address, | ||
| uint16_t | ipv4_dirport, | ||
| uint16_t | ipv4_orport, | ||
| const tor_addr_port_t * | ipv6_addrport, | ||
| const char * | digest, | ||
| const char * | v3_auth_digest, | ||
| dirinfo_type_t | type, | ||
| double | weight | ||
| ) |
Create an authoritative directory server at address:port, with identity key digest. If ipv4_addr_str is NULL, add ourself. Return the new trusted directory server entry on success or NULL if we couldn't add it.
Definition at line 419 of file dirlist.c.
Referenced by init_keys(), and parse_dir_authority_line().
| dir_server_t * trusteddirserver_get_by_v3_auth_digest | ( | const char * | digest | ) |
Return the dir_server_t for the directory authority whose v3 identity key hashes to digest, or NULL if no such authority is known.
Definition at line 215 of file dirlist.c.
Referenced by authority_certs_fetch_missing(), dirvote_add_vote(), networkstatus_check_consensus_signature(), should_keep_commit(), sr_compute_srv(), trusted_dirs_load_certs_from_string(), and update_consensus_router_descriptor_downloads().