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