aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/if_tun.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/if_tun.h')
-rw-r--r--include/linux/if_tun.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h
index 3f5fd523b49d..1350a246893a 100644
--- a/include/linux/if_tun.h
+++ b/include/linux/if_tun.h
@@ -18,6 +18,7 @@
18 18
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/if_ether.h> 20#include <linux/if_ether.h>
21#include <linux/filter.h>
21 22
22/* Read queue size */ 23/* Read queue size */
23#define TUN_READQ_SIZE 500 24#define TUN_READQ_SIZE 500
@@ -48,6 +49,8 @@
48#define TUNGETIFF _IOR('T', 210, unsigned int) 49#define TUNGETIFF _IOR('T', 210, unsigned int)
49#define TUNGETSNDBUF _IOR('T', 211, int) 50#define TUNGETSNDBUF _IOR('T', 211, int)
50#define TUNSETSNDBUF _IOW('T', 212, int) 51#define TUNSETSNDBUF _IOW('T', 212, int)
52#define TUNATTACHFILTER _IOW('T', 213, struct sock_fprog)
53#define TUNDETACHFILTER _IOW('T', 214, struct sock_fprog)
51 54
52/* TUNSETIFF ifr flags */ 55/* TUNSETIFF ifr flags */
53#define IFF_TUN 0x0001 56#define IFF_TUN 0x0001
@@ -86,4 +89,18 @@ struct tun_filter {
86 __u8 addr[0][ETH_ALEN]; 89 __u8 addr[0][ETH_ALEN];
87}; 90};
88 91
92#ifdef __KERNEL__
93#if defined(CONFIG_TUN) || defined(CONFIG_TUN_MODULE)
94struct socket *tun_get_socket(struct file *);
95#else
96#include <linux/err.h>
97#include <linux/errno.h>
98struct file;
99struct socket;
100static inline struct socket *tun_get_socket(struct file *f)
101{
102 return ERR_PTR(-EINVAL);
103}
104#endif /* CONFIG_TUN */
105#endif /* __KERNEL__ */
89#endif /* __IF_TUN_H */ 106#endif /* __IF_TUN_H */