OpenVPN
src
openvpn
dco_win.h
Go to the documentation of this file.
1
/*
2
* Interface to ovpn-win-dco networking code
3
*
4
* Copyright (C) 2020-2025 Arne Schwabe <arne@rfc2549.org>
5
* Copyright (C) 2020-2025 OpenVPN Inc <sales@openvpn.net>
6
*
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License version 2
9
* as published by the Free Software Foundation.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program (see the file COPYING included with this
18
* distribution); if not, see <https://www.gnu.org/licenses/>.
19
*/
20
21
#ifndef DCO_WIN_H
22
#define DCO_WIN_H
23
24
#if defined(ENABLE_DCO) && defined(_WIN32)
25
26
#include <in6addr.h>
27
28
#include "
buffer.h
"
29
#include "
ovpn_dco_win.h
"
30
#include "
sig.h
"
31
32
typedef
OVPN_KEY_SLOT
dco_key_slot_t;
33
typedef
OVPN_CIPHER_ALG
dco_cipher_t;
34
35
typedef
enum
36
{
37
DCO_MODE_UNINIT,
38
DCO_MODE_P2P,
39
DCO_MODE_MP
40
} dco_mode_type;
41
42
struct
dco_context
43
{
44
struct
tuntap
*tt;
45
dco_mode_type ifmode;
46
47
OVPN_NOTIFY_EVENT
notif_buf;
48
OVERLAPPED ov;
49
int
iostate;
50
struct
rw_handle
rwhandle;
51
int
ov_ret;
53
int
dco_message_peer_id;
54
int
dco_message_type;
55
int
dco_del_peer_reason;
56
struct
sockaddr_storage dco_float_peer_ss;
57
58
uint64_t dco_read_bytes;
59
uint64_t dco_write_bytes;
60
61
struct
context
*c;
62
};
63
64
typedef
struct
dco_context
dco_context_t
;
65
66
void
dco_mp_start_vpn
(HANDLE handle,
struct
link_socket
*sock);
67
68
void
dco_p2p_new_peer
(HANDLE handle, OVERLAPPED *ov,
struct
link_socket
*sock,
69
struct
signal_info
*sig_info);
70
71
void
dco_start_tun
(
struct
tuntap
*tt);
72
73
bool
dco_win_supports_multipeer
(
void
);
74
75
void
dco_win_add_iroute_ipv4
(
dco_context_t
*dco, in_addr_t dst,
unsigned
int
netbits,
76
unsigned
int
peer_id);
77
78
void
dco_win_add_iroute_ipv6
(
dco_context_t
*dco,
struct
in6_addr dst,
unsigned
int
netbits,
79
unsigned
int
peer_id);
80
81
void
dco_win_del_iroute_ipv4
(
dco_context_t
*dco, in_addr_t dst,
unsigned
int
netbits);
82
83
void
dco_win_del_iroute_ipv6
(
dco_context_t
*dco,
struct
in6_addr dst,
unsigned
int
netbits);
84
85
#else
/* if defined(ENABLE_DCO) && defined(_WIN32) */
86
87
static
inline
void
88
dco_start_tun
(
struct
tuntap
*tt)
89
{
90
ASSERT
(
false
);
91
}
92
93
#endif
/* defined(_WIN32) */
94
#endif
/* ifndef DCO_H */
buffer.h
dco_context_t
void * dco_context_t
Definition
dco.h:261
dco_mp_start_vpn
void dco_mp_start_vpn(HANDLE handle, struct link_socket *sock)
Initializes and binds the kernel UDP transport socket for multipeer mode.
Definition
dco_win.c:283
dco_win_add_iroute_ipv6
void dco_win_add_iroute_ipv6(dco_context_t *dco, struct in6_addr dst, unsigned int netbits, unsigned int peer_id)
Definition
dco_win.c:1016
dco_win_del_iroute_ipv4
void dco_win_del_iroute_ipv4(dco_context_t *dco, in_addr_t dst, unsigned int netbits)
Definition
dco_win.c:1037
dco_win_supports_multipeer
bool dco_win_supports_multipeer(void)
Definition
dco_win.c:986
dco_win_del_iroute_ipv6
void dco_win_del_iroute_ipv6(dco_context_t *dco, struct in6_addr dst, unsigned int netbits)
Definition
dco_win.c:1058
dco_p2p_new_peer
void dco_p2p_new_peer(HANDLE handle, OVERLAPPED *ov, struct link_socket *sock, struct signal_info *sig_info)
Definition
dco_win.c:327
dco_win_add_iroute_ipv4
void dco_win_add_iroute_ipv4(dco_context_t *dco, in_addr_t dst, unsigned int netbits, unsigned int peer_id)
Definition
dco_win.c:993
dco_start_tun
static void dco_start_tun(struct tuntap *tt)
Definition
dco_win.h:88
ASSERT
#define ASSERT(x)
Definition
error.h:217
ovpn_dco_win.h
OVPN_KEY_SLOT
enum _OVPN_KEY_SLOT OVPN_KEY_SLOT
OVPN_CIPHER_ALG
enum _OVPN_CIPHER_ALG OVPN_CIPHER_ALG
sig.h
_OVPN_NOTIFY_EVENT
Definition
ovpn_dco_win.h:171
context
Contains all state information for one tunnel.
Definition
openvpn.h:474
link_socket
Definition
socket.h:148
rw_handle
Definition
win32.h:80
signal_info
Definition
sig.h:41
tuntap
Definition
tun.h:183
Generated by
1.9.8