OpenVPN
src
openvpn
dco_linux.h
Go to the documentation of this file.
1
/*
2
* Interface to linux dco networking code
3
*
4
* Copyright (C) 2020-2026 Antonio Quartulli <a@unstable.cc>
5
* Copyright (C) 2020-2026 Arne Schwabe <arne@rfc2549.org>
6
* Copyright (C) 2020-2026 OpenVPN Inc <sales@openvpn.net>
7
*
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License version 2
10
* as published by the Free Software Foundation.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program (see the file COPYING included with this
19
* distribution); if not, see <https://www.gnu.org/licenses/>.
20
*/
21
#ifndef DCO_LINUX_H
22
#define DCO_LINUX_H
23
24
#if defined(ENABLE_DCO) && defined(TARGET_LINUX)
25
26
#include "
event.h
"
27
28
#include "
ovpn_dco_linux.h
"
29
30
#include <netlink/socket.h>
31
#include <netlink/netlink.h>
32
33
/* Defines to avoid mismatching with other platforms */
34
#define OVPN_CMD_DEL_PEER OVPN_CMD_PEER_DEL_NTF
35
#define OVPN_CMD_SWAP_KEYS OVPN_CMD_KEY_SWAP_NTF
36
#define OVPN_CMD_FLOAT_PEER OVPN_CMD_PEER_FLOAT_NTF
37
38
typedef
enum
ovpn_key_slot
dco_key_slot_t;
39
typedef
enum
ovpn_cipher_alg
dco_cipher_t;
40
41
/* OVPN section */
42
43
#ifndef IFLA_OVPN_MAX
44
45
enum
ovpn_mode
46
{
47
OVPN_MODE_P2P
,
48
OVPN_MODE_MP
,
49
};
50
51
enum
ovpn_ifla_attrs
52
{
53
IFLA_OVPN_UNSPEC = 0,
54
IFLA_OVPN_MODE,
55
56
__IFLA_OVPN_MAX,
57
};
58
59
#define IFLA_OVPN_MAX (__IFLA_OVPN_MAX - 1)
60
61
#endif
/* ifndef IFLA_OVPN_MAX */
62
63
typedef
struct
64
{
65
/* socket used for synchronous request/reply transactions (commands and
66
* stats queries). It is NOT subscribed to the multicast group, so its
67
* recvmsgs never dispatch an asynchronous notification. */
68
struct
nl_sock *nl_sock;
69
struct
nl_cb *nl_cb;
70
/* socket dedicated to multicast notifications (peer del/float, key swap).
71
* It is read only at the top-level dco_read_and_process() point, where it
72
* is safe to close instances. Keeping it separate from nl_sock prevents
73
* notifications from being processed re-entrantly while a request/reply is
74
* in flight. */
75
struct
nl_sock *nl_sock_notify;
76
struct
nl_cb *nl_cb_notify;
77
int
status
;
78
79
struct
context
*c;
80
int
ctrlid;
81
82
enum
ovpn_mode ifmode;
83
84
int
ovpn_dco_id;
85
int
ovpn_dco_mcast_id;
86
87
unsigned
int
ifindex;
88
89
int
dco_message_type;
90
int
dco_message_peer_id;
91
int
dco_message_key_id;
92
int
dco_del_peer_reason;
93
struct
sockaddr_storage dco_float_peer_ss;
94
}
dco_context_t
;
95
96
#endif
/* defined(ENABLE_DCO) && defined(TARGET_LINUX) */
97
#endif
/* ifndef DCO_LINUX_H */
dco_context_t
void * dco_context_t
Definition
dco.h:259
event.h
status
static SERVICE_STATUS status
Definition
interactive.c:52
ovpn_key_slot
ovpn_key_slot
Definition
ovpn_dco_freebsd.h:51
ovpn_dco_linux.h
ovpn_cipher_alg
ovpn_cipher_alg
Definition
ovpn_dco_linux.h:14
OVPN_MODE_MP
@ OVPN_MODE_MP
Definition
ovpn_dco_win.h:149
OVPN_MODE_P2P
@ OVPN_MODE_P2P
Definition
ovpn_dco_win.h:148
context
Contains all state information for one tunnel.
Definition
openvpn.h:471
Generated by
1.9.8