12 #ifndef TOR_MAINLOOP_H
13 #define TOR_MAINLOOP_H
20 #define connection_add(conn) connection_add_impl((conn), 0)
21 #define connection_add_connecting(conn) connection_add_impl((conn), 1)
35 typedef enum watchable_events {
82 void periodic_events_on_new_options(
const or_options_t *options);
85 time_t get_last_signewnym_time(
void);
92 void tor_mainloop_free_all(
void);
100 #ifdef MAINLOOP_PRIVATE
103 STATIC void teardown_periodic_events(
void);
108 #ifdef TOR_UNIT_TESTS
STATIC int check_network_participation_callback(time_t now, const or_options_t *options)
STATIC void close_closeable_connections(void)
STATIC smartlist_t * connection_array
STATIC int get_my_roles(const or_options_t *options)
STATIC int run_main_loop_until_done(void)
void stats_increment_bytes_read_and_written(uint64_t r, uint64_t w)
void connection_watch_events(connection_t *conn, watchable_events_t events)
void dns_servers_relaunch_checks(void)
int connection_add_impl(connection_t *conn, int is_connecting)
void note_that_we_maybe_cant_complete_circuits(void)
void connection_stop_reading(connection_t *conn)
void connection_stop_reading_from_linked_conn(connection_t *conn)
int connection_in_array(connection_t *conn)
int have_completed_a_circuit(void)
void ip_address_changed(int on_client_conn)
void note_that_we_completed_a_circuit(void)
void connection_unregister_events(connection_t *conn)
void directory_all_unreachable(time_t now)
int connection_remove(connection_t *conn)
void add_connection_to_closeable_list(connection_t *conn)
void reschedule_directory_downloads(void)
uint64_t get_bytes_read(void)
void initialize_periodic_events(void)
void mainloop_schedule_shutdown(int delay_sec)
int connection_is_on_closeable_list(connection_t *conn)
void connection_start_reading(connection_t *conn)
void update_current_time(time_t now)
void initialize_mainloop_events(void)
void do_signewnym(time_t)
int connection_is_writing(connection_t *conn)
void schedule_rescan_periodic_events(void)
void connection_start_writing(connection_t *conn)
uint64_t get_main_loop_error_count(void)
uint64_t get_main_loop_idle_count(void)
int connection_is_reading(connection_t *conn)
void reschedule_or_state_save(void)
void tor_shutdown_event_loop_and_exit(int exitcode)
void tor_init_connection_lists(void)
smartlist_t * get_connection_array(void)
void reset_all_main_loop_timers(void)
int connection_count_moribund(void)
uint64_t get_main_loop_success_count(void)
void directory_info_has_arrived(time_t now, int from_cache, int suppress_logs)
void connection_stop_writing(connection_t *conn)
uint64_t get_bytes_written(void)
void reset_main_loop_counters(void)
int tor_event_loop_shutdown_is_pending(void)
time_t time_of_process_start
void mainloop_schedule_postloop_cleanup(void)
void rescan_periodic_events(const or_options_t *options)
unsigned get_signewnym_epoch(void)
#define MOCK_DECL(rv, funcname, arglist)