OpenVPN
dco_linux.h
Go to the documentation of this file.
1/*
2 * Interface to linux dco networking code
3 *
4 * Copyright (C) 2020-2025 Antonio Quartulli <a@unstable.cc>
5 * Copyright (C) 2020-2025 Arne Schwabe <arne@rfc2549.org>
6 * Copyright (C) 2020-2025 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
38typedef enum ovpn_key_slot dco_key_slot_t;
39typedef enum ovpn_cipher_alg dco_cipher_t;
40
41/* OVPN section */
42
43#ifndef IFLA_OVPN_MAX
44
45enum ovpn_mode
46{
49};
50
51enum 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
63typedef struct
64{
65 struct nl_sock *nl_sock;
66 struct nl_cb *nl_cb;
67 int status;
68
69 struct context *c;
70 int ctrlid;
71
72 enum ovpn_mode ifmode;
73
74 int ovpn_dco_id;
75 int ovpn_dco_mcast_id;
76
77 unsigned int ifindex;
78
79 int dco_message_type;
80 int dco_message_peer_id;
81 int dco_message_key_id;
82 int dco_del_peer_reason;
83 struct sockaddr_storage dco_float_peer_ss;
84 uint64_t dco_read_bytes;
85 uint64_t dco_write_bytes;
87
88#endif /* defined(ENABLE_DCO) && defined(TARGET_LINUX) */
89#endif /* ifndef DCO_LINUX_H */
void * dco_context_t
Definition dco.h:261
static SERVICE_STATUS status
Definition interactive.c:51
ovpn_key_slot
ovpn_cipher_alg
@ OVPN_MODE_MP
@ OVPN_MODE_P2P
Contains all state information for one tunnel.
Definition openvpn.h:474