10 #define TOR_PERIODIC_H
12 #define PERIODIC_EVENT_NO_UPDATE (-1)
16 #define PERIODIC_EVENT_ROLE_CLIENT (1U << 0)
17 #define PERIODIC_EVENT_ROLE_RELAY (1U << 1)
18 #define PERIODIC_EVENT_ROLE_BRIDGE (1U << 2)
19 #define PERIODIC_EVENT_ROLE_DIRAUTH (1U << 3)
20 #define PERIODIC_EVENT_ROLE_BRIDGEAUTH (1U << 4)
21 #define PERIODIC_EVENT_ROLE_HS_SERVICE (1U << 5)
22 #define PERIODIC_EVENT_ROLE_DIRSERVER (1U << 6)
23 #define PERIODIC_EVENT_ROLE_CONTROLEV (1U << 7)
25 #define PERIODIC_EVENT_ROLE_NET_PARTICIPANT (1U << 8)
26 #define PERIODIC_EVENT_ROLE_ALL (1U << 9)
32 #define PERIODIC_EVENT_ROLE_ROUTER \
33 (PERIODIC_EVENT_ROLE_BRIDGE | PERIODIC_EVENT_ROLE_RELAY)
35 #define PERIODIC_EVENT_ROLE_AUTHORITIES \
36 (PERIODIC_EVENT_ROLE_BRIDGEAUTH | PERIODIC_EVENT_ROLE_DIRAUTH)
45 #define PERIODIC_EVENT_FLAG_NEED_NET (1U << 0)
50 #define PERIODIC_EVENT_FLAG_RUN_ON_DISABLE (1U << 1)
75 unsigned int enabled : 1;
80 #define PERIODIC_EVENT(fn, r, f) { fn##_callback, 0, NULL, #fn, r, f, 0 }
81 #define END_OF_PERIODIC_EVENTS { NULL, 0, NULL, NULL, 0, 0, 0 }
void periodic_event_disable(periodic_event_item_t *event)
void periodic_events_rescan_by_roles(int roles, bool net_disabled)
void periodic_event_schedule_and_disable(periodic_event_item_t *event)
void periodic_event_enable(periodic_event_item_t *event)
void periodic_events_connect_all(void)
void periodic_events_register(periodic_event_item_t *item)
void periodic_event_launch(periodic_event_item_t *event)
int(* periodic_event_helper_t)(time_t now, const or_options_t *options)
void periodic_event_connect(periodic_event_item_t *event)
int safe_timer_diff(time_t now, time_t next)
void periodic_events_disconnect_all(void)
void periodic_event_reschedule(periodic_event_item_t *event)
void periodic_events_reset_all(void)
periodic_event_item_t * periodic_events_find(const char *name)
periodic_event_helper_t fn
struct mainloop_event_t * ev