tor  master
Macros | Functions
dirvote.h File Reference

Header file for dirvote.c. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MIN_VOTE_SECONDS   2
 
#define MIN_VOTE_SECONDS_TESTING   2
 
#define MIN_DIST_SECONDS   2
 
#define MIN_DIST_SECONDS_TESTING   2
 
#define MIN_VOTE_INTERVAL   300
 
#define MIN_VOTE_INTERVAL_TESTING   (((MIN_VOTE_SECONDS_TESTING)+(MIN_DIST_SECONDS_TESTING)+1)*2)
 
#define MIN_VOTE_INTERVAL_TESTING_INITIAL   ((MIN_VOTE_SECONDS_TESTING)+(MIN_DIST_SECONDS_TESTING)+1)
 
#define ROUTERSTATUS_FORMAT_NO_CONSENSUS_METHOD   0
 
#define MIN_SUPPORTED_CONSENSUS_METHOD   25
 
#define MAX_SUPPORTED_CONSENSUS_METHOD   28
 
#define MIN_METHOD_FOR_RECOMMENDED_PROTOCOLS   25
 
#define MIN_METHOD_FOR_RS_PROTOCOLS   25
 
#define MIN_METHOD_FOR_INIT_BW_WEIGHTS_ONE   26
 
#define MIN_METHOD_FOR_A_LINES_IN_MICRODESC_CONSENSUS   27
 
#define MIN_METHOD_FOR_NO_A_LINES_IN_MICRODESC   28
 
#define DEFAULT_MAX_UNMEASURED_BW_KB   20
 
#define DGV_BY_ID   1
 
#define DGV_INCLUDE_PENDING   2
 
#define DGV_INCLUDE_PREVIOUS   4
 

Functions

 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)
 
void set_routerstatus_from_routerinfo (routerstatus_t *rs, node_t *node, routerinfo_t *ri, time_t now, int listbadexits)
 
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.

Macro Definition Documentation

◆ DEFAULT_MAX_UNMEASURED_BW_KB

#define DEFAULT_MAX_UNMEASURED_BW_KB   20

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.)

◆ MAX_SUPPORTED_CONSENSUS_METHOD

#define MAX_SUPPORTED_CONSENSUS_METHOD   28

The highest consensus method that we currently support.

◆ MIN_DIST_SECONDS

#define MIN_DIST_SECONDS   2

Lowest allowable value for DistSeconds.

◆ MIN_DIST_SECONDS_TESTING

#define MIN_DIST_SECONDS_TESTING   2

Lowest allowable value for DistSeconds when TestingTorNetwork is 1

◆ MIN_METHOD_FOR_A_LINES_IN_MICRODESC_CONSENSUS

#define MIN_METHOD_FOR_A_LINES_IN_MICRODESC_CONSENSUS   27

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

◆ MIN_METHOD_FOR_INIT_BW_WEIGHTS_ONE

#define MIN_METHOD_FOR_INIT_BW_WEIGHTS_ONE   26

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

◆ MIN_METHOD_FOR_NO_A_LINES_IN_MICRODESC

#define MIN_METHOD_FOR_NO_A_LINES_IN_MICRODESC   28

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

◆ MIN_METHOD_FOR_RECOMMENDED_PROTOCOLS

#define MIN_METHOD_FOR_RECOMMENDED_PROTOCOLS   25

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

◆ MIN_METHOD_FOR_RS_PROTOCOLS

#define MIN_METHOD_FOR_RS_PROTOCOLS   25

Lowest consensus method where authorities add protocols to routerstatus entries.

◆ MIN_SUPPORTED_CONSENSUS_METHOD

#define MIN_SUPPORTED_CONSENSUS_METHOD   25

The lowest consensus method that we currently support.

◆ MIN_VOTE_INTERVAL

#define MIN_VOTE_INTERVAL   300

Lowest allowable voting interval.

◆ MIN_VOTE_INTERVAL_TESTING

#define MIN_VOTE_INTERVAL_TESTING   (((MIN_VOTE_SECONDS_TESTING)+(MIN_DIST_SECONDS_TESTING)+1)*2)

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

◆ MIN_VOTE_SECONDS

#define MIN_VOTE_SECONDS   2

Lowest allowable value for VoteSeconds.

◆ MIN_VOTE_SECONDS_TESTING

#define MIN_VOTE_SECONDS_TESTING   2

Lowest allowable value for VoteSeconds when TestingTorNetwork is 1

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)

Here is the call graph for this function:

◆ 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.

◆ 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.

◆ set_routerstatus_from_routerinfo()

void set_routerstatus_from_routerinfo ( routerstatus_t rs,
node_t node,
routerinfo_t ri,
time_t  now,
int  listbadexits 
)

Extract status information from ri and from other authority functions and store it in rs. rs is zeroed out before it is set.

We assume that ri->is_running has already been set, e.g. by dirserv_set_router_is_running(ri, now);