| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [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 |  ***   To edit the content of this header, modify the corresponding | 
 | 11 |  ***   source file (e.g. under external/kernel-headers/original/) then | 
 | 12 |  ***   run bionic/libc/kernel/tools/update_all.py | 
 | 13 |  *** | 
 | 14 |  ***   Any manual change here will be lost the next time this script will | 
 | 15 |  ***   be run. You've been warned! | 
 | 16 |  *** | 
 | 17 |  **************************************************************************** | 
 | 18 |  ****************************************************************************/ | 
 | 19 | #ifndef _LINUX_IF_H | 
 | 20 | #define _LINUX_IF_H | 
| Christopher Ferris | 82ef6a1 | 2016-05-19 16:36:40 -0700 | [diff] [blame] | 21 | #include <linux/libc-compat.h> | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 22 | #include <linux/types.h> | 
| Christopher Ferris | 82ef6a1 | 2016-05-19 16:36:40 -0700 | [diff] [blame] | 23 | #include <linux/socket.h> | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 24 | #include <linux/compiler.h> | 
| Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 25 | #include <sys/socket.h> | 
| Christopher Ferris | 82ef6a1 | 2016-05-19 16:36:40 -0700 | [diff] [blame] | 26 | #if __UAPI_DEF_IF_IFNAMSIZ | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 27 | #define IFNAMSIZ 16 | 
| Christopher Ferris | 82ef6a1 | 2016-05-19 16:36:40 -0700 | [diff] [blame] | 28 | #endif | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 29 | #define IFALIASZ 256 | 
 | 30 | #include <linux/hdlc/ioctl.h> | 
| Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 31 | #if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO != 0 || __UAPI_DEF_IF_NET_DEVICE_FLAGS != 0 | 
| Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 32 | enum net_device_flags { | 
| Christopher Ferris | 82ef6a1 | 2016-05-19 16:36:40 -0700 | [diff] [blame] | 33 | #if __UAPI_DEF_IF_NET_DEVICE_FLAGS | 
 | 34 |   IFF_UP = 1 << 0, IFF_BROADCAST = 1 << 1, IFF_DEBUG = 1 << 2, IFF_LOOPBACK = 1 << 3, IFF_POINTOPOINT = 1 << 4, IFF_NOTRAILERS = 1 << 5, IFF_RUNNING = 1 << 6, IFF_NOARP = 1 << 7, IFF_PROMISC = 1 << 8, IFF_ALLMULTI = 1 << 9, IFF_MASTER = 1 << 10, IFF_SLAVE = 1 << 11, IFF_MULTICAST = 1 << 12, IFF_PORTSEL = 1 << 13, IFF_AUTOMEDIA = 1 << 14, IFF_DYNAMIC = 1 << 15, | 
 | 35 | #endif | 
| Christopher Ferris | 82ef6a1 | 2016-05-19 16:36:40 -0700 | [diff] [blame] | 36 | #if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO | 
 | 37 |   IFF_LOWER_UP = 1 << 16, IFF_DORMANT = 1 << 17, IFF_ECHO = 1 << 18, | 
 | 38 | #endif | 
| Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 39 | }; | 
| Christopher Ferris | 82ef6a1 | 2016-05-19 16:36:40 -0700 | [diff] [blame] | 40 | #endif | 
 | 41 | #if __UAPI_DEF_IF_NET_DEVICE_FLAGS | 
| Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 42 | #define IFF_UP IFF_UP | 
 | 43 | #define IFF_BROADCAST IFF_BROADCAST | 
| Christopher Ferris | 82ef6a1 | 2016-05-19 16:36:40 -0700 | [diff] [blame] | 44 | #define IFF_DEBUG IFF_DEBUG | 
| Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 45 | #define IFF_LOOPBACK IFF_LOOPBACK | 
 | 46 | #define IFF_POINTOPOINT IFF_POINTOPOINT | 
 | 47 | #define IFF_NOTRAILERS IFF_NOTRAILERS | 
| Christopher Ferris | 82ef6a1 | 2016-05-19 16:36:40 -0700 | [diff] [blame] | 48 | #define IFF_RUNNING IFF_RUNNING | 
| Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 49 | #define IFF_NOARP IFF_NOARP | 
 | 50 | #define IFF_PROMISC IFF_PROMISC | 
 | 51 | #define IFF_ALLMULTI IFF_ALLMULTI | 
| Christopher Ferris | 82ef6a1 | 2016-05-19 16:36:40 -0700 | [diff] [blame] | 52 | #define IFF_MASTER IFF_MASTER | 
| Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 53 | #define IFF_SLAVE IFF_SLAVE | 
 | 54 | #define IFF_MULTICAST IFF_MULTICAST | 
 | 55 | #define IFF_PORTSEL IFF_PORTSEL | 
| Christopher Ferris | 82ef6a1 | 2016-05-19 16:36:40 -0700 | [diff] [blame] | 56 | #define IFF_AUTOMEDIA IFF_AUTOMEDIA | 
| Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 57 | #define IFF_DYNAMIC IFF_DYNAMIC | 
| Christopher Ferris | 82ef6a1 | 2016-05-19 16:36:40 -0700 | [diff] [blame] | 58 | #endif | 
 | 59 | #if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO | 
| Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 60 | #define IFF_LOWER_UP IFF_LOWER_UP | 
 | 61 | #define IFF_DORMANT IFF_DORMANT | 
 | 62 | #define IFF_ECHO IFF_ECHO | 
| Christopher Ferris | 82ef6a1 | 2016-05-19 16:36:40 -0700 | [diff] [blame] | 63 | #endif | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 64 | #define IFF_VOLATILE (IFF_LOOPBACK | IFF_POINTOPOINT | IFF_BROADCAST | IFF_ECHO | IFF_MASTER | IFF_SLAVE | IFF_RUNNING | IFF_LOWER_UP | IFF_DORMANT) | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 65 | #define IF_GET_IFACE 0x0001 | 
 | 66 | #define IF_GET_PROTO 0x0002 | 
| Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 67 | #define IF_IFACE_V35 0x1000 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 68 | #define IF_IFACE_V24 0x1001 | 
 | 69 | #define IF_IFACE_X21 0x1002 | 
 | 70 | #define IF_IFACE_T1 0x1003 | 
| Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 71 | #define IF_IFACE_E1 0x1004 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 72 | #define IF_IFACE_SYNC_SERIAL 0x1005 | 
 | 73 | #define IF_IFACE_X21D 0x1006 | 
 | 74 | #define IF_PROTO_HDLC 0x2000 | 
| Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 75 | #define IF_PROTO_PPP 0x2001 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 76 | #define IF_PROTO_CISCO 0x2002 | 
 | 77 | #define IF_PROTO_FR 0x2003 | 
 | 78 | #define IF_PROTO_FR_ADD_PVC 0x2004 | 
| Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 79 | #define IF_PROTO_FR_DEL_PVC 0x2005 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 80 | #define IF_PROTO_X25 0x2006 | 
 | 81 | #define IF_PROTO_HDLC_ETH 0x2007 | 
 | 82 | #define IF_PROTO_FR_ADD_ETH_PVC 0x2008 | 
| Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 83 | #define IF_PROTO_FR_DEL_ETH_PVC 0x2009 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 84 | #define IF_PROTO_FR_PVC 0x200A | 
 | 85 | #define IF_PROTO_FR_ETH_PVC 0x200B | 
 | 86 | #define IF_PROTO_RAW 0x200C | 
| Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 87 | enum { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 88 |   IF_OPER_UNKNOWN, | 
 | 89 |   IF_OPER_NOTPRESENT, | 
 | 90 |   IF_OPER_DOWN, | 
 | 91 |   IF_OPER_LOWERLAYERDOWN, | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 92 |   IF_OPER_TESTING, | 
 | 93 |   IF_OPER_DORMANT, | 
 | 94 |   IF_OPER_UP, | 
| Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 95 | }; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 96 | enum { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 97 |   IF_LINK_MODE_DEFAULT, | 
 | 98 |   IF_LINK_MODE_DORMANT, | 
| Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 99 | }; | 
| Christopher Ferris | 82ef6a1 | 2016-05-19 16:36:40 -0700 | [diff] [blame] | 100 | #if __UAPI_DEF_IF_IFMAP | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 101 | struct ifmap { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 102 |   unsigned long mem_start; | 
 | 103 |   unsigned long mem_end; | 
| Christopher Ferris | 82ef6a1 | 2016-05-19 16:36:40 -0700 | [diff] [blame] | 104 |   unsigned short base_addr; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 105 |   unsigned char irq; | 
 | 106 |   unsigned char dma; | 
 | 107 |   unsigned char port; | 
| Christopher Ferris | 82ef6a1 | 2016-05-19 16:36:40 -0700 | [diff] [blame] | 108 | }; | 
 | 109 | #endif | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 110 | struct if_settings { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 111 |   unsigned int type; | 
 | 112 |   unsigned int size; | 
 | 113 |   union { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 114 |     raw_hdlc_proto __user * raw_hdlc; | 
 | 115 |     cisco_proto __user * cisco; | 
 | 116 |     fr_proto __user * fr; | 
 | 117 |     fr_proto_pvc __user * fr_pvc; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 118 |     fr_proto_pvc_info __user * fr_pvc_info; | 
 | 119 |     sync_serial_settings __user * sync; | 
 | 120 |     te1_settings __user * te1; | 
 | 121 |   } ifs_ifsu; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 122 | }; | 
