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 21 #include <linux/libc-compat.h> 22 #include <linux/types.h> 23 #include <linux/socket.h> 24 #include <linux/compiler.h> 25 #include <sys/socket.h> 26 #if __UAPI_DEF_IF_IFNAMSIZ 27 #define IFNAMSIZ 16 28 #endif 29 #define IFALIASZ 256 30 #define ALTIFNAMSIZ 128 31 #include <linux/hdlc/ioctl.h> 32 #if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO != 0 || __UAPI_DEF_IF_NET_DEVICE_FLAGS != 0 33 enum net_device_flags { 34 #if __UAPI_DEF_IF_NET_DEVICE_FLAGS 35 IFF_UP = 1 << 0, 36 IFF_BROADCAST = 1 << 1, 37 IFF_DEBUG = 1 << 2, 38 IFF_LOOPBACK = 1 << 3, 39 IFF_POINTOPOINT = 1 << 4, 40 IFF_NOTRAILERS = 1 << 5, 41 IFF_RUNNING = 1 << 6, 42 IFF_NOARP = 1 << 7, 43 IFF_PROMISC = 1 << 8, 44 IFF_ALLMULTI = 1 << 9, 45 IFF_MASTER = 1 << 10, 46 IFF_SLAVE = 1 << 11, 47 IFF_MULTICAST = 1 << 12, 48 IFF_PORTSEL = 1 << 13, 49 IFF_AUTOMEDIA = 1 << 14, 50 IFF_DYNAMIC = 1 << 15, 51 #endif 52 #if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 53 IFF_LOWER_UP = 1 << 16, 54 IFF_DORMANT = 1 << 17, 55 IFF_ECHO = 1 << 18, 56 #endif 57 }; 58 #endif 59 #if __UAPI_DEF_IF_NET_DEVICE_FLAGS 60 #define IFF_UP IFF_UP 61 #define IFF_BROADCAST IFF_BROADCAST 62 #define IFF_DEBUG IFF_DEBUG 63 #define IFF_LOOPBACK IFF_LOOPBACK 64 #define IFF_POINTOPOINT IFF_POINTOPOINT 65 #define IFF_NOTRAILERS IFF_NOTRAILERS 66 #define IFF_RUNNING IFF_RUNNING 67 #define IFF_NOARP IFF_NOARP 68 #define IFF_PROMISC IFF_PROMISC 69 #define IFF_ALLMULTI IFF_ALLMULTI 70 #define IFF_MASTER IFF_MASTER 71 #define IFF_SLAVE IFF_SLAVE 72 #define IFF_MULTICAST IFF_MULTICAST 73 #define IFF_PORTSEL IFF_PORTSEL 74 #define IFF_AUTOMEDIA IFF_AUTOMEDIA 75 #define IFF_DYNAMIC IFF_DYNAMIC 76 #endif 77 #if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 78 #define IFF_LOWER_UP IFF_LOWER_UP 79 #define IFF_DORMANT IFF_DORMANT 80 #define IFF_ECHO IFF_ECHO 81 #endif 82 #define IFF_VOLATILE (IFF_LOOPBACK | IFF_POINTOPOINT | IFF_BROADCAST | IFF_ECHO | IFF_MASTER | IFF_SLAVE | IFF_RUNNING | IFF_LOWER_UP | IFF_DORMANT) 83 #define IF_GET_IFACE 0x0001 84 #define IF_GET_PROTO 0x0002 85 #define IF_IFACE_V35 0x1000 86 #define IF_IFACE_V24 0x1001 87 #define IF_IFACE_X21 0x1002 88 #define IF_IFACE_T1 0x1003 89 #define IF_IFACE_E1 0x1004 90 #define IF_IFACE_SYNC_SERIAL 0x1005 91 #define IF_IFACE_X21D 0x1006 92 #define IF_PROTO_HDLC 0x2000 93 #define IF_PROTO_PPP 0x2001 94 #define IF_PROTO_CISCO 0x2002 95 #define IF_PROTO_FR 0x2003 96 #define IF_PROTO_FR_ADD_PVC 0x2004 97 #define IF_PROTO_FR_DEL_PVC 0x2005 98 #define IF_PROTO_X25 0x2006 99 #define IF_PROTO_HDLC_ETH 0x2007 100 #define IF_PROTO_FR_ADD_ETH_PVC 0x2008 101 #define IF_PROTO_FR_DEL_ETH_PVC 0x2009 102 #define IF_PROTO_FR_PVC 0x200A 103 #define IF_PROTO_FR_ETH_PVC 0x200B 104 #define IF_PROTO_RAW 0x200C 105 enum { 106 IF_OPER_UNKNOWN, 107 IF_OPER_NOTPRESENT, 108 IF_OPER_DOWN, 109 IF_OPER_LOWERLAYERDOWN, 110 IF_OPER_TESTING, 111 IF_OPER_DORMANT, 112 IF_OPER_UP, 113 }; 114 enum { 115 IF_LINK_MODE_DEFAULT, 116 IF_LINK_MODE_DORMANT, 117 IF_LINK_MODE_TESTING, 118 }; 119 #if __UAPI_DEF_IF_IFMAP 120 struct ifmap { 121 unsigned long mem_start; 122 unsigned long mem_end; 123 unsigned short base_addr; 124 unsigned char irq; 125 unsigned char dma; 126 unsigned char port; 127 }; 128 #endif 129 struct if_settings { 130 unsigned int type; 131 unsigned int size; 132 union { 133 raw_hdlc_proto * raw_hdlc; 134 cisco_proto * cisco; 135 fr_proto * fr; 136 fr_proto_pvc * fr_pvc; 137 fr_proto_pvc_info * fr_pvc_info; 138 x25_hdlc_proto * x25; 139 sync_serial_settings * sync; 140 te1_settings * te1; 141 } ifs_ifsu; 142 }; 143 #if __UAPI_DEF_IF_IFREQ 144 struct ifreq { 145 #define IFHWADDRLEN 6 146 union { 147 char ifrn_name[IFNAMSIZ]; 148 } ifr_ifrn; 149 union { 150 struct sockaddr ifru_addr; 151 struct sockaddr ifru_dstaddr; 152 struct sockaddr ifru_broadaddr; 153 struct sockaddr ifru_netmask; 154 struct sockaddr ifru_hwaddr; 155 short ifru_flags; 156 int ifru_ivalue; 157 int ifru_mtu; 158 struct ifmap ifru_map; 159 char ifru_slave[IFNAMSIZ]; 160 char ifru_newname[IFNAMSIZ]; 161 void * ifru_data; 162 struct if_settings ifru_settings; 163 } ifr_ifru; 164 }; 165 #endif 166 #define ifr_name ifr_ifrn.ifrn_name 167 #define ifr_hwaddr ifr_ifru.ifru_hwaddr 168 #define ifr_addr ifr_ifru.ifru_addr 169 #define ifr_dstaddr ifr_ifru.ifru_dstaddr 170 #define ifr_broadaddr ifr_ifru.ifru_broadaddr 171 #define ifr_netmask ifr_ifru.ifru_netmask 172 #define ifr_flags ifr_ifru.ifru_flags 173 #define ifr_metric ifr_ifru.ifru_ivalue 174 #define ifr_mtu ifr_ifru.ifru_mtu 175 #define ifr_map ifr_ifru.ifru_map 176 #define ifr_slave ifr_ifru.ifru_slave 177 #define ifr_data ifr_ifru.ifru_data 178 #define ifr_ifindex ifr_ifru.ifru_ivalue 179 #define ifr_bandwidth ifr_ifru.ifru_ivalue 180 #define ifr_qlen ifr_ifru.ifru_ivalue 181 #define ifr_newname ifr_ifru.ifru_newname 182 #define ifr_settings ifr_ifru.ifru_settings 183 #if __UAPI_DEF_IF_IFCONF 184 struct ifconf { 185 int ifc_len; 186 union { 187 char * ifcu_buf; 188 struct ifreq * ifcu_req; 189 } ifc_ifcu; 190 }; 191 #endif 192 #define ifc_buf ifc_ifcu.ifcu_buf 193 #define ifc_req ifc_ifcu.ifcu_req 194 #endif 195