Tor
0.4.7.0-alpha-dev
|
Header for netstatus.c. More...
Go to the source code of this file.
Functions | |
int | net_is_disabled (void) |
int | net_is_completely_disabled (void) |
void | note_user_activity (time_t now) |
void | reset_user_activity (time_t now) |
time_t | get_last_user_activity_time (void) |
void | set_network_participation (bool participation) |
bool | is_participating_on_network (void) |
void | netstatus_flush_to_state (struct mainloop_state_t *state, time_t now) |
void | netstatus_load_from_state (const struct mainloop_state_t *state, time_t now) |
void | netstatus_note_clock_jumped (time_t seconds_diff) |
Header for netstatus.c.
Definition in file netstatus.h.
time_t get_last_user_activity_time | ( | void | ) |
Return the most recent time at which we recorded "user activity".
Definition at line 91 of file netstatus.c.
Referenced by check_network_participation_callback(), and netstatus_note_clock_jumped().
bool is_participating_on_network | ( | void | ) |
Return true iff we are currently participating on the network.
Definition at line 110 of file netstatus.c.
int net_is_completely_disabled | ( | void | ) |
Return true iff our network is in some sense "completely disabled" either we're fully hibernating or the network is turned off with DisableNetwork.
Definition at line 34 of file netstatus.c.
Referenced by connection_connect_sockaddr().
int net_is_disabled | ( | void | ) |
Return true iff our network is in some sense disabled or shutting down: either we're hibernating, entering hibernation, or the network is turned off with DisableNetwork.
Definition at line 25 of file netstatus.c.
Referenced by check_descriptor_callback(), check_dns_honesty_callback(), check_for_reachability_bw_callback(), decide_to_advertise_dir_impl(), directory_info_has_arrived(), launch_reachability_tests_callback(), launch_resolve(), launch_test_addresses(), prune_old_routers_callback(), reachability_warnings_callback(), rescan_periodic_events(), retry_listeners_callback(), router_reachability_checks_disabled(), and second_elapsed_callback().
void netstatus_flush_to_state | ( | mainloop_state_t * | state, |
time_t | now | ||
) |
Update 'state' with the last time at which we were active on the network.
Definition at line 119 of file netstatus.c.
void netstatus_note_clock_jumped | ( | time_t | seconds_diff | ) |
Adjust the time at which the user was last active by seconds_diff in response to a clock jump.
Definition at line 168 of file netstatus.c.
void note_user_activity | ( | time_t | now | ) |
Record the fact that we have seen "user activity" at the time now. Move "last activity seen" time forwards, but never backwards.
If we were previously not participating on the network, set our participation status to true, and launch periodic events as appropriate.
Definition at line 63 of file netstatus.c.
Referenced by connection_edge_flushed_some(), connection_edge_process_inbuf(), and dnsserv_launch_request().
void reset_user_activity | ( | time_t | now | ) |
Change the time at which "user activity" was last seen to now.
Unlike note_user_actity, this function sets the time without checking whether it is in the past, and without causing any rescan of periodic events or change in participation status.
Definition at line 82 of file netstatus.c.
Referenced by netstatus_load_from_state(), and netstatus_note_clock_jumped().
void set_network_participation | ( | bool | participation | ) |
Set the field that remembers whether we are currently participating on the network. Does not schedule or un-schedule periodic events.
Definition at line 101 of file netstatus.c.