1/*-
2 * SPDX-License-Identifier: BSD-2-Clause
3 *
4 * Copyright (c) 2021-2022 Rubicon Communications, LLC (Netgate)
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
16 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#ifndef _NET_IF_OVPN_H_
29#define _NET_IF_OVPN_H_
30
31#include <sys/types.h>
32#include <netinet/in.h>
33
34/* Maximum size of an ioctl request. */
35#define OVPN_MAX_REQUEST_SIZE 4096
36
37enum ovpn_notif_type {
38 OVPN_NOTIF_DEL_PEER,
39 OVPN_NOTIF_ROTATE_KEY,
40 OVPN_NOTIF_FLOAT,
41};
42
43enum ovpn_del_reason {
44 OVPN_DEL_REASON_REQUESTED = 0,
45 OVPN_DEL_REASON_TIMEOUT = 1
46};
47
48enum ovpn_key_slot {
49 OVPN_KEY_SLOT_PRIMARY = 0,
50 OVPN_KEY_SLOT_SECONDARY = 1
51};
52
53enum ovpn_key_cipher {
54 OVPN_CIPHER_ALG_NONE = 0,
55 OVPN_CIPHER_ALG_AES_GCM = 1,
56 OVPN_CIPHER_ALG_CHACHA20_POLY1305 = 2
57};
58
59#define OVPN_NEW_PEER _IO ('D', 1)
60#define OVPN_DEL_PEER _IO ('D', 2)
61#define OVPN_GET_STATS _IO ('D', 3)
62#define OVPN_NEW_KEY _IO ('D', 4)
63#define OVPN_SWAP_KEYS _IO ('D', 5)
64#define OVPN_DEL_KEY _IO ('D', 6)
65#define OVPN_SET_PEER _IO ('D', 7)
66#define OVPN_START_VPN _IO ('D', 8)
67/* OVPN_SEND_PKT _IO ('D', 9) */
68#define OVPN_POLL_PKT _IO ('D', 10)
69#define OVPN_GET_PKT _IO ('D', 11)
70#define OVPN_SET_IFMODE _IO ('D', 12)
71#define OVPN_GET_PEER_STATS _IO ('D', 13)
72
73#endif