OpenVPN
src
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
*/
52
struct
multi_io
53
{
54
struct
event_set
*
es
;
55
struct
event_set_return
*
esr
;
56
int
n_esr
;
57
int
maxevents
;
58
unsigned
int
tun_rwflags
;
59
unsigned
int
udp_flags
;
60
#ifdef ENABLE_MANAGEMENT
61
unsigned
int
management_persist_flags
;
62
#endif
63
};
64
65
struct
multi_io
*
multi_io_init
(
int
maxevents
,
int
*maxclients);
66
67
void
multi_io_free
(
struct
multi_io
*
multi_io
);
68
69
int
multi_io_wait
(
struct
multi_context
*m);
70
71
void
multi_io_process_io
(
struct
multi_context
*m);
72
73
void
multi_io_set_global_rw_flags
(
struct
multi_context
*m,
struct
multi_instance
*mi);
74
75
void
multi_io_action
(
struct
multi_context
*m,
struct
multi_instance
*mi,
int
action,
bool
poll);
76
77
void
multi_io_delete_event
(
struct
multi_io
*
multi_io
,
event_t
event);
78
79
#endif
/* ifndef MULTI_IO_H */
event.h
multi_io_process_io
void multi_io_process_io(struct multi_context *m)
Definition
multi_io.c:441
multi_io_init
struct multi_io * multi_io_init(int maxevents, int *maxclients)
Definition
multi_io.c:117
multi_io_free
void multi_io_free(struct multi_io *multi_io)
Definition
multi_io.c:163
multi_io_set_global_rw_flags
void multi_io_set_global_rw_flags(struct multi_context *m, struct multi_instance *mi)
Definition
multi_io.c:136
multi_io_wait
int multi_io_wait(struct multi_context *m)
Definition
multi_io.c:174
multi_io_delete_event
void multi_io_delete_event(struct multi_io *multi_io, event_t event)
Definition
multi_io.c:665
multi_io_action
void multi_io_action(struct multi_context *m, struct multi_instance *mi, int action, bool poll)
Definition
multi_io.c:577
event_set_return
Definition
event.h:125
event_set
Definition
event.h:131
multi_context
Main OpenVPN server state structure.
Definition
multi.h:163
multi_instance
Server-mode state structure for one single VPN tunnel.
Definition
multi.h:103
multi_io
Definition
multi_io.h:53
multi_io::es
struct event_set * es
Definition
multi_io.h:54
multi_io::n_esr
int n_esr
Definition
multi_io.h:56
multi_io::esr
struct event_set_return * esr
Definition
multi_io.h:55
multi_io::tun_rwflags
unsigned int tun_rwflags
Definition
multi_io.h:58
multi_io::maxevents
int maxevents
Definition
multi_io.h:57
multi_io::udp_flags
unsigned int udp_flags
Definition
multi_io.h:59
multi_io::management_persist_flags
unsigned int management_persist_flags
Definition
multi_io.h:61
rw_handle
Definition
win32.h:79
Generated by
1.9.8