Debian Codegraph @

drivers/net/ovpn-dco/ovpnstruct.h

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* OpenVPN data channel accelerator
3 *
4 * Copyright (C) 2019-2023 OpenVPN, Inc.
5 *
6 * Author: James Yonan <[email protected]>
7 * Antonio Quartulli <[email protected]>
8 */
9
10 #ifndef _NET_OVPN_DCO_OVPNSTRUCT_H_
11 #define _NET_OVPN_DCO_OVPNSTRUCT_H_
12
13 #include "peer.h"
14
15 #include <uapi/linux/ovpn_dco.h>
16 #include <linux/mutex.h>
17 #include <linux/spinlock.h>
18 #include <linux/workqueue.h>
19
20 /* Our state per ovpn interface */
21 struct ovpn_struct {
22 /* read-mostly objects in this section */
23 struct net_device *dev;
24
25 /* device operation mode (i.e. P2P, MP) */
26 enum ovpn_mode mode;
27
28 /* protect writing to the ovpn_struct object */
29 spinlock_t lock;
30
31 /* protect NAPI add/delete operations */
32 struct mutex napi_lock;
33
34 /* workqueue used to schedule crypto work that may sleep */
35 struct workqueue_struct *crypto_wq;
36 /* workqueue used to schedule generic event that may sleep or that need
37 * to be performed out of softirq context
38 */
39 struct workqueue_struct *events_wq;
40
41 /* list of known peers */
42 struct {
43 DECLARE_HASHTABLE(by_id, 12);
44 DECLARE_HASHTABLE(by_transp_addr, 12);
45 DECLARE_HASHTABLE(by_vpn_addr, 12);
46 /* protects write access to any of the hashtables above */
47 spinlock_t lock;
48 } peers;
49
50 /* for p2p mode */
51 struct ovpn_peer __rcu *peer;
52
53 unsigned int max_tun_queue_len;
54
55 netdev_features_t set_features;
56
57 void *security;
58
59 u32 registered_nl_portid;
60 bool registered_nl_portid_set;
61 };
62
63 #endif /* _NET_OVPN_DCO_OVPNSTRUCT_H_ */