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