12 #ifndef TOR_HIBERNATE_H
13 #define TOR_HIBERNATE_H
31 const char *question,
char **answer,
33 uint64_t get_accounting_max_total(
void);
35 bool accounting_tor_is_dormant(
void);
37 #ifdef HIBERNATE_PRIVATE
41 HIBERNATE_STATE_LIVE=1,
44 HIBERNATE_STATE_EXITING=2,
47 HIBERNATE_STATE_LOWBANDWIDTH=3,
50 HIBERNATE_STATE_DORMANT=4,
53 HIBERNATE_STATE_INITIAL=5
57 void hibernate_set_state_for_testing_(hibernate_state_t newstate);
time_t accounting_get_end_time(void)
int accounting_parse_options(const or_options_t *options, int validate_only)
int getinfo_helper_accounting(control_connection_t *conn, const char *question, char **answer, const char **errmsg)
int accounting_record_bandwidth_usage(time_t now, or_state_t *state)
void accounting_add_bytes(size_t n_read, size_t n_written, int seconds)
void consider_hibernation(time_t now)
int we_are_fully_hibernating(void)
void configure_accounting(time_t now)
int accounting_is_enabled(const or_options_t *options)
void accounting_free_all(void)
void accounting_run_housekeeping(time_t now)
int we_are_hibernating(void)
void hibernate_begin_shutdown(void)
uint64_t get_accounting_bytes(void)
int accounting_get_interval_length(void)
Macros to implement mocking and selective exposure for the test code.
#define MOCK_DECL(rv, funcname, arglist)