Tor
0.4.7.0-alpha-dev
|
Header for statefile.c. More...
Go to the source code of this file.
Functions | |
or_state_t * | get_or_state (void) |
int | did_last_state_file_write_fail (void) |
int | or_state_save (time_t now) |
void | save_transport_to_state (const char *transport_name, const tor_addr_t *addr, uint16_t port) |
char * | get_stored_bindaddr_for_server_transport (const char *transport) |
int | or_state_load (void) |
int | or_state_loaded (void) |
void | or_state_free_all (void) |
void | or_state_mark_dirty (or_state_t *state, time_t when) |
Header for statefile.c.
Definition in file statefile.h.
int did_last_state_file_write_fail | ( | void | ) |
Return whether the state file failed to write last time we tried.
Definition at line 547 of file statefile.c.
or_state_t* get_or_state | ( | void | ) |
Return the persistent state struct for this Tor.
Definition at line 220 of file statefile.c.
Referenced by accounting_run_housekeeping(), entry_guards_changed_for_guard_selection(), entry_guards_update_state(), get_transport_in_state_by_name(), read_bandwidth_usage(), rotate_onion_key(), save_state_callback(), save_transport_to_state(), and tor_cleanup().
char* get_stored_bindaddr_for_server_transport | ( | const char * | transport | ) |
Return a string containing the address:port that a proxy transport should bind on. The string is stored on the heap and must be freed by the caller of this function.
If we didn't find references for this pluggable transport in the state file, we should instruct the pluggable transport proxy to listen on INADDR_ANY on a random ephemeral port.
Definition at line 689 of file statefile.c.
Referenced by get_bindaddr_for_server_proxy().
int or_state_load | ( | void | ) |
Reload the persistent state from disk, generating a new state as needed. Return 0 on success, less than 0 on failure.
Definition at line 412 of file statefile.c.
int or_state_loaded | ( | void | ) |
Return true iff we have loaded the global state for this Tor
Definition at line 228 of file statefile.c.
void or_state_mark_dirty | ( | or_state_t * | state, |
time_t | when | ||
) |
Change the next_write time of state to when, unless the state is already scheduled to be written to disk earlier than when.
Definition at line 784 of file statefile.c.
Referenced by entry_guards_changed_for_guard_selection(), entry_guards_update_state(), and tor_cleanup().
int or_state_save | ( | time_t | now | ) |
Write the persistent state to disk. Return 0 for success, <0 on failure.
Definition at line 562 of file statefile.c.
Referenced by save_state_callback(), and tor_cleanup().
void save_transport_to_state | ( | const char * | transport, |
const tor_addr_t * | addr, | ||
uint16_t | port | ||
) |
Save transport listening on addr:port to state
find where to write on the state
Definition at line 722 of file statefile.c.
Referenced by register_server_proxy().