tor  0.4.2.1-alpha-dev
Macros | Functions
shared_random_client.c File Reference
#include "feature/hs_common/shared_random_client.h"
#include "app/config/config.h"
#include "feature/dircommon/voting_schedule.h"
#include "feature/nodelist/networkstatus.h"
#include "lib/encoding/binascii.h"
#include "feature/nodelist/networkstatus_st.h"

Go to the source code of this file.

Functions

static char * srv_to_control_string (const sr_srv_t *srv)
 
int get_voting_interval (void)
 
time_t get_start_time_of_current_round (void)
 
void sr_srv_encode (char *dst, size_t dst_len, const sr_srv_t *srv)
 
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)
 

Detailed Description

This file contains functions that are from the shared random subsystem but used by many part of tor. The full feature is built as part of the dirauth module.

Definition in file shared_random_client.c.

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