tor  master
voting_schedule.h
Go to the documentation of this file.
1 /* Copyright (c) 2018, 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 "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;
47 
48 /* Public API. */
49 
50 extern voting_schedule_t voting_schedule;
51 
53  time_t now);
54 
56  int interval,
57  int offset);
58 time_t voting_schedule_get_next_valid_after_time(void);
59 
60 #endif /* TOR_VOTING_SCHEDULE_H */
61 
void voting_schedule_recalculate_timing(const or_options_t *options, time_t now)
Definition: voting_schedule.c:156
Definition: or.h:3657
time_t voting_starts
Definition: voting_schedule.h:17
time_t voting_schedule_get_start_of_next_interval(time_t now, int interval, int offset)
Definition: voting_schedule.c:28
time_t fetch_missing_signatures
Definition: voting_schedule.h:25
time_t voting_ends
Definition: voting_schedule.h:22
time_t interval_starts
Definition: voting_schedule.h:27
Definition: voting_schedule.h:15
Master header file for Tor-specific functionality.
time_t fetch_missing_votes
Definition: voting_schedule.h:20