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 41da69782bSKristof Provost enum ovpn_del_reason { 42da69782bSKristof Provost OVPN_DEL_REASON_REQUESTED = 0, 43da69782bSKristof Provost OVPN_DEL_REASON_TIMEOUT = 1 44da69782bSKristof Provost }; 45da69782bSKristof Provost 46ab91feabSKristof Provost enum ovpn_key_slot { 47ab91feabSKristof Provost OVPN_KEY_SLOT_PRIMARY = 0, 48ab91feabSKristof Provost OVPN_KEY_SLOT_SECONDARY = 1 49ab91feabSKristof Provost }; 50ab91feabSKristof Provost 51ab91feabSKristof Provost enum ovpn_key_cipher { 52ab91feabSKristof Provost OVPN_CIPHER_ALG_NONE = 0, 53ab91feabSKristof Provost OVPN_CIPHER_ALG_AES_GCM = 1, 54ab91feabSKristof Provost OVPN_CIPHER_ALG_CHACHA20_POLY1305 = 2 55ab91feabSKristof Provost }; 56ab91feabSKristof Provost 57ab91feabSKristof Provost #define OVPN_NEW_PEER _IO ('D', 1) 58ab91feabSKristof Provost #define OVPN_DEL_PEER _IO ('D', 2) 59ab91feabSKristof Provost #define OVPN_GET_STATS _IO ('D', 3) 60ab91feabSKristof Provost #define OVPN_NEW_KEY _IO ('D', 4) 61ab91feabSKristof Provost #define OVPN_SWAP_KEYS _IO ('D', 5) 62ab91feabSKristof Provost #define OVPN_DEL_KEY _IO ('D', 6) 63ab91feabSKristof Provost #define OVPN_SET_PEER _IO ('D', 7) 64ab91feabSKristof Provost #define OVPN_START_VPN _IO ('D', 8) 6566de89d4SKristof Provost /* OVPN_SEND_PKT _IO ('D', 9) */ 66ab91feabSKristof Provost #define OVPN_POLL_PKT _IO ('D', 10) 67ab91feabSKristof Provost #define OVPN_GET_PKT _IO ('D', 11) 682e797555SGert Doering #define OVPN_SET_IFMODE _IO ('D', 12) 69*8b630fa9SKristof Provost #define OVPN_GET_PEER_STATS _IO ('D', 13) 70ab91feabSKristof Provost 71ab91feabSKristof Provost #endif 72