Macros | Typedefs | Enumerations | Functions
routerlist.h File Reference
#include "lib/testsupport/testsupport.h"

Go to the source code of this file.


#define DIR_503_TIMEOUT   (60*60)
#define routerinfo_free(router)   FREE_AND_NULL(routerinfo_t, routerinfo_free_, (router))
#define extrainfo_free(ei)   FREE_AND_NULL(extrainfo_t, extrainfo_free_, (ei))
#define routerlist_free(rl)   FREE_AND_NULL(routerlist_t, routerlist_free_, (rl))


typedef enum was_router_added_t was_router_added_t


enum  was_router_added_t {


int router_reload_router_list (void)
int router_skip_or_reachability (const or_options_t *options, int try_ip_pref)
int router_skip_dir_reachability (const or_options_t *options, int try_ip_pref)
void router_reset_status_download_failures (void)
int routers_have_same_or_addrs (const routerinfo_t *r1, const routerinfo_t *r2)
void router_add_running_nodes_to_smartlist (smartlist_t *sl, int need_uptime, int need_capacity, int need_guard, int need_desc, int pref_addr, int direct_conn)
const routerinfo_trouterlist_find_my_routerinfo (void)
uint32_t router_get_advertised_bandwidth (const routerinfo_t *router)
uint32_t router_get_advertised_bandwidth_capped (const routerinfo_t *router)
int hexdigest_to_digest (const char *hexdigest, char *digest)
const routerinfo_trouter_get_by_id_digest (const char *digest)
routerinfo_trouter_get_mutable_by_digest (const char *digest)
signed_descriptor_trouter_get_by_descriptor_digest (const char *digest)
 MOCK_DECL (signed_descriptor_t *, router_get_by_extrainfo_digest,(const char *digest))
 MOCK_DECL (signed_descriptor_t *, extrainfo_get_by_descriptor_digest,(const char *digest))
const char * signed_descriptor_get_body (const signed_descriptor_t *desc)
const char * signed_descriptor_get_annotations (const signed_descriptor_t *desc)
routerlist_trouter_get_routerlist (void)
void routerinfo_free_ (routerinfo_t *router)
void extrainfo_free_ (extrainfo_t *extrainfo)
void routerlist_free_ (routerlist_t *rl)
void dump_routerlist_mem_usage (int severity)
void routerlist_remove (routerlist_t *rl, routerinfo_t *ri, int make_old, time_t now)
void routerlist_free_all (void)
void routerlist_reset_warnings (void)
void list_pending_downloads (digestmap_t *result, digest256map_t *result256, int purpose, const char *prefix)
static int WRA_WAS_ADDED (was_router_added_t s)
static int WRA_WAS_OUTDATED (was_router_added_t s)
static int WRA_WAS_REJECTED (was_router_added_t s)
static int WRA_NEVER_DOWNLOADABLE (was_router_added_t s)
was_router_added_t router_add_to_routerlist (routerinfo_t *router, const char **msg, int from_cache, int from_fetch)
was_router_added_t router_add_extrainfo_to_routerlist (extrainfo_t *ei, const char **msg, int from_cache, int from_fetch)
void routerlist_descriptors_added (smartlist_t *sl, int from_cache)
void routerlist_remove_old_routers (void)
int router_load_single_router (const char *s, uint8_t purpose, int cache, const char **msg)
int router_load_routers_from_string (const char *s, const char *eos, saved_location_t saved_location, smartlist_t *requested_fingerprints, int descriptor_digests, const char *prepend_annotations)
void router_load_extrainfo_from_string (const char *s, const char *eos, saved_location_t saved_location, smartlist_t *requested_fingerprints, int descriptor_digests)
void routerlist_retry_directory_downloads (time_t now)
int router_exit_policy_rejects_all (const routerinfo_t *router)
void update_consensus_router_descriptor_downloads (time_t now, int is_vote, networkstatus_t *consensus)
void update_router_descriptor_downloads (time_t now)
void update_all_descriptor_downloads (time_t now)
void update_extrainfo_downloads (time_t now)
void router_reset_descriptor_download_failures (void)
int router_differences_are_cosmetic (const routerinfo_t *r1, const routerinfo_t *r2)
int routerinfo_incompatible_with_extrainfo (const crypto_pk_t *ri, extrainfo_t *ei, signed_descriptor_t *sd, const char **msg)
int routerinfo_has_curve25519_onion_key (const routerinfo_t *ri)
int routerstatus_version_supports_extend2_cells (const routerstatus_t *rs, int allow_unknown_versions)
void routerlist_assert_ok (const routerlist_t *rl)
const char * esc_router_info (const routerinfo_t *router)
void routers_sort_by_identity (smartlist_t *routers)
void refresh_all_country_info (void)
void list_pending_microdesc_downloads (digest256map_t *result)
void launch_descriptor_downloads (int purpose, smartlist_t *downloadable, const routerstatus_t *source, time_t now)
int hex_digest_nickname_decode (const char *hexdigest, char *digest_out, char *nickname_qualifier_out, char *nickname_out)
int hex_digest_nickname_matches (const char *hexdigest, const char *identity_digest, const char *nickname)

Detailed Description

Header file for routerlist.c.

Header file for routerset.c.

Definition in file routerlist.h.

Macro Definition Documentation


#define DIR_503_TIMEOUT   (60*60)

How long do we avoid using a directory server after it's given us a 503?

Definition at line 46 of file routerlist.h.

Typedef Documentation

◆ was_router_added_t

Enumeration Type Documentation

◆ was_router_added_t

Return value for router_add_to_routerlist() and dirserv_add_descriptor()

Definition at line 17 of file routerlist.h.

Function Documentation

◆ dump_routerlist_mem_usage()

void dump_routerlist_mem_usage ( int  severity)

Log information about how much memory is being used for routerlist, at log level severity.

Definition at line 976 of file routerlist.c.

References LD_DIR, routerlist_t::old_routers, routerlist, routerlist_t::routers, signed_descriptor_t::signed_descriptor_len, SMARTLIST_FOREACH, and tor_log().

Referenced by dumpmemusage().

◆ esc_router_info()

const char* esc_router_info ( const routerinfo_t router)

Allocate and return a new string representing the contact info and platform string for router, surrounded by quotes and using standard C escapes.

THIS FUNCTION IS NOT REENTRANT. Don't call it from outside the main thread. Also, each call invalidates the last-returned value, so don't try log_warn(LD_GENERAL, "%s %s", esc_router_info(a), esc_router_info(b));

If router is NULL, it just frees its internal memory and returns.

Definition at line 3179 of file routerlist.c.

References routerinfo_t::contact_info, esc_for_log(), routerinfo_t::platform, tor_asprintf(), and tor_free.

◆ extrainfo_free_()

void extrainfo_free_ ( extrainfo_t extrainfo)

Release all storage held by extrainfo

Definition at line 864 of file routerlist.c.

References extrainfo_t::pending_sig, signed_descriptor_t::signed_descriptor_body, signed_descriptor_t::signing_key_cert, and tor_free.

Referenced by extrainfo_free_void().

◆ hex_digest_nickname_decode()

int hex_digest_nickname_decode ( const char *  hexdigest,
char *  digest_out,
char *  nickname_qualifier_char_out,
char *  nickname_out 

Helper: given an extended nickname in hexdigest try to decode it. Return 0 on success, -1 on failure. Store the result into the DIGEST_LEN-byte buffer at digest_out, the single character at nickname_qualifier_char_out, and the MAXNICKNAME_LEN+1-byte buffer at nickname_out.

The recognized format is: HexName = Dollar? HexDigest NamePart? Dollar = '?' HexDigest = HexChar*20 HexChar = 'a'..'f' | 'A'..'F' | '0'..'9' NamePart = QualChar Name QualChar = '=' | '~' Name = NameChar*(1..MAX_NICKNAME_LEN) NameChar = Any ASCII alphanumeric character

Definition at line 598 of file routerlist.c.

References HEX_DIGEST_LEN, MAX_NICKNAME_LEN, and tor_assert().

Referenced by hex_digest_nickname_matches(), and node_get_by_hex_id().

◆ hex_digest_nickname_matches()

int hex_digest_nickname_matches ( const char *  hexdigest,
const char *  identity_digest,
const char *  nickname 

Helper: Return true iff the identity_digest and nickname combination of a router, encoded in hexadecimal, matches hexdigest (which is optionally prefixed with a single dollar sign). Return false if hexdigest is malformed, or it doesn't match.

Definition at line 634 of file routerlist.c.

References DIGEST_LEN, hex_digest_nickname_decode(), MAX_NICKNAME_LEN, and tor_memeq().

Referenced by node_nickname_matches().

◆ hexdigest_to_digest()

int hexdigest_to_digest ( const char *  hexdigest,
char *  digest 

If hexdigest is correctly formed, base16_decode it into digest, which must have DIGEST_LEN space in it. Return 0 on success, -1 on failure.

Definition at line 663 of file routerlist.c.

References base16_decode(), DIGEST_LEN, and HEX_DIGEST_LEN.

◆ launch_descriptor_downloads()

void launch_descriptor_downloads ( int  purpose,
smartlist_t downloadable,
const routerstatus_t source,
time_t  now 

Given a purpose (FETCH_MICRODESC or FETCH_SERVERDESC) and a list of router descriptor digests or microdescriptor digest256s in downloadable, decide whether to delay fetching until we have more. If we don't want to delay, launch one or more requests to the appropriate directory authorities.

Definition at line 2432 of file routerlist.c.


◆ list_pending_downloads()

void list_pending_downloads ( digestmap_t *  result,
digest256map_t *  result256,
int  purpose,
const char *  prefix 

For every current directory connection whose purpose is purpose, and where the resource being downloaded begins with prefix, split rest of the resource into base16 fingerprints (or base64 fingerprints if purpose==DIR_PURPOSE_FETCH_MICRODESC), decode them, and set the corresponding elements of result to a nonzero value.

Definition at line 2254 of file routerlist.c.

Referenced by list_pending_descriptor_downloads(), and list_pending_microdesc_downloads().

◆ list_pending_microdesc_downloads()

void list_pending_microdesc_downloads ( digest256map_t *  result)

For every microdescriptor we are currently downloading by descriptor digest, set result[d] to (void*)1.

Definition at line 2308 of file routerlist.c.

References DIR_PURPOSE_FETCH_MICRODESC, and list_pending_downloads().

◆ refresh_all_country_info()

void refresh_all_country_info ( void  )

Called when we change a node set, or when we reload the geoip IPv4 list: recompute all country info in all configuration node sets and in the routerlist.

Definition at line 3220 of file routerlist.c.

References or_options_t::EntryNodes, or_options_t::ExcludeExitNodes, or_options_t::ExcludeExitNodesUnion_, or_options_t::ExcludeNodes, or_options_t::ExitNodes, or_options_t::MiddleNodes, nodelist_refresh_countries(), and routerset_refresh_countries().

Referenced by config_maybe_load_geoip_files_().

◆ router_add_extrainfo_to_routerlist()

was_router_added_t router_add_extrainfo_to_routerlist ( extrainfo_t ei,
const char **  msg,
int  from_cache,
int  from_fetch 

Insert ei into the routerlist, or free it. Other arguments are as for router_add_to_routerlist(). Return ROUTER_ADDED_SUCCESSFULLY iff we actually inserted it, ROUTER_BAD_EI otherwise.

Definition at line 1658 of file routerlist.c.

References routerlist_t::extrainfo_store, router_get_routerlist(), routerlist, signed_desc_append_to_journal(), and WRA_WAS_ADDED().

◆ router_add_running_nodes_to_smartlist()

void router_add_running_nodes_to_smartlist ( smartlist_t sl,
int  need_uptime,
int  need_capacity,
int  need_guard,
int  need_desc,
int  pref_addr,
int  direct_conn 

Add every suitable node from our nodelist to sl, so that we can pick a node for a circuit.

Definition at line 504 of file routerlist.c.

Referenced by pick_restricted_middle_node().

◆ router_add_to_routerlist()

was_router_added_t router_add_to_routerlist ( routerinfo_t router,
const char **  msg,
int  from_cache,
int  from_fetch 

Add router to the routerlist, if we don't already have it. Replace older entries (if any) with the same key. Note: Callers should not hold their pointers to router if this function fails; router will either be inserted into the routerlist or freed. Similarly, even if this call succeeds, they should not hold their pointers to router after subsequent calls with other routerinfo's – they might cause the original routerinfo to get freed.

Returns the status for the operation. Might set *msg if it wants the poster of the router to know something.

If from_cache, this descriptor came from our disk cache. If from_fetch, we received it in response to a request we made. (If both are false, that means it was uploaded to us as an auth dir server or via the controller.)

This function should be called after routers_update_status_from_consensus_networkstatus; subsequently, you should call router_rebuild_store and routerlist_descriptors_added.

Definition at line 1482 of file routerlist.c.

References authdir_mode_handles_descs(), and routerinfo_t::purpose.

◆ router_differences_are_cosmetic()

int router_differences_are_cosmetic ( const routerinfo_t r1,
const routerinfo_t r2 

◆ router_exit_policy_rejects_all()

int router_exit_policy_rejects_all ( const routerinfo_t router)

Return true iff router does not permit exit streams.

Definition at line 2242 of file routerlist.c.

References routerinfo_t::policy_is_reject_star.

◆ router_get_advertised_bandwidth()

uint32_t router_get_advertised_bandwidth ( const routerinfo_t router)

Return the smaller of the router's configured BandwidthRate and its advertised capacity.

Definition at line 557 of file routerlist.c.

References routerinfo_t::bandwidthcapacity, and routerinfo_t::bandwidthrate.

Referenced by dirserv_get_bandwidth_for_router_kb().

◆ router_get_advertised_bandwidth_capped()

uint32_t router_get_advertised_bandwidth_capped ( const routerinfo_t router)

Return the smaller of the router's configured BandwidthRate and its advertised capacity, capped by max-believe-bw.

Definition at line 571 of file routerlist.c.

References routerinfo_t::bandwidthcapacity, routerinfo_t::bandwidthrate, and DEFAULT_MAX_BELIEVABLE_BANDWIDTH.

Referenced by dirserv_get_credible_bandwidth_kb().

◆ router_get_by_descriptor_digest()

signed_descriptor_t* router_get_by_descriptor_digest ( const char *  digest)

Return the router in our routerlist whose 20-byte descriptor is digest. Return NULL if no such router is known.

Definition at line 698 of file routerlist.c.

References routerlist_t::desc_digest_map, routerlist, and tor_assert().

◆ router_get_by_id_digest()

const routerinfo_t* router_get_by_id_digest ( const char *  digest)

Return the router in our routerlist whose 20-byte key digest is digest. Return NULL if no such router is known.

Definition at line 690 of file routerlist.c.

References router_get_mutable_by_digest().

Referenced by connection_or_digest_is_known_relay(), and get_signed_descriptor_by_fp().

◆ router_get_mutable_by_digest()

routerinfo_t* router_get_mutable_by_digest ( const char *  digest)

As router_get_by_id_digest,but return a pointer that you're allowed to modify

Definition at line 676 of file routerlist.c.

References routerlist_t::identity_map, routerlist, and tor_assert().

Referenced by dirserv_add_extrainfo(), and router_get_by_id_digest().

◆ router_get_routerlist()

routerlist_t* router_get_routerlist ( void  )

◆ router_load_extrainfo_from_string()

void router_load_extrainfo_from_string ( const char *  s,
const char *  eos,
saved_location_t  saved_location,
smartlist_t requested_fingerprints,
int  descriptor_digests 

Parse one or more extrainfos from s (ending immediately before eos if eos is present). Other arguments are as for router_load_routers_from_string().

Definition at line 2124 of file routerlist.c.

References router_parse_list_from_string(), and SAVED_NOWHERE.

◆ router_load_routers_from_string()

int router_load_routers_from_string ( const char *  s,
const char *  eos,
saved_location_t  saved_location,
smartlist_t requested_fingerprints,
int  descriptor_digests,
const char *  prepend_annotations 

Given a string s containing some routerdescs, parse it and put the routers into our directory. If saved_location is SAVED_NOWHERE, the routers are in response to a query to the network: cache them by adding them to the journal.

Return the number of routers actually added.

If requested_fingerprints is provided, it must contain a list of uppercased fingerprints. Do not update any router whose fingerprint is not on the list; after updating a router, remove its fingerprint from the list.

If descriptor_digests is non-zero, then the requested_fingerprints are descriptor digests. Otherwise they are identity digests.

Definition at line 2025 of file routerlist.c.

References HEX_DIGEST_LEN, router_parse_list_from_string(), routers_update_status_from_consensus_networkstatus(), and SAVED_NOWHERE.

◆ router_load_single_router()

int router_load_single_router ( const char *  s,
uint8_t  purpose,
int  cache,
const char **  msg 

Code to parse a single router descriptor and insert it into the routerlist. Return -1 if the descriptor was ill-formed; 0 if the descriptor was well-formed but could not be added; and 1 if the descriptor was added.

If we don't add it and msg is not NULL, then assign to *msg a static string describing the reason for refusing the descriptor.

This is used only by the controller.

Definition at line 1958 of file routerlist.c.

References ROUTER_ANNOTATION_BUF_LEN, router_parse_entry_from_string(), router_purpose_to_string(), tor_assert(), and tor_snprintf().

Referenced by handle_control_postdescriptor().

◆ router_reload_router_list()

int router_reload_router_list ( void  )

Load all cached router descriptors and extra-info documents from the store. Return 0 on success and -1 on failure.

Definition at line 457 of file routerlist.c.

References routerlist_t::desc_store, routerlist_t::extrainfo_store, router_get_routerlist(), and router_reload_router_list_impl().

◆ router_reset_descriptor_download_failures()

void router_reset_descriptor_download_failures ( void  )

Reset the consensus and extra-info download failure count on all routers. When we get a new consensus, routers_update_status_from_consensus_networkstatus() will reset the download statuses on the descriptors in that consensus.

Definition at line 2828 of file routerlist.c.

◆ router_reset_status_download_failures()

void router_reset_status_download_failures ( void  )

Reset all internal variables used to count failed downloads of network status objects.

Definition at line 103 of file dirlist.c.

References fallback_dir_servers, and mark_all_dirservers_up().

◆ routerinfo_free_()

void routerinfo_free_ ( routerinfo_t router)

◆ routerinfo_incompatible_with_extrainfo()

int routerinfo_incompatible_with_extrainfo ( const crypto_pk_t identity_pkey,
extrainfo_t ei,
signed_descriptor_t sd,
const char **  msg 

Check whether sd describes a router descriptor compatible with the extrainfo document ei.

identity_pkey (which must also be provided) is RSA1024 identity key for the router. We use it to check the signature of the extrainfo document, if it has not already been checked.

If no router is compatible with ei, ei should be dropped. Return 0 for "compatible", return 1 for "reject, and inform whoever uploaded <b>ei</b>, and return -1 for "reject silently.". If msg is present, set *msg to a description of the incompatibility (if any).

Set the extrainfo_is_bogus field in sd if the digests matched but the extrainfo was nonetheless incompatible.

Definition at line 2954 of file routerlist.c.

References extrainfo_t::bad_sig, extrainfo_t::digest256, DIGEST256_LEN, DIGEST_LEN, signed_descriptor_t::extra_info_digest, signed_descriptor_t::extra_info_digest256, fast_mem_is_zero(), signed_descriptor_t::signed_descriptor_digest, tor_assert(), and tor_memeq().

◆ routerlist_assert_ok()

void routerlist_assert_ok ( const routerlist_t rl)

Assert that the internal representation of rl is self-consistent.

Definition at line 3091 of file routerlist.c.

References routerlist_t::desc_digest_map, routerlist_t::identity_map, routerlist_t::routers, SMARTLIST_FOREACH_BEGIN, and tor_assert().

◆ routerlist_descriptors_added()

void routerlist_descriptors_added ( smartlist_t sl,
int  from_cache 

We just added a new set of descriptors. Take whatever extra steps we need.

Definition at line 1927 of file routerlist.c.

References approx_time(), control_event_descriptors_changed(), dirserv_single_reachability_test(), learned_bridge_descriptor(), SMARTLIST_FOREACH_BEGIN, and tor_assert().

◆ routerlist_find_my_routerinfo()

const routerinfo_t* routerlist_find_my_routerinfo ( void  )

Look through the routerlist until we find a router that has my key. Return it.

Definition at line 541 of file routerlist.c.

References routerlist, routerlist_t::routers, and SMARTLIST_FOREACH.

◆ routerlist_free_()

void routerlist_free_ ( routerlist_t rl)

Free all storage held by a routerlist rl.

Definition at line 942 of file routerlist.c.

◆ routerlist_free_all()

void routerlist_free_all ( void  )

Free all memory held by the routerlist module. Note: Calling routerlist_free_all() should always be paired with a call to nodelist_free_all(). These should only be called during cleanup.

Definition at line 1427 of file routerlist.c.

◆ routerlist_remove()

void routerlist_remove ( routerlist_t rl,
routerinfo_t ri,
int  make_old,
time_t  now 

Remove an item ri from the routerlist rl, updating indices as needed. If idx is nonnegative and smartlist_get(rl->routers, idx) == ri, we don't need to do a linear search over the list to decide which to remove. We fill the gap in rl->routers with a later element in the list, if any exists. ri is freed.

If make_old is true, instead of deleting the router, we try adding it to rl->old_routers.

Definition at line 1187 of file routerlist.c.

References signed_descriptor_t::routerlist_index, and tor_assert().

◆ routerlist_remove_old_routers()

void routerlist_remove_old_routers ( void  )

Deactivate any routers from the routerlist that are more than ROUTER_MAX_AGE seconds old and not recommended by any networkstatuses; remove old routers from the list of cached routers if we have too many.

Definition at line 1801 of file routerlist.c.

References routerlist, and trusted_dirs_remove_old_certs().

◆ routerlist_reset_warnings()

void routerlist_reset_warnings ( void  )

Forget that we have issued any router-related warnings, so that we'll warn again if we see the same errors.

Definition at line 1443 of file routerlist.c.

References networkstatus_reset_warnings(), smartlist_clear(), SMARTLIST_FOREACH, tor_free, and warned_nicknames.

◆ routerlist_retry_directory_downloads()

void routerlist_retry_directory_downloads ( time_t  now)

Clear all our timeouts for fetching v3 directory stuff, and then give it all a try again.

Definition at line 2227 of file routerlist.c.

◆ routers_have_same_or_addrs()

int routers_have_same_or_addrs ( const routerinfo_t r1,
const routerinfo_t r2 

Return true iff r1 and r2 have the same address and OR port.

Definition at line 493 of file routerlist.c.

References routerinfo_t::addr, routerinfo_t::ipv6_addr, routerinfo_t::or_port, and tor_addr_eq.

Referenced by dirserv_should_launch_reachability_test(), and nodelist_set_routerinfo().

◆ routers_sort_by_identity()

void routers_sort_by_identity ( smartlist_t routers)

Sort a list of routerinfo_t in ascending order of identity digest.

Definition at line 3211 of file routerlist.c.

References compare_routerinfo_by_id_digest_(), and smartlist_sort().

◆ signed_descriptor_get_annotations()

const char* signed_descriptor_get_annotations ( const signed_descriptor_t desc)

As signed_descriptor_get_body(), but points to the beginning of the annotations section rather than the beginning of the descriptor.

Definition at line 802 of file routerlist.c.

References signed_descriptor_get_body_impl().

Referenced by routerlist_reparse_old().

◆ signed_descriptor_get_body()

const char* signed_descriptor_get_body ( const signed_descriptor_t desc)

Return a pointer to the signed textual representation of a descriptor. The returned string is not guaranteed to be NUL-terminated: the string's length will be in desc->signed_descriptor_len.

The caller must not free the string returned.

Definition at line 794 of file routerlist.c.

References signed_descriptor_get_body_impl().

Referenced by getinfo_helper_dir(), munge_extrainfo_into_routerinfo(), and router_get_my_descriptor().

◆ update_all_descriptor_downloads()

void update_all_descriptor_downloads ( time_t  now)

Update downloads for router descriptors and/or microdescriptors as appropriate.

Definition at line 2215 of file routerlist.c.

References launch_dummy_descriptor_download_as_needed(), should_delay_dir_fetches(), update_microdesc_downloads(), and update_router_descriptor_downloads().

Referenced by directory_info_has_arrived(), and launch_descriptor_fetches_callback().

◆ update_consensus_router_descriptor_downloads()

void update_consensus_router_descriptor_downloads ( time_t  now,
int  is_vote,
networkstatus_t consensus 

For any descriptor that we want that's currently listed in consensus, download it as appropriate.

Definition at line 2530 of file routerlist.c.

References authdir_mode(), and directory_too_idle_to_fetch_descriptors().

Referenced by update_router_descriptor_downloads().

◆ update_extrainfo_downloads()

void update_extrainfo_downloads ( time_t  now)

◆ update_router_descriptor_downloads()

void update_router_descriptor_downloads ( time_t  now)

Launch downloads for router status as needed.

Definition at line 2703 of file routerlist.c.

References should_delay_dir_fetches(), update_consensus_router_descriptor_downloads(), and we_fetch_router_descriptors().

Referenced by update_all_descriptor_downloads().


static int WRA_NEVER_DOWNLOADABLE ( was_router_added_t  s)

Return true iff the outcome code in s indicates that the descriptor was flat-out rejected.

Definition at line 127 of file routerlist.h.


static int WRA_WAS_ADDED ( was_router_added_t  s)

Return true iff the outcome code in s indicates that the descriptor was added. It might still be necessary to check whether the descriptor generator should be notified.

Definition at line 101 of file routerlist.h.

Referenced by router_add_extrainfo_to_routerlist().


static int WRA_WAS_OUTDATED ( was_router_added_t  s)

Return true iff the outcome code in s indicates that the descriptor was not added because it was either:

  • not in the consensus
  • neither in the consensus nor in any networkstatus document
  • it was outdated.
  • its certificates were expired.

Definition at line 111 of file routerlist.h.


static int WRA_WAS_REJECTED ( was_router_added_t  s)

Return true iff the outcome code in s indicates that the descriptor was flat-out rejected.

Definition at line 121 of file routerlist.h.