tor  0.4.2.0-alpha-dev
Macros | Functions
shared_random_client.h File Reference
#include "feature/dirauth/shared_random.h"

Go to the source code of this file.

Macros

#define SHARED_RANDOM_N_ROUNDS   12
 
#define SHARED_RANDOM_N_PHASES   2
 

Functions

void sr_srv_encode (char *dst, size_t dst_len, const sr_srv_t *srv)
 
int get_voting_interval (void)
 
char * sr_get_current_for_control (void)
 
char * sr_get_previous_for_control (void)
 
const sr_srv_tsr_get_current (const networkstatus_t *ns)
 
const sr_srv_tsr_get_previous (const networkstatus_t *ns)
 
sr_srv_tsr_parse_srv (const smartlist_t *args)
 
time_t sr_state_get_start_time_of_current_protocol_run (void)
 
time_t sr_state_get_start_time_of_previous_protocol_run (void)
 
unsigned int sr_state_get_phase_duration (void)
 
unsigned int sr_state_get_protocol_run_duration (void)
 
time_t get_start_time_of_current_round (void)
 

Detailed Description

Header file for shared_random_client.c.

Definition in file shared_random_client.h.

Function Documentation

◆ sr_state_get_phase_duration()

unsigned int sr_state_get_phase_duration ( void  )

Return the time (in seconds) it takes to complete a full SR protocol phase (e.g. the commit phase).

Definition at line 281 of file shared_random_client.c.

Referenced by hs_get_time_period_num().

◆ sr_state_get_protocol_run_duration()

unsigned int sr_state_get_protocol_run_duration ( void  )

Return the time (in seconds) it takes to complete a full SR protocol run

Definition at line 288 of file shared_random_client.c.

Referenced by get_time_period_length(), and sr_state_get_start_time_of_previous_protocol_run().

◆ sr_state_get_start_time_of_current_protocol_run()

time_t sr_state_get_start_time_of_current_protocol_run ( void  )

Return the start time of the current SR protocol run using the times from the current consensus. For example, if the latest consensus valid-after is 23/06/2017 23:00:00 and a full SR protocol run is 24 hours, this function returns 23/06/2017 00:00:00.

Definition at line 234 of file shared_random_client.c.

Referenced by set_descriptor_revision_counter(), and sr_state_get_start_time_of_previous_protocol_run().

◆ sr_state_get_start_time_of_previous_protocol_run()

time_t sr_state_get_start_time_of_previous_protocol_run ( void  )

Return the start time of the previous SR protocol run. See sr_state_get_start_time_of_current_protocol_run() for more details.

Definition at line 268 of file shared_random_client.c.

References sr_state_get_protocol_run_duration(), and sr_state_get_start_time_of_current_protocol_run().

Referenced by set_descriptor_revision_counter().