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