OpenVPN
Data Structures | Macros | Functions
event.c File Reference
#include "syshead.h"
#include "buffer.h"
#include "error.h"
#include "integer.h"
#include "event.h"
#include "fdmisc.h"
#include "memdbg.h"
Include dependency graph for event.c:

Go to the source code of this file.

Data Structures

struct  we_set
 

Macros

#define SELECT   0
 
#define SELECT_MAX_FDS   256
 

Functions

static int tv_to_ms_timeout (const struct timeval *tv)
 
static void we_set_event (struct we_set *wes, int i, event_t event, unsigned int rwflags, void *arg)
 
static bool we_append_event (struct we_set *wes, event_t event, unsigned int rwflags, void *arg)
 
static void we_del_event (struct we_set *wes, event_t event)
 
static void we_del_index (struct we_set *wes, int index)
 
static void we_get_rw_indices (struct we_set *wes, event_t event, int *ri, int *wi)
 
static void we_free (struct event_set *es)
 
static void we_reset (struct event_set *es)
 
static void we_del (struct event_set *es, event_t event)
 
static void we_ctl (struct event_set *es, event_t event, unsigned int rwflags, void *arg)
 
static int we_wait (struct event_set *es, const struct timeval *tv, struct event_set_return *out, int outlen)
 
static struct event_setwe_init (int *maxevents, unsigned int flags)
 
static struct event_setevent_set_init_simple (int *maxevents, unsigned int flags)
 
static struct event_setevent_set_init_scalable (int *maxevents, unsigned int flags)
 
struct event_setevent_set_init (int *maxevents, unsigned int flags)
 

Macro Definition Documentation

◆ SELECT

#define SELECT   0

Definition at line 52 of file event.c.

◆ SELECT_MAX_FDS

#define SELECT_MAX_FDS   256

Definition at line 64 of file event.c.

Referenced by we_init().

Function Documentation

◆ event_set_init()

struct event_set* event_set_init ( int *  maxevents,
unsigned int  flags 
)

◆ event_set_init_scalable()

static struct event_set* event_set_init_scalable ( int *  maxevents,
unsigned int  flags 
)
static

Definition at line 1162 of file event.c.

References ASSERT, event_set_init_simple(), M_WARN, and msg.

Referenced by event_set_init().

◆ event_set_init_simple()

static struct event_set* event_set_init_simple ( int *  maxevents,
unsigned int  flags 
)
static

Definition at line 1119 of file event.c.

References ASSERT, EVENT_METHOD_US_TIMEOUT, and we_init().

Referenced by event_set_init(), and event_set_init_scalable().

◆ tv_to_ms_timeout()

static int tv_to_ms_timeout ( const struct timeval *  tv)
inlinestatic

Definition at line 68 of file event.c.

References max_int().

Referenced by we_init(), and we_wait().

◆ we_append_event()

static bool we_append_event ( struct we_set wes,
event_t  event,
unsigned int  rwflags,
void *  arg 
)
inlinestatic

Definition at line 117 of file event.c.

References we_set::capacity, EVENT_READ, EVENT_WRITE, we_set::n_events, and we_set_event().

Referenced by we_ctl().

◆ we_ctl()

static void we_ctl ( struct event_set es,
event_t  event,
unsigned int  rwflags,
void *  arg 
)
static

◆ we_del()

static void we_del ( struct event_set es,
event_t  event 
)
static

Definition at line 223 of file event.c.

References ASSERT, we_set::fast, and we_del_event().

Referenced by we_init().

◆ we_del_event()

static void we_del_event ( struct we_set wes,
event_t  event 
)
static

Definition at line 147 of file event.c.

References we_set::esr, we_set::events, we_set::n_events, rw_handle::read, and rw_handle::write.

Referenced by we_ctl(), and we_del().

◆ we_del_index()

static void we_del_index ( struct we_set wes,
int  index 
)
static

Definition at line 172 of file event.c.

References ASSERT, we_set::esr, we_set::events, and we_set::n_events.

Referenced by we_ctl().

◆ we_free()

static void we_free ( struct event_set es)
static

Definition at line 206 of file event.c.

References we_set::esr, we_set::events, and free.

Referenced by we_init().

◆ we_get_rw_indices()

static void we_get_rw_indices ( struct we_set wes,
event_t  event,
int *  ri,
int *  wi 
)
static

Definition at line 185 of file event.c.

References ASSERT, we_set::events, we_set::n_events, rw_handle::read, and rw_handle::write.

Referenced by we_ctl().

◆ we_init()

static struct event_set* we_init ( int *  maxevents,
unsigned int  flags 
)
static

◆ we_reset()

static void we_reset ( struct event_set es)
static

Definition at line 215 of file event.c.

References ASSERT, we_set::fast, and we_set::n_events.

Referenced by we_init().

◆ we_set_event()

static void we_set_event ( struct we_set wes,
int  i,
event_t  event,
unsigned int  rwflags,
void *  arg 
)
inlinestatic

◆ we_wait()

static int we_wait ( struct event_set es,
const struct timeval *  tv,
struct event_set_return out,
int  outlen 
)
static