Home | History | Annotate | Download | only in linux
      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
     14 
     15 #include <linux/types.h>
     16 #include <linux/if_ether.h>
     17 #include <linux/filter.h>
     18 
     19 #define TUN_READQ_SIZE 500
     20 
     21 #define TUN_TUN_DEV 0x0001
     22 #define TUN_TAP_DEV 0x0002
     23 #define TUN_TYPE_MASK 0x000f
     24 
     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
     30 #define TUN_VNET_HDR 0x0200
     31 
     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)
     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)
     49 
     50 #define IFF_TUN 0x0001
     51 #define IFF_TAP 0x0002
     52 #define IFF_NO_PI 0x1000
     53 #define IFF_ONE_QUEUE 0x2000
     54 #define IFF_VNET_HDR 0x4000
     55 #define IFF_TUN_EXCL 0x8000
     56 
     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
     62 
     63 #define TUN_PKT_STRIP 0x0001
     64 struct tun_pi {
     65  __u16 flags;
     66  __be16 proto;
     67 };
     68 
     69 #define TUN_FLT_ALLMULTI 0x0001
     70 struct tun_filter {
     71  __u16 flags;
     72  __u16 count;
     73  __u8 addr[0][ETH_ALEN];
     74 };
     75 
     76 #endif
     77 
     78