tor  0.4.2.1-alpha-dev
voting_schedule.h
Go to the documentation of this file.
1 /* Copyright (c) 2018-2019, The Tor Project, Inc. */
2 /* See LICENSE for licensing information */
3 
9 #ifndef TOR_VOTING_SCHEDULE_H
10 #define TOR_VOTING_SCHEDULE_H
11 
12 #include "core/or/or.h"
13 
15 typedef struct {
17  time_t voting_starts;
22  time_t voting_ends;
28 
29  /* True iff we have generated and distributed our vote. */
30  int have_voted;
31  /* True iff we've requested missing votes. */
32  int have_fetched_missing_votes;
33  /* True iff we have built a consensus and sent the signatures around. */
34  int have_built_consensus;
35  /* True iff we've fetched missing signatures. */
36  int have_fetched_missing_signatures;
37  /* True iff we have published our consensus. */
38  int have_published_consensus;
39 
40  /* True iff this voting schedule was set on demand meaning not through the
41  * normal vote operation of a dirauth or when a consensus is set. This only
42  * applies to a directory authority that needs to recalculate the voting
43  * timings only for the first vote even though this object was initilized
44  * prior to voting. */
45  int created_on_demand;
46 
51 
52 /* Public API. */
53 
54 extern voting_schedule_t voting_schedule;
55 
57  time_t now);
58 
60  int interval,
61  int offset);
62 time_t voting_schedule_get_next_valid_after_time(void);
63 
64 #endif /* !defined(TOR_VOTING_SCHEDULE_H) */
65 
void voting_schedule_recalculate_timing(const or_options_t *options, time_t now)
time_t voting_schedule_get_start_of_next_interval(time_t now, int interval, int offset)
time_t fetch_missing_signatures
time_t live_consensus_valid_after
Master header file for Tor-specific functionality.