xref: /aosp_15_r20/bionic/libc/kernel/uapi/linux/if_tun.h (revision 8d67ca893c1523eb926b9080dbe4e2ffd2a27ba1)
1 /*
2  * This file is auto-generated. Modifications will be lost.
3  *
4  * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5  * for more information.
6  */
7 #ifndef _UAPI__IF_TUN_H
8 #define _UAPI__IF_TUN_H
9 #include <linux/types.h>
10 #include <linux/if_ether.h>
11 #include <linux/filter.h>
12 #define TUN_READQ_SIZE 500
13 #define TUN_TUN_DEV IFF_TUN
14 #define TUN_TAP_DEV IFF_TAP
15 #define TUN_TYPE_MASK 0x000f
16 #define TUNSETNOCSUM _IOW('T', 200, int)
17 #define TUNSETDEBUG _IOW('T', 201, int)
18 #define TUNSETIFF _IOW('T', 202, int)
19 #define TUNSETPERSIST _IOW('T', 203, int)
20 #define TUNSETOWNER _IOW('T', 204, int)
21 #define TUNSETLINK _IOW('T', 205, int)
22 #define TUNSETGROUP _IOW('T', 206, int)
23 #define TUNGETFEATURES _IOR('T', 207, unsigned int)
24 #define TUNSETOFFLOAD _IOW('T', 208, unsigned int)
25 #define TUNSETTXFILTER _IOW('T', 209, unsigned int)
26 #define TUNGETIFF _IOR('T', 210, unsigned int)
27 #define TUNGETSNDBUF _IOR('T', 211, int)
28 #define TUNSETSNDBUF _IOW('T', 212, int)
29 #define TUNATTACHFILTER _IOW('T', 213, struct sock_fprog)
30 #define TUNDETACHFILTER _IOW('T', 214, struct sock_fprog)
31 #define TUNGETVNETHDRSZ _IOR('T', 215, int)
32 #define TUNSETVNETHDRSZ _IOW('T', 216, int)
33 #define TUNSETQUEUE _IOW('T', 217, int)
34 #define TUNSETIFINDEX _IOW('T', 218, unsigned int)
35 #define TUNGETFILTER _IOR('T', 219, struct sock_fprog)
36 #define TUNSETVNETLE _IOW('T', 220, int)
37 #define TUNGETVNETLE _IOR('T', 221, int)
38 #define TUNSETVNETBE _IOW('T', 222, int)
39 #define TUNGETVNETBE _IOR('T', 223, int)
40 #define TUNSETSTEERINGEBPF _IOR('T', 224, int)
41 #define TUNSETFILTEREBPF _IOR('T', 225, int)
42 #define TUNSETCARRIER _IOW('T', 226, int)
43 #define TUNGETDEVNETNS _IO('T', 227)
44 #define IFF_TUN 0x0001
45 #define IFF_TAP 0x0002
46 #define IFF_NAPI 0x0010
47 #define IFF_NAPI_FRAGS 0x0020
48 #define IFF_NO_CARRIER 0x0040
49 #define IFF_NO_PI 0x1000
50 #define IFF_ONE_QUEUE 0x2000
51 #define IFF_VNET_HDR 0x4000
52 #define IFF_TUN_EXCL 0x8000
53 #define IFF_MULTI_QUEUE 0x0100
54 #define IFF_ATTACH_QUEUE 0x0200
55 #define IFF_DETACH_QUEUE 0x0400
56 #define IFF_PERSIST 0x0800
57 #define IFF_NOFILTER 0x1000
58 #define TUN_TX_TIMESTAMP 1
59 #define TUN_F_CSUM 0x01
60 #define TUN_F_TSO4 0x02
61 #define TUN_F_TSO6 0x04
62 #define TUN_F_TSO_ECN 0x08
63 #define TUN_F_UFO 0x10
64 #define TUN_F_USO4 0x20
65 #define TUN_F_USO6 0x40
66 #define TUN_PKT_STRIP 0x0001
67 struct tun_pi {
68   __u16 flags;
69   __be16 proto;
70 };
71 #define TUN_FLT_ALLMULTI 0x0001
72 struct tun_filter {
73   __u16 flags;
74   __u16 count;
75   __u8 addr[][ETH_ALEN];
76 };
77 #endif
78