OpenVPN
Data Structures | Macros | Functions
schedule.h File Reference
#include "otime.h"
#include "error.h"
Include dependency graph for schedule.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  schedule_entry
 
struct  schedule
 

Macros

#define IN_TREE(e)   ((e)->pri)
 

Functions

struct scheduleschedule_init (void)
 
void schedule_free (struct schedule *s)
 
void schedule_remove_entry (struct schedule *s, struct schedule_entry *e)
 
struct schedule_entryschedule_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_entryschedule_get_earliest_wakeup (struct schedule *s, struct timeval *wakeup)
 

Macro Definition Documentation

◆ IN_TREE

#define IN_TREE (   e)    ((e)->pri)

Definition at line 74 of file schedule.h.

Function Documentation

◆ schedule_add_entry()

static void schedule_add_entry ( struct schedule s,
struct schedule_entry e,
const struct timeval *  tv,
unsigned int  sigma 
)
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.

Parameters
sscheduler tree
eentry to add to the schedule
tvwakeup time for the entry
sigmawindow size for the event in microseconds
Note
The caller should treat 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 106 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().

◆ schedule_add_modify()

void schedule_add_modify ( struct schedule s,
struct schedule_entry e 
)

◆ schedule_find_least()

struct schedule_entry * schedule_find_least ( struct schedule_entry e)

Definition at line 378 of file schedule.c.

References check_debug_level(), D_SCHEDULER, and schedule_entry::lt.

Referenced by schedule_get_earliest_wakeup().

◆ schedule_free()

void schedule_free ( struct schedule s)

Definition at line 415 of file schedule.c.

Referenced by multi_uninit().

◆ schedule_get_earliest_wakeup()

static struct schedule_entry * schedule_get_earliest_wakeup ( struct schedule s,
struct timeval *  wakeup 
)
inlinestatic

◆ schedule_init()

struct schedule * schedule_init ( void  )

Definition at line 406 of file schedule.c.

References ALLOC_OBJ_CLEAR.

Referenced by multi_init().

◆ schedule_remove_entry()

void schedule_remove_entry ( struct schedule s,
struct schedule_entry e 
)

Definition at line 421 of file schedule.c.

References schedule::earliest_wakeup, and schedule_remove_node().

Referenced by multi_close_instance(), and multi_process_timeout().

◆ schedule_remove_node()

void schedule_remove_node ( struct schedule s,
struct schedule_entry e 
)