Tor 0.4.9.0-alpha-dev
Macros | Functions | Variables
voting_schedule.c File Reference

Compute information about our voting schedule as a directory authority. More...

#include "feature/dirauth/voting_schedule.h"
#include "core/or/or.h"
#include "app/config/config.h"
#include "feature/nodelist/networkstatus.h"
#include "feature/nodelist/networkstatus_st.h"

Go to the source code of this file.

Macros

#define voting_schedule_free(s)    FREE_AND_NULL(voting_schedule_t, voting_schedule_free_, (s))
 

Functions

static voting_schedule_t * create_voting_schedule (const or_options_t *options, time_t now, int severity)
 
static void voting_schedule_free_ (voting_schedule_t *voting_schedule_to_free)
 
static const voting_schedule_t * dirauth_get_voting_schedule (void)
 
time_t dirauth_sched_get_next_valid_after_time (void)
 
time_t dirauth_sched_get_cur_valid_after_time (void)
 
int dirauth_sched_get_configured_interval (void)
 
void dirauth_sched_recalculate_timing (const or_options_t *options, time_t now)
 

Variables

voting_schedule_t voting_schedule
 

Detailed Description

Compute information about our voting schedule as a directory authority.

Definition in file voting_schedule.c.

Macro Definition Documentation

◆ voting_schedule_free

#define voting_schedule_free (   s)     FREE_AND_NULL(voting_schedule_t, voting_schedule_free_, (s))

Definition at line 83 of file voting_schedule.c.

Function Documentation

◆ create_voting_schedule()

static voting_schedule_t * create_voting_schedule ( const or_options_t options,
time_t  now,
int  severity 
)
static

Definition at line 26 of file voting_schedule.c.

◆ dirauth_get_voting_schedule()

static const voting_schedule_t * dirauth_get_voting_schedule ( void  )
static

Return the current voting schedule, recreating it if necessary.

Dirauth only.

Definition at line 104 of file voting_schedule.c.

Referenced by dirauth_sched_get_cur_valid_after_time(), and dirauth_sched_get_next_valid_after_time().

◆ dirauth_sched_get_configured_interval()

int dirauth_sched_get_configured_interval ( void  )

Return the voting interval that we are configured to use.

Dirauth only.

Definition at line 168 of file voting_schedule.c.

◆ dirauth_sched_get_cur_valid_after_time()

time_t dirauth_sched_get_cur_valid_after_time ( void  )

Return our best idea of what the valid-after time for the current consensus, whether we have one or not.

Dirauth only.

Definition at line 153 of file voting_schedule.c.

◆ dirauth_sched_get_next_valid_after_time()

time_t dirauth_sched_get_next_valid_after_time ( void  )

Return the next voting valid-after time.

Dirauth only.

Definition at line 141 of file voting_schedule.c.

Referenced by sr_state_init().

◆ dirauth_sched_recalculate_timing()

void dirauth_sched_recalculate_timing ( const or_options_t options,
time_t  now 
)

Set voting_schedule to hold the timing for the next vote we should be doing. All type of tor do that because HS subsystem needs the timing as well to function properly.

Definition at line 177 of file voting_schedule.c.

Referenced by options_act_dirauth().

◆ voting_schedule_free_()

static void voting_schedule_free_ ( voting_schedule_t *  voting_schedule_to_free)
static

Frees a voting_schedule_t. This should be used instead of the generic tor_free.

Definition at line 89 of file voting_schedule.c.

Variable Documentation

◆ voting_schedule

voting_schedule_t voting_schedule

Definition at line 96 of file voting_schedule.c.