OpenVPN
dco_linux.h
Go to the documentation of this file.
1/*
2 * Interface to linux dco networking code
3 *
4 * Copyright (C) 2020-2024 Antonio Quartulli <a@unstable.cc>
5 * Copyright (C) 2020-2024 Arne Schwabe <arne@rfc2549.org>
6 * Copyright (C) 2020-2024 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, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22#ifndef DCO_LINUX_H
23#define DCO_LINUX_H
24
25#if defined(ENABLE_DCO) && defined(TARGET_LINUX)
26
27#include "event.h"
28
29#include "ovpn_dco_linux.h"
30
31#include <netlink/socket.h>
32#include <netlink/netlink.h>
33
34/* Defines to avoid mismatching with other platforms */
35#define OVPN_CMD_DEL_PEER OVPN_CMD_PEER_DEL_NTF
36#define OVPN_CMD_SWAP_KEYS OVPN_CMD_KEY_SWAP_NTF
37
38typedef enum ovpn_key_slot dco_key_slot_t;
39typedef enum ovpn_cipher_alg dco_cipher_t;
40
41/* OVPN section */
42
43enum ovpn_mode {
46};
47
48enum ovpn_ifla_attrs {
49 IFLA_OVPN_UNSPEC = 0,
50 IFLA_OVPN_MODE,
51
52 __IFLA_OVPN_AFTER_LAST,
53 IFLA_OVPN_MAX = __IFLA_OVPN_AFTER_LAST - 1,
54};
55
56typedef struct
57{
58 struct nl_sock *nl_sock;
59 struct nl_cb *nl_cb;
60 int status;
61
62 enum ovpn_mode ifmode;
63
64 int ovpn_dco_id;
65 int ovpn_dco_mcast_id;
66
67 unsigned int ifindex;
68
69 int dco_message_type;
70 int dco_message_peer_id;
71 int dco_message_key_id;
72 int dco_del_peer_reason;
73 uint64_t dco_read_bytes;
74 uint64_t dco_write_bytes;
76
77#endif /* defined(ENABLE_DCO) && defined(TARGET_LINUX) */
78#endif /* ifndef DCO_LINUX_H */
void * dco_context_t
Definition dco.h:267
static SERVICE_STATUS status
Definition interactive.c:52
ovpn_key_slot
ovpn_cipher_alg
@ OVPN_MODE_MP
@ OVPN_MODE_P2P