blob: 12967f7918e1c5912534c33b3f785a7da1353c1c [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
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 Ferris82ef6a12016-05-19 16:36:40 -070021#include <linux/libc-compat.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070022#include <linux/types.h>
Christopher Ferris82ef6a12016-05-19 16:36:40 -070023#include <linux/socket.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070024#include <linux/compiler.h>
Christopher Ferris525ce912017-07-26 13:12:53 -070025#include <sys/socket.h>
Christopher Ferris82ef6a12016-05-19 16:36:40 -070026#if __UAPI_DEF_IF_IFNAMSIZ
Ben Cheng655a7c02013-10-16 16:09:24 -070027#define IFNAMSIZ 16
Christopher Ferris82ef6a12016-05-19 16:36:40 -070028#endif
Ben Cheng655a7c02013-10-16 16:09:24 -070029#define IFALIASZ 256
Christopher Ferrisd32ca142020-02-04 16:16:51 -080030#define ALTIFNAMSIZ 128
Ben Cheng655a7c02013-10-16 16:09:24 -070031#include <linux/hdlc/ioctl.h>
Christopher Ferris6a9755d2017-01-13 14:09:31 -080032#if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO != 0 || __UAPI_DEF_IF_NET_DEVICE_FLAGS != 0
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070033enum net_device_flags {
Christopher Ferris82ef6a12016-05-19 16:36:40 -070034#if __UAPI_DEF_IF_NET_DEVICE_FLAGS
Elliott Hughes64f355f2017-08-30 16:10:24 -070035 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,
Christopher Ferris82ef6a12016-05-19 16:36:40 -070051#endif
Christopher Ferris82ef6a12016-05-19 16:36:40 -070052#if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO
Elliott Hughes64f355f2017-08-30 16:10:24 -070053 IFF_LOWER_UP = 1 << 16,
54 IFF_DORMANT = 1 << 17,
55 IFF_ECHO = 1 << 18,
Christopher Ferris82ef6a12016-05-19 16:36:40 -070056#endif
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070057};
Christopher Ferris82ef6a12016-05-19 16:36:40 -070058#endif
59#if __UAPI_DEF_IF_NET_DEVICE_FLAGS
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070060#define IFF_UP IFF_UP
61#define IFF_BROADCAST IFF_BROADCAST
Christopher Ferris82ef6a12016-05-19 16:36:40 -070062#define IFF_DEBUG IFF_DEBUG
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070063#define IFF_LOOPBACK IFF_LOOPBACK
64#define IFF_POINTOPOINT IFF_POINTOPOINT
65#define IFF_NOTRAILERS IFF_NOTRAILERS
Christopher Ferris82ef6a12016-05-19 16:36:40 -070066#define IFF_RUNNING IFF_RUNNING
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070067#define IFF_NOARP IFF_NOARP
68#define IFF_PROMISC IFF_PROMISC
69#define IFF_ALLMULTI IFF_ALLMULTI
Christopher Ferris82ef6a12016-05-19 16:36:40 -070070#define IFF_MASTER IFF_MASTER
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070071#define IFF_SLAVE IFF_SLAVE
72#define IFF_MULTICAST IFF_MULTICAST
73#define IFF_PORTSEL IFF_PORTSEL
Christopher Ferris82ef6a12016-05-19 16:36:40 -070074#define IFF_AUTOMEDIA IFF_AUTOMEDIA
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070075#define IFF_DYNAMIC IFF_DYNAMIC
Christopher Ferris82ef6a12016-05-19 16:36:40 -070076#endif
77#if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070078#define IFF_LOWER_UP IFF_LOWER_UP
79#define IFF_DORMANT IFF_DORMANT
80#define IFF_ECHO IFF_ECHO
Christopher Ferris82ef6a12016-05-19 16:36:40 -070081#endif
Tao Baod7db5942015-01-28 10:07:51 -080082#define IFF_VOLATILE (IFF_LOOPBACK | IFF_POINTOPOINT | IFF_BROADCAST | IFF_ECHO | IFF_MASTER | IFF_SLAVE | IFF_RUNNING | IFF_LOWER_UP | IFF_DORMANT)
Ben Cheng655a7c02013-10-16 16:09:24 -070083#define IF_GET_IFACE 0x0001
84#define IF_GET_PROTO 0x0002
Christopher Ferris38062f92014-07-09 15:33:25 -070085#define IF_IFACE_V35 0x1000
Ben Cheng655a7c02013-10-16 16:09:24 -070086#define IF_IFACE_V24 0x1001
87#define IF_IFACE_X21 0x1002
88#define IF_IFACE_T1 0x1003
Christopher Ferris38062f92014-07-09 15:33:25 -070089#define IF_IFACE_E1 0x1004
Ben Cheng655a7c02013-10-16 16:09:24 -070090#define IF_IFACE_SYNC_SERIAL 0x1005
91#define IF_IFACE_X21D 0x1006
92#define IF_PROTO_HDLC 0x2000
Christopher Ferris38062f92014-07-09 15:33:25 -070093#define IF_PROTO_PPP 0x2001
Ben Cheng655a7c02013-10-16 16:09:24 -070094#define IF_PROTO_CISCO 0x2002
95#define IF_PROTO_FR 0x2003
96#define IF_PROTO_FR_ADD_PVC 0x2004
Christopher Ferris38062f92014-07-09 15:33:25 -070097#define IF_PROTO_FR_DEL_PVC 0x2005
Ben Cheng655a7c02013-10-16 16:09:24 -070098#define IF_PROTO_X25 0x2006
99#define IF_PROTO_HDLC_ETH 0x2007
100#define IF_PROTO_FR_ADD_ETH_PVC 0x2008
Christopher Ferris38062f92014-07-09 15:33:25 -0700101#define IF_PROTO_FR_DEL_ETH_PVC 0x2009
Ben Cheng655a7c02013-10-16 16:09:24 -0700102#define IF_PROTO_FR_PVC 0x200A
103#define IF_PROTO_FR_ETH_PVC 0x200B
104#define IF_PROTO_RAW 0x200C
Christopher Ferris38062f92014-07-09 15:33:25 -0700105enum {
Tao Baod7db5942015-01-28 10:07:51 -0800106 IF_OPER_UNKNOWN,
107 IF_OPER_NOTPRESENT,
108 IF_OPER_DOWN,
109 IF_OPER_LOWERLAYERDOWN,
Tao Baod7db5942015-01-28 10:07:51 -0800110 IF_OPER_TESTING,
111 IF_OPER_DORMANT,
112 IF_OPER_UP,
Christopher Ferris38062f92014-07-09 15:33:25 -0700113};
Ben Cheng655a7c02013-10-16 16:09:24 -0700114enum {
Tao Baod7db5942015-01-28 10:07:51 -0800115 IF_LINK_MODE_DEFAULT,
116 IF_LINK_MODE_DORMANT,
Christopher Ferris38062f92014-07-09 15:33:25 -0700117};
Christopher Ferris82ef6a12016-05-19 16:36:40 -0700118#if __UAPI_DEF_IF_IFMAP
Ben Cheng655a7c02013-10-16 16:09:24 -0700119struct ifmap {
Tao Baod7db5942015-01-28 10:07:51 -0800120 unsigned long mem_start;
121 unsigned long mem_end;
Christopher Ferris82ef6a12016-05-19 16:36:40 -0700122 unsigned short base_addr;
Tao Baod7db5942015-01-28 10:07:51 -0800123 unsigned char irq;
124 unsigned char dma;
125 unsigned char port;
Christopher Ferris82ef6a12016-05-19 16:36:40 -0700126};
127#endif
Ben Cheng655a7c02013-10-16 16:09:24 -0700128struct if_settings {
Tao Baod7db5942015-01-28 10:07:51 -0800129 unsigned int type;
130 unsigned int size;
131 union {
Tao Baod7db5942015-01-28 10:07:51 -0800132 raw_hdlc_proto __user * raw_hdlc;
133 cisco_proto __user * cisco;
134 fr_proto __user * fr;
135 fr_proto_pvc __user * fr_pvc;
Tao Baod7db5942015-01-28 10:07:51 -0800136 fr_proto_pvc_info __user * fr_pvc_info;
137 sync_serial_settings __user * sync;
138 te1_settings __user * te1;
139 } ifs_ifsu;
Ben Cheng655a7c02013-10-16 16:09:24 -0700140};
Christopher Ferris82ef6a12016-05-19 16:36:40 -0700141#if __UAPI_DEF_IF_IFREQ
Ben Cheng655a7c02013-10-16 16:09:24 -0700142struct ifreq {
143#define IFHWADDRLEN 6
Tao Baod7db5942015-01-28 10:07:51 -0800144 union {
Tao Baod7db5942015-01-28 10:07:51 -0800145 char ifrn_name[IFNAMSIZ];
146 } ifr_ifrn;
147 union {
148 struct sockaddr ifru_addr;
Tao Baod7db5942015-01-28 10:07:51 -0800149 struct sockaddr ifru_dstaddr;
150 struct sockaddr ifru_broadaddr;
151 struct sockaddr ifru_netmask;
152 struct sockaddr ifru_hwaddr;
Tao Baod7db5942015-01-28 10:07:51 -0800153 short ifru_flags;
154 int ifru_ivalue;
155 int ifru_mtu;
156 struct ifmap ifru_map;
Tao Baod7db5942015-01-28 10:07:51 -0800157 char ifru_slave[IFNAMSIZ];
158 char ifru_newname[IFNAMSIZ];
159 void __user * ifru_data;
160 struct if_settings ifru_settings;
Tao Baod7db5942015-01-28 10:07:51 -0800161 } ifr_ifru;
Ben Cheng655a7c02013-10-16 16:09:24 -0700162};
Christopher Ferris82ef6a12016-05-19 16:36:40 -0700163#endif
Christopher Ferris38062f92014-07-09 15:33:25 -0700164#define ifr_name ifr_ifrn.ifrn_name
Ben Cheng655a7c02013-10-16 16:09:24 -0700165#define ifr_hwaddr ifr_ifru.ifru_hwaddr
166#define ifr_addr ifr_ifru.ifru_addr
167#define ifr_dstaddr ifr_ifru.ifru_dstaddr
Christopher Ferris38062f92014-07-09 15:33:25 -0700168#define ifr_broadaddr ifr_ifru.ifru_broadaddr
Ben Cheng655a7c02013-10-16 16:09:24 -0700169#define ifr_netmask ifr_ifru.ifru_netmask
170#define ifr_flags ifr_ifru.ifru_flags
171#define ifr_metric ifr_ifru.ifru_ivalue
Christopher Ferris38062f92014-07-09 15:33:25 -0700172#define ifr_mtu ifr_ifru.ifru_mtu
Ben Cheng655a7c02013-10-16 16:09:24 -0700173#define ifr_map ifr_ifru.ifru_map
174#define ifr_slave ifr_ifru.ifru_slave
175#define ifr_data ifr_ifru.ifru_data
Christopher Ferris38062f92014-07-09 15:33:25 -0700176#define ifr_ifindex ifr_ifru.ifru_ivalue
Ben Cheng655a7c02013-10-16 16:09:24 -0700177#define ifr_bandwidth ifr_ifru.ifru_ivalue
178#define ifr_qlen ifr_ifru.ifru_ivalue
179#define ifr_newname ifr_ifru.ifru_newname
Christopher Ferris38062f92014-07-09 15:33:25 -0700180#define ifr_settings ifr_ifru.ifru_settings
Christopher Ferris82ef6a12016-05-19 16:36:40 -0700181#if __UAPI_DEF_IF_IFCONF
Christopher Ferris82ef6a12016-05-19 16:36:40 -0700182struct ifconf {
Tao Baod7db5942015-01-28 10:07:51 -0800183 int ifc_len;
184 union {
185 char __user * ifcu_buf;
Christopher Ferris82ef6a12016-05-19 16:36:40 -0700186 struct ifreq __user * ifcu_req;
Tao Baod7db5942015-01-28 10:07:51 -0800187 } ifc_ifcu;
Ben Cheng655a7c02013-10-16 16:09:24 -0700188};
Christopher Ferris82ef6a12016-05-19 16:36:40 -0700189#endif
Christopher Ferris38062f92014-07-09 15:33:25 -0700190#define ifc_buf ifc_ifcu.ifcu_buf
Ben Cheng655a7c02013-10-16 16:09:24 -0700191#define ifc_req ifc_ifcu.ifcu_req
Ben Cheng655a7c02013-10-16 16:09:24 -0700192#endif