OpenVPN
Data Structures | Macros | Typedefs | Functions
event.h File Reference
#include "win32.h"
#include "sig.h"
#include "perf.h"
Include dependency graph for event.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  event_set_functions
 
struct  event_set_return
 
struct  event_set
 

Macros

#define READ_SHIFT   0
 
#define WRITE_SHIFT   1
 
#define EVENT_UNDEF   4
 
#define EVENT_READ   (1 << READ_SHIFT)
 
#define EVENT_WRITE   (1 << WRITE_SHIFT)
 
#define SOCKET_SHIFT   0
 
#define SOCKET_READ   (1 << (SOCKET_SHIFT + READ_SHIFT))
 
#define SOCKET_WRITE   (1 << (SOCKET_SHIFT + WRITE_SHIFT))
 
#define TUN_SHIFT   2
 
#define TUN_READ   (1 << (TUN_SHIFT + READ_SHIFT))
 
#define TUN_WRITE   (1 << (TUN_SHIFT + WRITE_SHIFT))
 
#define ERR_SHIFT   4
 
#define ES_ERROR   (1 << (ERR_SHIFT + READ_SHIFT))
 
#define ES_TIMEOUT   (1 << (ERR_SHIFT + WRITE_SHIFT))
 
#define MANAGEMENT_SHIFT   6
 
#define MANAGEMENT_READ   (1 << (MANAGEMENT_SHIFT + READ_SHIFT))
 
#define MANAGEMENT_WRITE   (1 << (MANAGEMENT_SHIFT + WRITE_SHIFT))
 
#define FILE_SHIFT   8
 
#define FILE_CLOSED   (1 << (FILE_SHIFT + READ_SHIFT))
 
#define DCO_SHIFT   10
 
#define DCO_READ   (1 << (DCO_SHIFT + READ_SHIFT))
 
#define DCO_WRITE   (1 << (DCO_SHIFT + WRITE_SHIFT))
 
#define EVENT_METHOD_US_TIMEOUT   (1<<0)
 
#define EVENT_METHOD_FAST   (1<<1)
 
#define UNDEFINED_EVENT   (NULL)
 

Typedefs

typedef const struct rw_handleevent_t
 

Functions

struct event_setevent_set_init (int *maxevents, unsigned int flags)
 
static void event_free (struct event_set *es)
 
static void event_reset (struct event_set *es)
 
static void event_del (struct event_set *es, event_t event)
 
static void event_ctl (struct event_set *es, event_t event, unsigned int rwflags, void *arg)
 
static int event_wait (struct event_set *es, const struct timeval *tv, struct event_set_return *out, int outlen)
 
static void event_set_return_init (struct event_set_return *esr)
 
static void wait_signal (struct event_set *es, void *arg)
 

Macro Definition Documentation

◆ DCO_READ

#define DCO_READ   (1 << (DCO_SHIFT + READ_SHIFT))

Definition at line 76 of file event.h.

◆ DCO_SHIFT

#define DCO_SHIFT   10

Definition at line 75 of file event.h.

◆ DCO_WRITE

#define DCO_WRITE   (1 << (DCO_SHIFT + WRITE_SHIFT))

Definition at line 77 of file event.h.

◆ ERR_SHIFT

#define ERR_SHIFT   4

Definition at line 67 of file event.h.

◆ ES_ERROR

#define ES_ERROR   (1 << (ERR_SHIFT + READ_SHIFT))

Definition at line 68 of file event.h.

◆ ES_TIMEOUT

#define ES_TIMEOUT   (1 << (ERR_SHIFT + WRITE_SHIFT))

Definition at line 69 of file event.h.

◆ EVENT_METHOD_FAST

#define EVENT_METHOD_FAST   (1<<1)

Definition at line 83 of file event.h.

◆ EVENT_METHOD_US_TIMEOUT

#define EVENT_METHOD_US_TIMEOUT   (1<<0)

Definition at line 82 of file event.h.

