xref: /linux/drivers/net/ovpn/io.h (revision 8534731dbf2d52a539b94defd06d2a8d3514aacb)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* OpenVPN data channel offload
3  *
4  *  Copyright (C) 2019-2025 OpenVPN, Inc.
5  *
6  *  Author:	James Yonan <james@openvpn.net>
7  *		Antonio Quartulli <antonio@openvpn.net>
8  */
9 
10 #ifndef _NET_OVPN_OVPN_H_
11 #define _NET_OVPN_OVPN_H_
12 
13 /* DATA_V2 header size with AEAD encryption */
14 #define OVPN_HEAD_ROOM (OVPN_OPCODE_SIZE + OVPN_NONCE_WIRE_SIZE +	   \
15 			16 /* AEAD TAG length */ +			   \
16 			max(sizeof(struct udphdr), sizeof(struct tcphdr)) +\
17 			max(sizeof(struct ipv6hdr), sizeof(struct iphdr)))
18 
19 /* max padding required by encryption */
20 #define OVPN_MAX_PADDING 16
21 
22 netdev_tx_t ovpn_net_xmit(struct sk_buff *skb, struct net_device *dev);
23 
24 void ovpn_recv(struct ovpn_peer *peer, struct sk_buff *skb);
25 
26 void ovpn_encrypt_post(void *data, int ret);
27 void ovpn_decrypt_post(void *data, int ret);
28 
29 #endif /* _NET_OVPN_OVPN_H_ */
30