OpenVPN
|
#include "syshead.h"
#include "memdbg.h"
#include "multi.h"
#include "forward.h"
#include "multi_io.h"
Go to the source code of this file.
Data Structures | |
struct | ta_iow_flags |
Macros | |
#define | MULTI_IO_SOCKET ((void *)1) |
#define | MULTI_IO_TUN ((void *)2) |
#define | MULTI_IO_SIG ((void *)3) /* Only on Windows */ |
#define | MULTI_IO_MANAGEMENT ((void *)4) |
#define | MULTI_IO_FILE_CLOSE_WRITE ((void *)5) |
#define | MULTI_IO_DCO ((void *)6) |
#define | MTP_NONE 0 |
#define | MTP_TUN_OUT (1<<0) |
#define | MTP_LINK_OUT (1<<1) |
Functions | |
static struct context * | multi_get_context (struct multi_context *m, struct multi_instance *mi) |
struct multi_io * | multi_io_init (int maxevents, int *maxclients) |
void | multi_io_set_global_rw_flags (struct multi_context *m, struct multi_instance *mi) |
void | multi_io_free (struct multi_io *multi_io) |
int | multi_io_wait (struct multi_context *m) |
static int | multi_io_wait_lite (struct multi_context *m, struct multi_instance *mi, const int action, bool *tun_input_pending) |
static struct multi_instance * | multi_io_dispatch (struct multi_context *m, struct multi_instance *mi, const int action) |
static int | multi_io_post (struct multi_context *m, struct multi_instance *mi, const int action) |
void | multi_io_process_io (struct multi_context *m) |
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 MTP_LINK_OUT (1<<1) |
#define MTP_NONE 0 |
#define MTP_TUN_OUT (1<<0) |
#define MULTI_IO_DCO ((void *)6) |
Definition at line 48 of file multi_io.c.
#define MULTI_IO_FILE_CLOSE_WRITE ((void *)5) |
Definition at line 47 of file multi_io.c.
#define MULTI_IO_MANAGEMENT ((void *)4) |
Definition at line 46 of file multi_io.c.
#define MULTI_IO_SIG ((void *)3) /* Only on Windows */ |
Definition at line 45 of file multi_io.c.
#define MULTI_IO_SOCKET ((void *)1) |
Definition at line 43 of file multi_io.c.
#define MULTI_IO_TUN ((void *)2) |
Definition at line 44 of file multi_io.c.
|
inlinestatic |
Definition at line 104 of file multi_io.c.
References multi_instance::context, and multi_context::top.
Referenced by multi_io_post(), and multi_io_wait_lite().
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().
|
static |
Definition at line 302 of file multi_io.c.
References ASSERT, context::c2, clear_prefix(), multi_instance::context, D_MULTI_DEBUG, dmsg, IS_SIG, context_2::link_sockets, M_FATAL, MPP_PRE_SELECT, MPP_RECORD_TOUCH, multi_context::mpp_touched, msg, multi_io_set_global_rw_flags(), multi_process_drop_outgoing_tun(), multi_process_incoming_link(), multi_process_incoming_tun(), multi_process_outgoing_tun(), multi_process_post(), multi_process_timeout(), multi_tcp_process_outgoing_link(), multi_tcp_process_outgoing_link_ready(), ptr_format, read_incoming_link(), read_incoming_tun(), set_prefix(), stream_buf_read_setup(), TA_INITIAL, TA_SOCKET_READ, TA_SOCKET_READ_RESIDUAL, TA_SOCKET_WRITE, TA_SOCKET_WRITE_DEFERRED, TA_SOCKET_WRITE_READY, TA_TIMEOUT, TA_TUN_READ, TA_TUN_WRITE, TA_TUN_WRITE_TIMEOUT, and multi_context::top.
Referenced by multi_io_action().
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().
|
static |
Definition at line 381 of file multi_io.c.
References D_MULTI_DEBUG, dmsg, gc, gc_free(), gc_new(), LINK_OUT, M_FATAL, msg, MTP_LINK_OUT, MTP_NONE, MTP_TUN_OUT, multi_get_context(), multi_instance_string(), multi_io_set_global_rw_flags(), sockets_read_residual(), TA_SOCKET_READ_RESIDUAL, TA_SOCKET_WRITE, TA_TUN_WRITE, TA_UNDEF, and TUN_OUT.
Referenced by multi_io_action().
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().
|
static |
Definition at line 232 of file multi_io.c.
References context::c2, D_MULTI_DEBUG, dmsg, context_2::event_set_status, io_wait(), IOW_READ_LINK, IOW_READ_TUN, IOW_READ_TUN_FORCE, IOW_TO_LINK, IOW_TO_TUN, M_FATAL, msg, multi_get_context(), perf_pop(), PERF_PROC_OUT_TUN_MTCP, perf_push(), ptr_format, SOCKET_READ, SOCKET_WRITE, TA_SOCKET_READ, TA_SOCKET_WRITE, TA_SOCKET_WRITE_DEFERRED, TA_TUN_READ, TA_TUN_WRITE, TA_TUN_WRITE_TIMEOUT, TA_UNDEF, context_2::timeval, TUN_READ, TUN_WRITE, and tv_clear().
Referenced by multi_io_action().