The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 1 | /**************************************************************************** |
| 2 | **************************************************************************** |
| 3 | *** |
| 4 | *** This header was automatically generated from a Linux kernel header |
| 5 | *** of the same name, to make information necessary for userspace to |
| 6 | *** call into the kernel available to libc. It contains only constants, |
| 7 | *** structures, and macros generated from the original header, and thus, |
| 8 | *** contains no copyrightable information. |
| 9 | *** |
| 10 | **************************************************************************** |
| 11 | ****************************************************************************/ |
| 12 | #ifndef __IF_TUN_H |
| 13 | #define __IF_TUN_H |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 14 | |
Dmitry Shmidt | ce69c5e | 2011-01-06 15:30:35 -0800 | [diff] [blame] | 15 | #include <linux/types.h> |
| 16 | #include <linux/if_ether.h> |
| 17 | #include <linux/filter.h> |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 18 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 19 | #define TUN_READQ_SIZE 500 |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 20 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 21 | #define TUN_TUN_DEV 0x0001 |
| 22 | #define TUN_TAP_DEV 0x0002 |
| 23 | #define TUN_TYPE_MASK 0x000f |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 24 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 25 | #define TUN_FASYNC 0x0010 |
| 26 | #define TUN_NOCHECKSUM 0x0020 |
| 27 | #define TUN_NO_PI 0x0040 |
| 28 | #define TUN_ONE_QUEUE 0x0080 |
| 29 | #define TUN_PERSIST 0x0100 |
Dmitry Shmidt | ce69c5e | 2011-01-06 15:30:35 -0800 | [diff] [blame] | 30 | #define TUN_VNET_HDR 0x0200 |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 31 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 32 | #define TUNSETNOCSUM _IOW('T', 200, int) |
| 33 | #define TUNSETDEBUG _IOW('T', 201, int) |
| 34 | #define TUNSETIFF _IOW('T', 202, int) |
| 35 | #define TUNSETPERSIST _IOW('T', 203, int) |
| 36 | #define TUNSETOWNER _IOW('T', 204, int) |
| 37 | #define TUNSETLINK _IOW('T', 205, int) |
Dmitry Shmidt | ce69c5e | 2011-01-06 15:30:35 -0800 | [diff] [blame] | 38 | #define TUNSETGROUP _IOW('T', 206, int) |
| 39 | #define TUNGETFEATURES _IOR('T', 207, unsigned int) |
| 40 | #define TUNSETOFFLOAD _IOW('T', 208, unsigned int) |
| 41 | #define TUNSETTXFILTER _IOW('T', 209, unsigned int) |
| 42 | #define TUNGETIFF _IOR('T', 210, unsigned int) |
| 43 | #define TUNGETSNDBUF _IOR('T', 211, int) |
| 44 | #define TUNSETSNDBUF _IOW('T', 212, int) |
| 45 | #define TUNATTACHFILTER _IOW('T', 213, struct sock_fprog) |
| 46 | #define TUNDETACHFILTER _IOW('T', 214, struct sock_fprog) |
| 47 | #define TUNGETVNETHDRSZ _IOR('T', 215, int) |
| 48 | #define TUNSETVNETHDRSZ _IOW('T', 216, int) |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 49 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 50 | #define IFF_TUN 0x0001 |
| 51 | #define IFF_TAP 0x0002 |
| 52 | #define IFF_NO_PI 0x1000 |
| 53 | #define IFF_ONE_QUEUE 0x2000 |
Dmitry Shmidt | ce69c5e | 2011-01-06 15:30:35 -0800 | [diff] [blame] | 54 | #define IFF_VNET_HDR 0x4000 |
| 55 | #define IFF_TUN_EXCL 0x8000 |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 56 | |
Dmitry Shmidt | ce69c5e | 2011-01-06 15:30:35 -0800 | [diff] [blame] | 57 | #define TUN_F_CSUM 0x01 |
| 58 | #define TUN_F_TSO4 0x02 |
| 59 | #define TUN_F_TSO6 0x04 |
| 60 | #define TUN_F_TSO_ECN 0x08 |
| 61 | #define TUN_F_UFO 0x10 |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 62 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 63 | #define TUN_PKT_STRIP 0x0001 |
Dmitry Shmidt | ce69c5e | 2011-01-06 15:30:35 -0800 | [diff] [blame] | 64 | struct tun_pi { |
| 65 | __u16 flags; |
| 66 | __be16 proto; |
| 67 | }; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 68 | |
Dmitry Shmidt | ce69c5e | 2011-01-06 15:30:35 -0800 | [diff] [blame] | 69 | #define TUN_FLT_ALLMULTI 0x0001 |
| 70 | struct tun_filter { |
| 71 | __u16 flags; |
| 72 | __u16 count; |
| 73 | __u8 addr[0][ETH_ALEN]; |
| 74 | }; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 75 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 76 | #endif |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 77 | |