|
OpenVPN
|


Go to the source code of this file.
Data Structures | |
| struct | schedule_entry |
| struct | schedule |
Macros | |
| #define | IN_TREE(e) ((e)->pri) |
Functions | |
| struct schedule * | schedule_init (void) |
| void | schedule_free (struct schedule *s) |
| void | schedule_remove_entry (struct schedule *s, struct schedule_entry *e) |
| struct schedule_entry * | schedule_find_least (struct schedule_entry *e) |
| void | schedule_add_modify (struct schedule *s, struct schedule_entry *e) |
| void | schedule_remove_node (struct schedule *s, struct schedule_entry *e) |
| static void | schedule_add_entry (struct schedule *s, struct schedule_entry *e, const struct timeval *tv, unsigned int sigma) |
| Add a struct schedule_entry to the scheduler btree or update an existing entry with a new wakeup time. | |
| static struct schedule_entry * | schedule_get_earliest_wakeup (struct schedule *s, struct timeval *wakeup) |
| int | schedule_entry_compare (const struct schedule_entry *e1, const struct schedule_entry *e2) |
| This method compares two schedule entries and return which one is earlier,later or equal. | |
| #define IN_TREE | ( | e | ) | ((e)->pri) |
Definition at line 66 of file schedule.h.
|
inlinestatic |
Add a struct schedule_entry to the scheduler btree or update an existing entry with a new wakeup time.
sigma is only used when the entry is already present in the schedule. If the originally scheduled time and the new time are within sigma microseconds of each other then the entry is not rescheduled and will occur at the original time. When adding a new entry sigma will be ignored.
| s | scheduler tree |
| e | entry to add to the schedule |
| tv | wakeup time for the entry |
| sigma | window size for the event in microseconds |
e as opaque data. Only the scheduler functions should change the object. The caller is expected to manage the memory for the object and must only free it once it has been removed from the schedule. Definition at line 98 of file schedule.h.
References schedule::earliest_wakeup, IN_TREE, schedule_add_modify(), schedule_entry::tv, and tv_within_sigma().
Referenced by multi_push_restart_schedule_exit(), and multi_schedule_context_wakeup().
| void schedule_add_modify | ( | struct schedule * | s, |
| struct schedule_entry * | e | ||
| ) |
Definition at line 309 of file schedule.c.
References check_debug_level(), D_SCHEDULER, IN_TREE, schedule_entry::parent, schedule_entry::pri, schedule::root, schedule_insert(), schedule_remove_node(), schedule_rotate_up(), and schedule_set_pri().
Referenced by schedule_add_entry(), and schedule_test().
| int schedule_entry_compare | ( | const struct schedule_entry * | e1, |
| const struct schedule_entry * | e2 | ||
| ) |
This method compares two schedule entries and return which one is earlier,later or equal.
A key is simply a struct timeval containing the absolute time for an event. The unique treap priority (pri) is used to ensure that keys do not collide.
Definition at line 65 of file schedule.c.
References schedule_entry::pri, and schedule_entry::tv.
Referenced by schedule_debug_entry(), and schedule_insert().
| struct schedule_entry * schedule_find_least | ( | struct schedule_entry * | e | ) |
Definition at line 348 of file schedule.c.
References check_debug_level(), D_SCHEDULER, and schedule_entry::lt.
Referenced by schedule_find_earliest_wakeup(), and schedule_get_earliest_wakeup().
| void schedule_free | ( | struct schedule * | s | ) |
Definition at line 382 of file schedule.c.
Referenced by multi_uninit(), and schedule_test().
|
inlinestatic |
Definition at line 116 of file schedule.h.
References schedule::earliest_wakeup, schedule::root, schedule_find_least(), and schedule_entry::tv.
Referenced by multi_get_timeout_instance().
| struct schedule * schedule_init | ( | void | ) |
Definition at line 373 of file schedule.c.
References ALLOC_OBJ_CLEAR.
Referenced by multi_init(), and schedule_test().
| void schedule_remove_entry | ( | struct schedule * | s, |
| struct schedule_entry * | e | ||
| ) |
Definition at line 388 of file schedule.c.
References schedule::earliest_wakeup, and schedule_remove_node().
Referenced by multi_close_instance(), and multi_process_timeout().
| void schedule_remove_node | ( | struct schedule * | s, |
| struct schedule_entry * | e | ||
| ) |
Definition at line 220 of file schedule.c.
References schedule_entry::gt, schedule_entry::lt, schedule_entry::pri, schedule_detach_parent(), and schedule_rotate_up().
Referenced by schedule_add_modify(), schedule_remove_entry(), and schedule_test().