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 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

◆ ERR_SHIFT

#define ERR_SHIFT   4

Definition at line 67 of file event.h.

Referenced by io_wait_dowork().

◆ ES_ERROR

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

Definition at line 68 of file event.h.

Referenced by io_wait_dowork().

◆ ES_TIMEOUT

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

Definition at line 69 of file event.h.

Referenced by io_wait_dowork(), tunnel_point_to_point(), and tunnel_server_udp().

◆ EVENT_METHOD_FAST

#define EVENT_METHOD_FAST   (1<<1)

Definition at line 80 of file event.h.

Referenced by do_event_set_init(), event_set_init(), man_connection_init(), and we_init().

◆ EVENT_METHOD_US_TIMEOUT

#define EVENT_METHOD_US_TIMEOUT   (1<<0)

Definition at line 79 of file event.h.

Referenced by do_event_set_init(), and event_set_init_simple().

◆ EVENT_READ

#define EVENT_READ   (1 << READ_SHIFT)

◆ EVENT_UNDEF

#define EVENT_UNDEF   4

Definition at line 38 of file event.h.

◆ EVENT_WRITE

#define EVENT_WRITE   (1 << WRITE_SHIFT)

◆ FILE_CLOSED

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

Definition at line 74 of file event.h.

Referenced by multi_process_io_udp().

◆ FILE_SHIFT

#define FILE_SHIFT   8

Definition at line 73 of file event.h.

Referenced by io_wait_dowork().

◆ MANAGEMENT_READ

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

Definition at line 71 of file event.h.

Referenced by multi_process_io_udp(), and process_io().

◆ MANAGEMENT_SHIFT

#define MANAGEMENT_SHIFT   6

Definition at line 70 of file event.h.

Referenced by io_wait_dowork().

◆ MANAGEMENT_WRITE

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

Definition at line 72 of file event.h.

Referenced by multi_process_io_udp(), and process_io().

◆ 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.

Referenced by io_wait_dowork(), multi_process_io_udp(), multi_tcp_wait_lite(), and process_io().

◆ SOCKET_SHIFT

#define SOCKET_SHIFT   0

Definition at line 61 of file event.h.

Referenced by io_wait_dowork().

◆ SOCKET_WRITE

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

Definition at line 63 of file event.h.

Referenced by io_wait(), multi_process_io_udp(), multi_tcp_wait_lite(), and process_io().

◆ TUN_READ

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

Definition at line 65 of file event.h.

Referenced by io_wait(), multi_process_io_udp(), multi_tcp_wait_lite(), and process_io().

◆ TUN_SHIFT

#define TUN_SHIFT   2

Definition at line 64 of file event.h.

Referenced by io_wait_dowork().

◆ TUN_WRITE

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

Definition at line 66 of file event.h.

Referenced by io_wait(), multi_process_io_udp(), multi_tcp_wait_lite(), and process_io().

◆ UNDEFINED_EVENT

#define UNDEFINED_EVENT   (NULL)

Definition at line 86 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 84 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 151 of file event.h.

References event_set_functions::del, and event_set::func.

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 136 of file event.h.

References event_set_functions::free, and event_set::func.

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 145 of file event.h.

References event_set::func, and event_set_functions::reset.

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 173 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

◆ wait_signal()

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

Definition at line 182 of file event.h.

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

Referenced by io_wait_dowork(), and multi_tcp_init().