Debian Codegraph @

drivers/net/ovpn/io.h

raw
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 <[email protected]>
7 * Antonio Quartulli <[email protected]>
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 #define OVPN_KEEPALIVE_SIZE 16
23 extern const unsigned char ovpn_keepalive_message[OVPN_KEEPALIVE_SIZE];
24
25 netdev_tx_t ovpn_net_xmit(struct sk_buff *skb, struct net_device *dev);
26
27 void ovpn_recv(struct ovpn_peer *peer, struct sk_buff *skb);
28 void ovpn_xmit_special(struct ovpn_peer *peer, const void *data,
29 const unsigned int len);
30
31 void ovpn_encrypt_post(void *data, int ret);
32 void ovpn_decrypt_post(void *data, int ret);
33
34 #endif /* _NET_OVPN_OVPN_H_ */