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-2024 Arne Schwabe <arne@rfc2549.org>
5  * Copyright (C) 2020-2024 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, write to the Free Software Foundation, Inc.,
19  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  */
21 
22 #ifndef DCO_WIN_H
23 #define DCO_WIN_H
24 
25 #if defined(ENABLE_DCO) && defined(_WIN32)
26 
27 #include "buffer.h"
28 #include "ovpn_dco_win.h"
29 #include "sig.h"
30 
31 typedef OVPN_KEY_SLOT dco_key_slot_t;
32 typedef OVPN_CIPHER_ALG dco_cipher_t;
33 
34 struct dco_context {
35  struct tuntap *tt;
36 };
37 
38 typedef struct dco_context dco_context_t;
39 
40 struct tuntap
41 create_dco_handle(const char *devname, struct gc_arena *gc);
42 
43 void
44 dco_create_socket(HANDLE handle, struct addrinfo *remoteaddr, bool bind_local,
45  struct addrinfo *bind, int timeout,
46  struct signal_info *sig_info);
47 
48 void
49 dco_start_tun(struct tuntap *tt);
50 
51 #else /* if defined(ENABLE_DCO) && defined(_WIN32) */
52 
53 static inline void
54 dco_start_tun(struct tuntap *tt)
55 {
56  ASSERT(false);
57 }
58 
59 #endif /* defined(_WIN32) */
60 #endif /* ifndef DCO_H */
create_dco_handle
struct tuntap create_dco_handle(const char *devname, struct gc_arena *gc)
Definition: dco_win.c:45
bind_local
static void bind_local(struct link_socket *sock, const sa_family_t ai_family)
Definition: socket.c:1086
ASSERT
#define ASSERT(x)
Definition: error.h:195
OVPN_CIPHER_ALG
enum _OVPN_CIPHER_ALG OVPN_CIPHER_ALG
dco_context_t
void * dco_context_t
Definition: dco.h:254
dco_create_socket
void dco_create_socket(HANDLE handle, struct addrinfo *remoteaddr, bool bind_local, struct addrinfo *bind, int timeout, struct signal_info *sig_info)
Definition: dco_win.c:159
buffer.h
OVPN_KEY_SLOT
enum _OVPN_KEY_SLOT OVPN_KEY_SLOT
gc_arena
Garbage collection arena used to keep track of dynamically allocated memory.
Definition: buffer.h:116
signal_info
Definition: sig.h:41
tuntap
Definition: tun.h:171
sig.h
ovpn_dco_win.h
dco_start_tun
static void dco_start_tun(struct tuntap *tt)
Definition: dco_win.h:54