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 28
56 #define MAX_SUPPORTED_CONSENSUS_METHOD 31
62 #define MIN_METHOD_FOR_CANONICAL_FAMILIES_IN_MICRODESCS 29
66 #define MIN_METHOD_FOR_UNPADDED_NTOR_KEY 30
71 #define MIN_METHOD_FOR_CORRECT_BWWEIGHTSCALE 31
76 #define DEFAULT_MAX_UNMEASURED_BW_KB 20
80 #define DGV_INCLUDE_PENDING 2
81 #define DGV_INCLUDE_PREVIOUS 4
84 #define MAX_BW_FILE_HEADERS_LINE_LEN 1024
94 #ifdef HAVE_MODULE_DIRAUTH
101 void dirvote_dirreq_get_status_vote(
const char *url,
smartlist_t *items,
107 const char *where_from,
108 const char **msg_out,
112 const char **msg_out);
147 dirvote_dirreq_get_status_vote(
const char *url,
smartlist_t *items,
158 const char *where_from,
159 const char **msg_out,
171 *msg_out =
"No directory authority support";
178 const char **msg_out)
180 (void) detached_signatures_body;
182 *msg_out =
"No directory authority support";
215 #ifdef DIRVOTE_PRIVATE
222 int32_t default_val);
226 int total_authorities);
231 int64_t M, int64_t E, int64_t D,
232 int64_t
T, int64_t weight_scale);
235 int total_authorities,
238 const char *legacy_identity_key_digest,
246 const char **msg_out);
266 int consensus_method);
268 const char *param_name,
269 int64_t default_value);
274 #define DIRVOTE_RECOMMEND_RELAY_PROTO \
289 #define DIRVOTE_RECOMMEND_CLIENT_PROTO \
305 #define DIRVOTE_REQUIRE_RELAY_PROTO \
322 #define DIRVOTE_REQUIRE_CLIENT_PROTO \
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)
STATIC char * make_consensus_method_list(int low, int high, const char *separator)
STATIC int compare_routerinfo_by_ipv6(const void **a, const void **b)
time_t dirvote_act(const or_options_t *options, time_t now)
STATIC authority_cert_t * authority_cert_dup(authority_cert_t *cert)
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 char * networkstatus_get_detached_signatures(smartlist_t *consensuses)
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)
int dirvote_add_signatures(const char *detached_signatures_body, const char *source, const char **msg)
STATIC char * format_networkstatus_vote(crypto_pk_t *private_signing_key, networkstatus_t *v3_ns)
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)
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)
STATIC digestmap_t * get_all_possible_sybil(const smartlist_t *routers)
STATIC int64_t extract_param_buggy(const char *params, const char *param_name, int64_t default_value)
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 smartlist_t * dirvote_compute_params(smartlist_t *votes, int method, int total_authorities)
char * format_recommended_version_list(const config_line_t *ln, int warn)
const char * dirvote_get_pending_detached_signatures(void)
const cached_dir_t * dirvote_get_vote(const char *fp, int flags)
const char * dirvote_get_pending_consensus(consensus_flavor_t flav)
vote_microdesc_hash_t * dirvote_format_all_microdesc_vote_lines(const routerinfo_t *ri, time_t now, smartlist_t *microdescriptors_out)
uint32_t dirserv_get_bandwidth_for_router_kb(const routerinfo_t *ri)
const char DIRVOTE_OPTIONAL_FLAGS[]
networkstatus_t * dirserv_generate_networkstatus_vote_obj(crypto_pk_t *private_key, authority_cert_t *cert)
const char DIRVOTE_UNIVERSAL_FLAGS[]
static crypto_pk_t * legacy_signing_key
#define MOCK_DECL(rv, funcname, arglist)
#define tor_assert_nonfatal_unreached()