OpenVPN
|
#include "event.h"
Go to the source code of this file.
Data Structures | |
struct | multi_io |
Macros | |
#define | TA_UNDEF 0 |
#define | TA_SOCKET_READ 1 |
#define | TA_SOCKET_READ_RESIDUAL 2 |
#define | TA_SOCKET_WRITE 3 |
#define | TA_SOCKET_WRITE_READY 4 |
#define | TA_SOCKET_WRITE_DEFERRED 5 |
#define | TA_TUN_READ 6 |
#define | TA_TUN_WRITE 7 |
#define | TA_INITIAL 8 |
#define | TA_TIMEOUT 9 |
#define | TA_TUN_WRITE_TIMEOUT 10 |
Functions | |
struct multi_io * | multi_io_init (int maxevents, int *maxclients) |
void | multi_io_free (struct multi_io *multi_io) |
int | multi_io_wait (struct multi_context *m) |
void | multi_io_process_io (struct multi_context *m) |
void | multi_io_set_global_rw_flags (struct multi_context *m, struct multi_instance *mi) |
void | multi_io_action (struct multi_context *m, struct multi_instance *mi, int action, bool poll) |
void | multi_io_delete_event (struct multi_io *multi_io, event_t event) |
#define TA_INITIAL 8 |
Definition at line 45 of file multi_io.h.
#define TA_SOCKET_READ 1 |
Definition at line 38 of file multi_io.h.
#define TA_SOCKET_READ_RESIDUAL 2 |
Definition at line 39 of file multi_io.h.
#define TA_SOCKET_WRITE 3 |
Definition at line 40 of file multi_io.h.
#define TA_SOCKET_WRITE_DEFERRED 5 |
Definition at line 42 of file multi_io.h.
#define TA_SOCKET_WRITE_READY 4 |
Definition at line 41 of file multi_io.h.
#define TA_TIMEOUT 9 |
Definition at line 46 of file multi_io.h.
#define TA_TUN_READ 6 |
Definition at line 43 of file multi_io.h.
#define TA_TUN_WRITE 7 |
Definition at line 44 of file multi_io.h.
#define TA_TUN_WRITE_TIMEOUT 10 |
Definition at line 47 of file multi_io.h.
#define TA_UNDEF 0 |
Definition at line 37 of file multi_io.h.
void multi_io_action | ( | struct multi_context * | m, |
struct multi_instance * | mi, | ||
int | action, | ||
bool | poll | ||
) |
Definition at line 577 of file multi_io.c.
References multi_instance::context, D_MULTI_DEBUG, dmsg, IS_SIG, M_FATAL, msg, multi_close_instance_on_signal(), multi_io_dispatch(), multi_io_post(), multi_io_wait_lite(), multi_context::pending, TA_SOCKET_READ_RESIDUAL, TA_TUN_READ, and TA_UNDEF.
Referenced by multi_io_process_io(), and tunnel_server_loop().
Definition at line 665 of file multi_io.c.
References multi_io::es, and event_del().
void multi_io_free | ( | struct multi_io * | multi_io | ) |
Definition at line 163 of file multi_io.c.
References multi_io::es, multi_io::esr, and event_free().
Referenced by multi_uninit().
struct multi_io * multi_io_init | ( | int | maxevents, |
int * | maxclients | ||
) |
Definition at line 117 of file multi_io.c.
References ALLOC_ARRAY, ALLOC_OBJ_CLEAR, ASSERT, BASE_N_EVENTS, D_MULTI_LOW, multi_io::es, multi_io::esr, event_set_init(), max_int(), multi_io::maxevents, min_int(), msg, MULTI_IO_SIG, and wait_signal().
Referenced by multi_init().
void multi_io_process_io | ( | struct multi_context * | m | ) |
Definition at line 441 of file multi_io.c.
References event_set_return::arg, ASSERT, context::c2, D_MULTI_ERRORS, multi_io::esr, multi_instance::ev_arg, EVENT_ARG_LINK_SOCKET, EVENT_ARG_MULTI_INSTANCE, EVENT_READ, EVENT_WRITE, get_signal(), link_socket::info, IS_SIG, context_2::link_sockets, management_io(), multi_context::mbuf, mbuf_peek(), event_arg::mi, MPP_PRE_SELECT, MPP_RECORD_TOUCH, msg, multi_create_instance_tcp(), multi_context::multi_io, multi_io_action(), MULTI_IO_DCO, MULTI_IO_FILE_CLOSE_WRITE, MULTI_IO_MANAGEMENT, MULTI_IO_SIG, MULTI_IO_SOCKET, MULTI_IO_TUN, MULTI_N, multi_process_incoming_dco(), multi_process_io_udp(), multi_io::n_esr, multi_context::pending, link_socket_info::proto, proto_is_dgram(), event_set_return::rwflags, context::sig, signal_info::signal_received, event_arg::sock, socket_reset_listen_persistent(), TA_INITIAL, TA_SOCKET_READ, TA_SOCKET_WRITE, TA_SOCKET_WRITE_READY, TA_TUN_READ, TA_TUN_WRITE, multi_context::top, event_arg::type, and event_arg::u.
Referenced by tunnel_server_loop().
void multi_io_set_global_rw_flags | ( | struct multi_context * | m, |
struct multi_instance * | mi | ||
) |
Definition at line 136 of file multi_io.c.
References context::c2, multi_instance::context, multi_io::es, multi_instance::ev_arg, link_socket::ev_arg, EVENT_READ, EVENT_WRITE, link_socket::info, context_2::link_sockets, mbuf_defined(), multi_context::multi_io, link_socket_info::proto, proto_is_dgram(), socket_set(), multi_instance::socket_set_called, multi_instance::tcp_link_out_deferred, and multi_instance::tcp_rwflags.
Referenced by multi_io_dispatch(), and multi_io_post().
int multi_io_wait | ( | struct multi_context * | m | ) |
Definition at line 174 of file multi_io.c.
References event_set_return::arg, context::c1, context::c2, tuntap::dco, dco_event_set(), multi_io::es, multi_io::esr, link_socket::ev_arg, event_ctl(), EVENT_READ, event_wait(), get_io_flags_udp(), has_udp_in_local_list(), context_2::link_sockets, context_1::link_sockets_num, multi_io::management_persist_flags, management_socket_set(), multi_io::maxevents, multi_context::multi_io, MULTI_IO_DCO, MULTI_IO_FILE_CLOSE_WRITE, MULTI_IO_MANAGEMENT, MULTI_IO_TUN, multi_io::n_esr, context::options, p2mp_iow_flags(), event_set_return::rwflags, socket_set_listen_persistent(), status, context_2::timeval, multi_context::top, multi_io::tun_rwflags, tun_set(), context_1::tuntap, tuntap_is_wintun(), tuntap_ring_empty(), and update_time().
Referenced by tunnel_server_loop().