27#define MIN_VOTE_SECONDS 2
29#define MIN_VOTE_SECONDS_TESTING 2
32#define MIN_DIST_SECONDS 2
34#define MIN_DIST_SECONDS_TESTING 2
37#define MIN_VOTE_INTERVAL 300
46#define MIN_VOTE_INTERVAL_TESTING \
47 (((MIN_VOTE_SECONDS_TESTING)+(MIN_DIST_SECONDS_TESTING)+1)*2)
49#define MIN_VOTE_INTERVAL_TESTING_INITIAL \
50 ((MIN_VOTE_SECONDS_TESTING)+(MIN_DIST_SECONDS_TESTING)+1)
53#define MIN_SUPPORTED_CONSENSUS_METHOD 32
56#define MAX_SUPPORTED_CONSENSUS_METHOD 34
62#define MIN_METHOD_TO_SUPPRESS_MD_PUBLISHED 33
68#define MIN_METHOD_TO_OMIT_PACKAGE_FINGERPRINTS 34
73#define DEFAULT_MAX_UNMEASURED_BW_KB 20
77#define DGV_INCLUDE_PENDING 2
78#define DGV_INCLUDE_PREVIOUS 4
81#define MAX_BW_FILE_HEADERS_LINE_LEN 1024
91#ifdef HAVE_MODULE_DIRAUTH
98void dirvote_dirreq_get_status_vote(
const char *url,
smartlist_t *items,
104 const char *where_from,
105 const char **msg_out,
109 const char **msg_out);
144dirvote_dirreq_get_status_vote(
const char *url,
smartlist_t *items,
155 const char *where_from,
156 const char **msg_out,
168 *msg_out =
"No directory authority support";
175 const char **msg_out)
177 (void) detached_signatures_body;
179 *msg_out =
"No directory authority support";
212#ifdef DIRVOTE_PRIVATE
219 int32_t default_val);
223 int total_authorities);
228 int64_t M, int64_t E, int64_t D,
229 int64_t
T, int64_t weight_scale);
232 int total_authorities,
235 const char *legacy_identity_key_digest,
243 const char **msg_out);
263 int consensus_method);
STATIC microdesc_t * dirvote_create_microdescriptor(const routerinfo_t *ri, int consensus_method)
STATIC int compare_routerinfo_usefulness(const routerinfo_t *first, const routerinfo_t *second)
pending_vote_t * dirvote_add_vote(const char *vote_body, time_t time_posted, const char *where_from, const char **msg_out, int *status_out)
char * format_recommended_version_list(const config_line_t *ln, int warn)
STATIC authority_cert_t * authority_cert_dup(authority_cert_t *cert)
STATIC int compare_routerinfo_by_ipv6(const void **a, const void **b)
STATIC char * make_consensus_method_list(int low, int high, const char *separator)
STATIC digestmap_t * get_all_possible_sybil(const smartlist_t *routers)
time_t dirvote_act(const or_options_t *options, time_t now)
STATIC char * format_networkstatus_vote(crypto_pk_t *private_signing_key, networkstatus_t *v3_ns)
STATIC int32_t dirvote_get_intermediate_param_value(const smartlist_t *param_list, const char *keyword, int32_t default_val)
void dirvote_free_all(void)
STATIC smartlist_t * dirvote_compute_params(smartlist_t *votes, int method, int total_authorities)
int dirvote_add_signatures(const char *detached_signatures_body, const char *source, const char **msg)
STATIC char * networkstatus_get_detached_signatures(smartlist_t *consensuses)
int networkstatus_compute_bw_weights_v10(smartlist_t *chunks, int64_t G, int64_t M, int64_t E, int64_t D, int64_t T, int64_t weight_scale)
STATIC int networkstatus_add_detached_signatures(networkstatus_t *target, ns_detached_signatures_t *sigs, const char *source, int severity, const char **msg_out)
STATIC char * compute_consensus_package_lines(smartlist_t *votes)
STATIC digestmap_t * get_sybil_list_by_ip_version(const smartlist_t *routers, sa_family_t family)
STATIC int compare_routerinfo_by_ipv4(const void **a, const void **b)
STATIC char * networkstatus_compute_consensus(smartlist_t *votes, int total_authorities, crypto_pk_t *identity_key, crypto_pk_t *signing_key, const char *legacy_id_key_digest, crypto_pk_t *legacy_signing_key, consensus_flavor_t flavor)
networkstatus_t * dirserv_generate_networkstatus_vote_obj(crypto_pk_t *private_key, authority_cert_t *cert)
const cached_dir_t * dirvote_get_vote(const char *fp, int flags)
const char * dirvote_get_pending_consensus(consensus_flavor_t flav)
uint32_t dirserv_get_bandwidth_for_router_kb(const routerinfo_t *ri)
const char DIRVOTE_OPTIONAL_FLAGS[]
const char * dirvote_get_pending_detached_signatures(void)
const char DIRVOTE_UNIVERSAL_FLAGS[]
vote_microdesc_hash_t * dirvote_format_all_microdesc_vote_lines(const routerinfo_t *ri, time_t now, smartlist_t *microdescriptors_out)
static crypto_pk_t * legacy_signing_key
#define MOCK_DECL(rv, funcname, arglist)
#define tor_assert_nonfatal_unreached()