xref: /freebsd/sys/net/if_ovpn.h (revision 0078721898754f6e71063e1f566c8671288a2218)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
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 
37 enum ovpn_notif_type {
38 	OVPN_NOTIF_DEL_PEER,
39 };
40 
41 enum ovpn_key_slot {
42 	OVPN_KEY_SLOT_PRIMARY	= 0,
43 	OVPN_KEY_SLOT_SECONDARY	= 1
44 };
45 
46 enum ovpn_key_cipher {
47 	OVPN_CIPHER_ALG_NONE			= 0,
48 	OVPN_CIPHER_ALG_AES_GCM			= 1,
49 	OVPN_CIPHER_ALG_CHACHA20_POLY1305	= 2
50 };
51 
52 #define OVPN_NEW_PEER		_IO  ('D', 1)
53 #define OVPN_DEL_PEER		_IO  ('D', 2)
54 #define OVPN_GET_STATS		_IO  ('D', 3)
55 #define OVPN_NEW_KEY		_IO  ('D', 4)
56 #define OVPN_SWAP_KEYS		_IO  ('D', 5)
57 #define OVPN_DEL_KEY		_IO  ('D', 6)
58 #define OVPN_SET_PEER		_IO  ('D', 7)
59 #define OVPN_START_VPN		_IO  ('D', 8)
60 #define OVPN_SEND_PKT		_IO  ('D', 9)
61 #define OVPN_POLL_PKT		_IO  ('D', 10)
62 #define OVPN_GET_PKT		_IO  ('D', 11)
63 #define OVPN_SET_IFMODE		_IO  ('D', 12)
64 
65 #endif
66