| Christopher Ferris | 82ef6a1 | 2016-05-19 16:36:40 -0700 | [diff] [blame] | 123 | #if __UAPI_DEF_IF_IFREQ | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 124 | struct ifreq { | 
 | 125 | #define IFHWADDRLEN 6 | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 126 |   union { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 127 |     char ifrn_name[IFNAMSIZ]; | 
 | 128 |   } ifr_ifrn; | 
 | 129 |   union { | 
 | 130 |     struct sockaddr ifru_addr; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 131 |     struct sockaddr ifru_dstaddr; | 
 | 132 |     struct sockaddr ifru_broadaddr; | 
 | 133 |     struct sockaddr ifru_netmask; | 
 | 134 |     struct sockaddr ifru_hwaddr; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 135 |     short ifru_flags; | 
 | 136 |     int ifru_ivalue; | 
 | 137 |     int ifru_mtu; | 
 | 138 |     struct ifmap ifru_map; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 139 |     char ifru_slave[IFNAMSIZ]; | 
 | 140 |     char ifru_newname[IFNAMSIZ]; | 
 | 141 |     void __user * ifru_data; | 
 | 142 |     struct if_settings ifru_settings; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 143 |   } ifr_ifru; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 144 | }; | 
| Christopher Ferris | 82ef6a1 | 2016-05-19 16:36:40 -0700 | [diff] [blame] | 145 | #endif | 
| Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 146 | #define ifr_name ifr_ifrn.ifrn_name | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 147 | #define ifr_hwaddr ifr_ifru.ifru_hwaddr | 
 | 148 | #define ifr_addr ifr_ifru.ifru_addr | 
 | 149 | #define ifr_dstaddr ifr_ifru.ifru_dstaddr | 
| Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 150 | #define ifr_broadaddr ifr_ifru.ifru_broadaddr | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 151 | #define ifr_netmask ifr_ifru.ifru_netmask | 
 | 152 | #define ifr_flags ifr_ifru.ifru_flags | 
 | 153 | #define ifr_metric ifr_ifru.ifru_ivalue | 
| Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 154 | #define ifr_mtu ifr_ifru.ifru_mtu | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 155 | #define ifr_map ifr_ifru.ifru_map | 
 | 156 | #define ifr_slave ifr_ifru.ifru_slave | 
 | 157 | #define ifr_data ifr_ifru.ifru_data | 
| Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 158 | #define ifr_ifindex ifr_ifru.ifru_ivalue | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 159 | #define ifr_bandwidth ifr_ifru.ifru_ivalue | 
 | 160 | #define ifr_qlen ifr_ifru.ifru_ivalue | 
 | 161 | #define ifr_newname ifr_ifru.ifru_newname | 
| Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 162 | #define ifr_settings ifr_ifru.ifru_settings | 
| Christopher Ferris | 82ef6a1 | 2016-05-19 16:36:40 -0700 | [diff] [blame] | 163 | #if __UAPI_DEF_IF_IFCONF | 
| Christopher Ferris | 82ef6a1 | 2016-05-19 16:36:40 -0700 | [diff] [blame] | 164 | struct ifconf { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 165 |   int ifc_len; | 
 | 166 |   union { | 
 | 167 |     char __user * ifcu_buf; | 
| Christopher Ferris | 82ef6a1 | 2016-05-19 16:36:40 -0700 | [diff] [blame] | 168 |     struct ifreq __user * ifcu_req; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 169 |   } ifc_ifcu; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 170 | }; | 
| Christopher Ferris | 82ef6a1 | 2016-05-19 16:36:40 -0700 | [diff] [blame] | 171 | #endif | 
| Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 172 | #define ifc_buf ifc_ifcu.ifcu_buf | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 173 | #define ifc_req ifc_ifcu.ifcu_req | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 174 | #endif |