OpenVPN
multi_io.h
Go to the documentation of this file.
1/*
2 * OpenVPN -- An application to securely tunnel IP networks
3 * over a single TCP/UDP port, with support for SSL/TLS-based
4 * session authentication and key exchange,
5 * packet encryption, packet authentication, and
6 * packet compression.
7 *
8 * Copyright (C) 2002-2023 OpenVPN Inc <sales@openvpn.net>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2
12 * as published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 */
23
24/*
25 * Multi-protocol specific code for --mode server
26 */
27
28#ifndef MULTI_IO_H
29#define MULTI_IO_H
30
31#include "event.h"
32
33/*
34 * I/O processing States
35 */
36
37#define TA_UNDEF 0
38#define TA_SOCKET_READ 1
39#define TA_SOCKET_READ_RESIDUAL 2
40#define TA_SOCKET_WRITE 3
41#define TA_SOCKET_WRITE_READY 4
42#define TA_SOCKET_WRITE_DEFERRED 5
43#define TA_TUN_READ 6
44#define TA_TUN_WRITE 7
45#define TA_INITIAL 8
46#define TA_TIMEOUT 9
47#define TA_TUN_WRITE_TIMEOUT 10
48
49/*
50 * I/O state and events tracker
51 */
53{
54 struct event_set *es;
56 int n_esr;
58 unsigned int tun_rwflags;
59 unsigned int udp_flags;
60#ifdef ENABLE_MANAGEMENT
62#endif
63};
64
65struct multi_io *multi_io_init(int maxevents, int *maxclients);
66
67void multi_io_free(struct multi_io *multi_io);
68
69int multi_io_wait(struct multi_context *m);
70
72
74
75void multi_io_action(struct multi_context *m, struct multi_instance *mi, int action, bool poll);
76
78
79#endif /* ifndef MULTI_IO_H */
void multi_io_process_io(struct multi_context *m)
Definition multi_io.c:441
struct multi_io * multi_io_init(int maxevents, int *maxclients)
Definition multi_io.c:117
void multi_io_free(struct multi_io *multi_io)
Definition multi_io.c:163
void multi_io_set_global_rw_flags(struct multi_context *m, struct multi_instance *mi)
Definition multi_io.c:136
int multi_io_wait(struct multi_context *m)
Definition multi_io.c:174
void multi_io_delete_event(struct multi_io *multi_io, event_t event)
Definition multi_io.c:665
void multi_io_action(struct multi_context *m, struct multi_instance *mi, int action, bool poll)
Definition multi_io.c:577
Main OpenVPN server state structure.
Definition multi.h:163
Server-mode state structure for one single VPN tunnel.
Definition multi.h:103
struct event_set * es
Definition multi_io.h:54
int n_esr
Definition multi_io.h:56
struct event_set_return * esr
Definition multi_io.h:55
unsigned int tun_rwflags
Definition multi_io.h:58
int maxevents
Definition multi_io.h:57
unsigned int udp_flags
Definition multi_io.h:59
unsigned int management_persist_flags
Definition multi_io.h:61