Tor  0.4.5.0-alpha-dev
Functions
dirclient_modes.c File Reference

Functions to answer questions about how we'd like to behave as a directory client. More...

#include "orconfig.h"
#include "core/or/or.h"
#include "feature/dirclient/dirclient_modes.h"
#include "feature/dircache/dirserv.h"
#include "feature/relay/relay_find_addr.h"
#include "feature/relay/router.h"
#include "feature/relay/routermode.h"
#include "feature/stats/predict_ports.h"
#include "app/config/or_options_st.h"
#include "feature/nodelist/routerinfo_st.h"

Go to the source code of this file.

Functions

int dirclient_must_use_begindir (const or_options_t *options)
 
int dirclient_fetches_from_authorities (const or_options_t *options)
 
int dirclient_fetches_dir_info_early (const or_options_t *options)
 
int dirclient_fetches_dir_info_later (const or_options_t *options)
 
int dirclient_too_idle_to_fetch_descriptors (const or_options_t *options, time_t now)
 

Detailed Description

Functions to answer questions about how we'd like to behave as a directory client.

Definition in file dirclient_modes.c.

Function Documentation

◆ dirclient_fetches_dir_info_early()

int dirclient_fetches_dir_info_early ( const or_options_t options)

Return 1 if we should fetch new networkstatuses, descriptors, etc on the "mirror" schedule rather than the "client" schedule.

Definition at line 72 of file dirclient_modes.c.

Referenced by update_consensus_networkstatus_fetch_time_impl().

◆ dirclient_fetches_dir_info_later()

int dirclient_fetches_dir_info_later ( const or_options_t options)

Return 1 if we should fetch new networkstatuses, descriptors, etc on a very passive schedule – waiting long enough for ordinary clients to probably have the info we want. These would include bridge users, and maybe others in the future e.g. if a Tor client uses another Tor client as a directory guard.

Definition at line 84 of file dirclient_modes.c.

◆ dirclient_fetches_from_authorities()

int dirclient_fetches_from_authorities ( const or_options_t options)

Return 1 if we fetch our directory material directly from the authorities, rather than from a mirror.

Definition at line 40 of file dirclient_modes.c.

Referenced by dir_routerdesc_download_failed(), dirclient_fetches_dir_info_early(), directory_get_from_dirserver(), directory_info_has_arrived(), and fetch_networkstatus_callback().

◆ dirclient_too_idle_to_fetch_descriptors()

int dirclient_too_idle_to_fetch_descriptors ( const or_options_t options,
time_t  now 
)

Return 1 if we have no need to fetch new descriptors. This generally happens when we're not a dir cache and we haven't built any circuits lately.

Definition at line 94 of file dirclient_modes.c.

Referenced by directory_info_has_arrived(), update_consensus_router_descriptor_downloads(), and update_microdesc_downloads().