Macros | Functions | Variables
dirvote.h File Reference

Go to the source code of this file.


#define MIN_VOTE_SECONDS   2
#define MIN_DIST_SECONDS   2
#define MIN_VOTE_INTERVAL   300
#define DGV_BY_ID   1


static time_t dirvote_act (const or_options_t *options, time_t now)
static void dirvote_free_all (void)
static void dirvote_parse_sr_commits (networkstatus_t *ns, const smartlist_t *tokens)
static void dirvote_clear_commits (networkstatus_t *ns)
static void dirvote_dirreq_get_status_vote (const char *url, smartlist_t *items, smartlist_t *dir_items)
static struct pending_vote_tdirvote_add_vote (const char *vote_body, const char **msg_out, int *status_out)
static int dirvote_add_signatures (const char *detached_signatures_body, const char *source, const char **msg_out)
 MOCK_DECL (const char *, dirvote_get_pending_consensus,(consensus_flavor_t flav))
 MOCK_DECL (const char *, dirvote_get_pending_detached_signatures,(void))
const cached_dir_tdirvote_get_vote (const char *fp, int flags)
networkstatus_tdirserv_generate_networkstatus_vote_obj (crypto_pk_t *private_key, authority_cert_t *cert)
vote_microdesc_hash_tdirvote_format_all_microdesc_vote_lines (const routerinfo_t *ri, time_t now, smartlist_t *microdescriptors_out)



Detailed Description

Header file for dirvote.c.

Definition in file dirvote.h.

Macro Definition Documentation



Default bandwidth to clip unmeasured bandwidths to using method >= MIN_METHOD_TO_CLIP_UNMEASURED_BW. (This is not a consensus method; do not get confused with the above macros.)

Definition at line 91 of file dirvote.h.

Referenced by networkstatus_compute_consensus().



Maximum size of a line in a vote.

Definition at line 99 of file dirvote.h.



The highest consensus method that we currently support.

Definition at line 60 of file dirvote.h.


#define MIN_DIST_SECONDS   2

Lowest allowable value for DistSeconds.

Definition at line 32 of file dirvote.h.



Lowest allowable value for DistSeconds when TestingTorNetwork is 1

Definition at line 34 of file dirvote.h.



Lowest consensus method where the microdesc consensus contains relay IPv6 addresses. See #23826 and #20916.

Definition at line 76 of file dirvote.h.



Lowest consensus method where microdescriptor lines are put in canonical form for improved compressibility and ease of storage. See proposal 298.

Definition at line 86 of file dirvote.h.



Lowest consensus method where authorities initialize bandwidth weights to 1 instead of 0. See #14881

Definition at line 72 of file dirvote.h.



Lowest consensus method where microdescriptors do not contain relay IPv6 addresses. See #23828 and #20916.

Definition at line 80 of file dirvote.h.



Lowest consensus method where authorities vote on required/recommended protocols.

Definition at line 64 of file dirvote.h.



Lowest consensus method where authorities add protocols to routerstatus entries.

Definition at line 68 of file dirvote.h.



The lowest consensus method that we currently support.

Definition at line 57 of file dirvote.h.


#define MIN_VOTE_INTERVAL   300

Lowest allowable voting interval.

Definition at line 37 of file dirvote.h.



Lowest allowable voting interval when TestingTorNetwork is 1: Voting Interval can be: 10, 12, 15, 18, 20, 24, 25, 30, 36, 40, 45, 50, 60, ... Testing Initial Voting Interval can be: 5, 6, 8, 9, or any of the possible values for Voting Interval, as they both need to evenly divide 30 minutes. If clock desynchronisation is an issue, use an interval of at least: 18 * drift in seconds, to allow for a clock slop factor

Definition at line 46 of file dirvote.h.


#define MIN_VOTE_SECONDS   2

Lowest allowable value for VoteSeconds.

Definition at line 27 of file dirvote.h.



Lowest allowable value for VoteSeconds when TestingTorNetwork is 1

Definition at line 29 of file dirvote.h.

Function Documentation

◆ dirserv_generate_networkstatus_vote_obj()

networkstatus_t* dirserv_generate_networkstatus_vote_obj ( crypto_pk_t private_key,
authority_cert_t cert 

Return a new networkstatus_t* containing our current opinion. (For v3 authorities)

Definition at line 4436 of file dirvote.c.

References or_options_t::AuthDirListBadExits, DIGEST_LEN, router_get_routerlist(), and ROUTER_MAX_AGE_TO_PUBLISH.

◆ dirvote_format_all_microdesc_vote_lines()

vote_microdesc_hash_t* dirvote_format_all_microdesc_vote_lines ( const routerinfo_t ri,
time_t  now,
smartlist_t microdescriptors_out 

Generate and return a linked list of all the lines that should appear to describe a router's microdescriptor versions in a directory vote. Add the generated microdescriptors to microdescriptors_out.

Definition at line 3959 of file dirvote.c.

◆ dirvote_get_vote()

const cached_dir_t* dirvote_get_vote ( const char *  fp,
int  flags 

Return a given vote specified by fp. If by_id, return the vote for the authority with the v3 authority identity key digest fp; if by_id is false, return the vote whose digest is fp. If fp is NULL, return our own vote. If include_previous is false, do not consider any votes for a consensus that's already been built. If include_pending is false, do not consider any votes for the consensus that's in progress. May return NULL if we have no vote for the authority in question.

Definition at line 3753 of file dirvote.c.

Variable Documentation



Space-separated list of all flags that we may or may not vote on, depending on our configuration.

Definition at line 4429 of file dirvote.c.



Space-separated list of all the flags that we will always vote on.

Definition at line 4417 of file dirvote.c.