diff options
Diffstat (limited to 'include/linux/if_tun.h')
| -rw-r--r-- | include/linux/if_tun.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h index 3f5fd523b49d..06b1829731fd 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,10 @@ | |||
| 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) | ||
| 54 | #define TUNGETVNETHDRSZ _IOR('T', 215, int) | ||
| 55 | #define TUNSETVNETHDRSZ _IOW('T', 216, int) | ||
| 51 | 56 | ||
| 52 | /* TUNSETIFF ifr flags */ | 57 | /* TUNSETIFF ifr flags */ |
| 53 | #define IFF_TUN 0x0001 | 58 | #define IFF_TUN 0x0001 |
| @@ -86,4 +91,18 @@ struct tun_filter { | |||
| 86 | __u8 addr[0][ETH_ALEN]; | 91 | __u8 addr[0][ETH_ALEN]; |
| 87 | }; | 92 | }; |
| 88 | 93 | ||
| 94 | #ifdef __KERNEL__ | ||
| 95 | #if defined(CONFIG_TUN) || defined(CONFIG_TUN_MODULE) | ||
| 96 | struct socket *tun_get_socket(struct file *); | ||
| 97 | #else | ||
| 98 | #include <linux/err.h> | ||
| 99 | #include <linux/errno.h> | ||
| 100 | struct file; | ||
| 101 | struct socket; | ||
| 102 | static inline struct socket *tun_get_socket(struct file *f) | ||
| 103 | { | ||
| 104 | return ERR_PTR(-EINVAL); | ||
| 105 | } | ||
| 106 | #endif /* CONFIG_TUN */ | ||
| 107 | #endif /* __KERNEL__ */ | ||
| 89 | #endif /* __IF_TUN_H */ | 108 | #endif /* __IF_TUN_H */ |
