9 #ifndef TOR_SHARED_RANDOM_STATE_H
10 #define TOR_SHARED_RANDOM_STATE_H
16 SR_STATE_ACTION_GET = 1,
17 SR_STATE_ACTION_PUT = 2,
18 SR_STATE_ACTION_DEL = 3,
19 SR_STATE_ACTION_DEL_ALL = 4,
20 SR_STATE_ACTION_SAVE = 5,
130 #ifdef SHARED_RANDOM_STATE_PRIVATE
145 #ifdef TOR_UNIT_TESTS
This file contains ABI/API of the shared random protocol defined in proposal #250....
STATIC sr_phase_t get_sr_protocol_phase(time_t valid_after)
STATIC int disk_state_load_from_disk_impl(const char *fname)
STATIC void reset_state_for_new_protocol_run(time_t valid_after)
STATIC void state_rotate_srv(void)
STATIC int is_phase_transition(sr_phase_t next_phase)
STATIC void state_del_previous_srv(void)
STATIC void new_protocol_run(time_t valid_after)
STATIC void state_del_current_srv(void)
STATIC const char * get_phase_str(sr_phase_t phase)
STATIC time_t get_state_valid_until_time(time_t now)
void sr_state_update(time_t valid_after)
void sr_state_set_fresh_srv(void)
const sr_srv_t * sr_state_get_current_srv(void)
@ SR_STATE_OBJ_VALID_AFTER
void sr_state_free_all(void)
void sr_state_copy_reveal_info(sr_commit_t *saved_commit, const sr_commit_t *commit)
void sr_state_set_previous_srv(const sr_srv_t *srv)
const sr_srv_t * sr_state_get_previous_srv(void)
void sr_state_set_valid_after(time_t valid_after)
sr_commit_t * sr_state_get_commit(const char *rsa_fpr)
void sr_state_clean_srvs(void)
void sr_state_set_current_srv(const sr_srv_t *srv)
digestmap_t * sr_state_get_commits(void)
int sr_state_init(int save_to_disk, int read_from_disk)
void sr_state_unset_fresh_srv(void)
void sr_state_delete_commits(void)
int sr_state_is_initialized(void)
unsigned int sr_state_srv_is_fresh(void)
void sr_state_add_commit(sr_commit_t *commit)
sr_phase_t sr_state_get_phase(void)
struct config_line_t * Commit
struct config_line_t * SharedRandValues
struct config_line_t * ExtraLines
unsigned int n_reveal_rounds
unsigned int is_srv_fresh
unsigned int n_commit_rounds