netstatus.h File Reference

Header for netstatus.c. More...

Go to the source code of this file.


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)

Detailed Description

Header for netstatus.c.

Definition in file netstatus.h.

Function Documentation

◆ get_last_user_activity_time()

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().

◆ is_participating_on_network()

bool is_participating_on_network ( void  )

Return true iff we are currently participating on the network.

Definition at line 110 of file netstatus.c.

◆ net_is_completely_disabled()

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().

◆ net_is_disabled()

int net_is_disabled ( void  )

◆ netstatus_flush_to_state()

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.

◆ netstatus_note_clock_jumped()

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.

◆ note_user_activity()

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().

◆ reset_user_activity()

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().

◆ set_network_participation()

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.