◆ EVENT_READ

#define EVENT_READ   (1 << READ_SHIFT)

Definition at line 39 of file event.h.

◆ EVENT_UNDEF

#define EVENT_UNDEF   4

Definition at line 38 of file event.h.

◆ EVENT_WRITE

#define EVENT_WRITE   (1 << WRITE_SHIFT)

Definition at line 40 of file event.h.

◆ FILE_CLOSED

#define FILE_CLOSED   (1 << (FILE_SHIFT + READ_SHIFT))

Definition at line 74 of file event.h.

◆ FILE_SHIFT

#define FILE_SHIFT   8

Definition at line 73 of file event.h.

◆ MANAGEMENT_READ

#define MANAGEMENT_READ   (1 << (MANAGEMENT_SHIFT + READ_SHIFT))

Definition at line 71 of file event.h.

◆ MANAGEMENT_SHIFT

#define MANAGEMENT_SHIFT   6

Definition at line 70 of file event.h.

◆ MANAGEMENT_WRITE

#define MANAGEMENT_WRITE   (1 << (MANAGEMENT_SHIFT + WRITE_SHIFT))

Definition at line 72 of file event.h.

◆ READ_SHIFT

#define READ_SHIFT   0

Definition at line 35 of file event.h.

◆ SOCKET_READ

#define SOCKET_READ   (1 << (SOCKET_SHIFT + READ_SHIFT))

Definition at line 62 of file event.h.

◆ SOCKET_SHIFT

#define SOCKET_SHIFT   0

Definition at line 61 of file event.h.

◆ SOCKET_WRITE

#define SOCKET_WRITE   (1 << (SOCKET_SHIFT + WRITE_SHIFT))

Definition at line 63 of file event.h.

◆ TUN_READ

#define TUN_READ   (1 << (TUN_SHIFT + READ_SHIFT))

Definition at line 65 of file event.h.

◆ TUN_SHIFT

#define TUN_SHIFT   2

Definition at line 64 of file event.h.

◆ TUN_WRITE

#define TUN_WRITE   (1 << (TUN_SHIFT + WRITE_SHIFT))

Definition at line 66 of file event.h.

◆ UNDEFINED_EVENT

#define UNDEFINED_EVENT   (NULL)

Definition at line 89 of file event.h.

◆ WRITE_SHIFT

#define WRITE_SHIFT   1

Definition at line 36 of file event.h.

Typedef Documentation

◆ event_t

typedef const struct rw_handle* event_t

Definition at line 87 of file event.h.

Function Documentation

◆ event_ctl()

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

◆ event_del()

static void event_del ( struct event_set es,
event_t  event 
)
inlinestatic

Definition at line 154 of file event.h.

References es.

Referenced by multi_tcp_delete_event(), and multi_tcp_dereference_instance().

◆ event_free()

static void event_free ( struct event_set es)
inlinestatic

Definition at line 139 of file event.h.

References es.

Referenced by do_close_event_set(), man_connection_close(), and multi_tcp_free().

◆ event_reset()

static void event_reset ( struct event_set es)
inlinestatic

Definition at line 148 of file event.h.

References es.

Referenced by io_wait_dowork(), and man_block().

◆ event_set_init()

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

◆ event_set_return_init()

static void event_set_return_init ( struct event_set_return esr)
inlinestatic

Definition at line 176 of file event.h.

References event_set_return::arg, and event_set_return::rwflags.

◆ event_wait()

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

Definition at line 166 of file event.h.

References es, PERF_IO_WAIT, perf_pop(), and perf_push().

Referenced by io_wait_dowork(), man_block(), and multi_tcp_wait().

◆ wait_signal()

static void wait_signal ( struct event_set es,
void *  arg 
)
inlinestatic

Definition at line 185 of file event.h.

References es, event_ctl(), EVENT_READ, HANDLE_DEFINED, win32_signal::in, and rw_handle::read.

Referenced by io_wait_dowork(), and multi_tcp_init().