blob: 15207e2f906930d6cc13b17aa0a7357eee514801 [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 Ferris82ef6a12016-05-19 16:36:40 -070025#if __UAPI_DEF_IF_IFNAMSIZ
Ben Cheng655a7c02013-10-16 16:09:24 -070026#define IFNAMSIZ 16
Christopher Ferris82ef6a12016-05-19 16:36:40 -070027#endif
Ben Cheng655a7c02013-10-16 16:09:24 -070028#define IFALIASZ 256
29#include <linux/hdlc/ioctl.h>
Christopher Ferris6a9755d2017-01-13 14:09:31 -080030#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 -070031enum net_device_flags {
Christopher Ferris82ef6a12016-05-19 16:36:40 -070032#if __UAPI_DEF_IF_NET_DEVICE_FLAGS
33 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,
34#endif
Christopher Ferris82ef6a12016-05-19 16:36:40 -070035#if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO
36 IFF_LOWER_UP = 1 << 16, IFF_DORMANT = 1 << 17, IFF_ECHO = 1 << 18,
37#endif
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070038};
Christopher Ferris82ef6a12016-05-19 16:36:40 -070039#endif
40#if __UAPI_DEF_IF_NET_DEVICE_FLAGS
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070041#define IFF_UP IFF_UP
42#define IFF_BROADCAST IFF_BROADCAST
Christopher Ferris82ef6a12016-05-19 16:36:40 -070043#define IFF_DEBUG IFF_DEBUG
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070044#define IFF_LOOPBACK IFF_LOOPBACK
45#define IFF_POINTOPOINT IFF_POINTOPOINT
46#define IFF_NOTRAILERS IFF_NOTRAILERS
Christopher Ferris82ef6a12016-05-19 16:36:40 -070047#define IFF_RUNNING IFF_RUNNING
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070048#define IFF_NOARP IFF_NOARP
49#define IFF_PROMISC IFF_PROMISC
50#define IFF_ALLMULTI IFF_ALLMULTI
Christopher Ferris82ef6a12016-05-19 16:36:40 -070051#define IFF_MASTER IFF_MASTER
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070052#define IFF_SLAVE IFF_SLAVE
53#define IFF_MULTICAST IFF_MULTICAST
54#define IFF_PORTSEL IFF_PORTSEL
Christopher Ferris82ef6a12016-05-19 16:36:40 -070055#define IFF_AUTOMEDIA IFF_AUTOMEDIA
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070056#define IFF_DYNAMIC IFF_DYNAMIC
Christopher Ferris82ef6a12016-05-19 16:36:40 -070057#endif
58#if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070059#define IFF_LOWER_UP IFF_LOWER_UP
60#define IFF_DORMANT IFF_DORMANT
61#define IFF_ECHO IFF_ECHO
Christopher Ferris82ef6a12016-05-19 16:36:40 -070062#endif
Tao Baod7db5942015-01-28 10:07:51 -080063#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 -070064#define IF_GET_IFACE 0x0001
65#define IF_GET_PROTO 0x0002
Christopher Ferris38062f92014-07-09 15:33:25 -070066#define IF_IFACE_V35 0x1000
Ben Cheng655a7c02013-10-16 16:09:24 -070067#define IF_IFACE_V24 0x1001
68#define IF_IFACE_X21 0x1002
69#define IF_IFACE_T1 0x1003
Christopher Ferris38062f92014-07-09 15:33:25 -070070#define IF_IFACE_E1 0x1004
Ben Cheng655a7c02013-10-16 16:09:24 -070071#define IF_IFACE_SYNC_SERIAL 0x1005
72#define IF_IFACE_X21D 0x1006
73#define IF_PROTO_HDLC 0x2000
Christopher Ferris38062f92014-07-09 15:33:25 -070074#define IF_PROTO_PPP 0x2001
Ben Cheng655a7c02013-10-16 16:09:24 -070075#define IF_PROTO_CISCO 0x2002
76#define IF_PROTO_FR 0x2003
77#define IF_PROTO_FR_ADD_PVC 0x2004
Christopher Ferris38062f92014-07-09 15:33:25 -070078#define IF_PROTO_FR_DEL_PVC 0x2005
Ben Cheng655a7c02013-10-16 16:09:24 -070079#define IF_PROTO_X25 0x2006
80#define IF_PROTO_HDLC_ETH 0x2007
81#define IF_PROTO_FR_ADD_ETH_PVC 0x2008
Christopher Ferris38062f92014-07-09 15:33:25 -070082#define IF_PROTO_FR_DEL_ETH_PVC 0x2009
Ben Cheng655a7c02013-10-16 16:09:24 -070083#define IF_PROTO_FR_PVC 0x200A
84#define IF_PROTO_FR_ETH_PVC 0x200B
85#define IF_PROTO_RAW 0x200C
Christopher Ferris38062f92014-07-09 15:33:25 -070086enum {
Tao Baod7db5942015-01-28 10:07:51 -080087 IF_OPER_UNKNOWN,
88 IF_OPER_NOTPRESENT,
89 IF_OPER_DOWN,
90 IF_OPER_LOWERLAYERDOWN,
Tao Baod7db5942015-01-28 10:07:51 -080091 IF_OPER_TESTING,
92 IF_OPER_DORMANT,
93 IF_OPER_UP,
Christopher Ferris38062f92014-07-09 15:33:25 -070094};
Ben Cheng655a7c02013-10-16 16:09:24 -070095enum {
Tao Baod7db5942015-01-28 10:07:51 -080096 IF_LINK_MODE_DEFAULT,
97 IF_LINK_MODE_DORMANT,
Christopher Ferris38062f92014-07-09 15:33:25 -070098};
Christopher Ferris82ef6a12016-05-19 16:36:40 -070099#if __UAPI_DEF_IF_IFMAP
Ben Cheng655a7c02013-10-16 16:09:24 -0700100struct ifmap {
Tao Baod7db5942015-01-28 10:07:51 -0800101 unsigned long mem_start;
102 unsigned long mem_end;
Christopher Ferris82ef6a12016-05-19 16:36:40 -0700103 unsigned short base_addr;
Tao Baod7db5942015-01-28 10:07:51 -0800104 unsigned char irq;
105 unsigned char dma;
106 unsigned char port;
Christopher Ferris82ef6a12016-05-19 16:36:40 -0700107};
108#endif
Ben Cheng655a7c02013-10-16 16:09:24 -0700109struct if_settings {
Tao Baod7db5942015-01-28 10:07:51 -0800110 unsigned int type;
111 unsigned int size;
112 union {
Tao Baod7db5942015-01-28 10:07:51 -0800113 raw_hdlc_proto __user * raw_hdlc;
114 cisco_proto __user * cisco;
115 fr_proto __user * fr;
116 fr_proto_pvc __user * fr_pvc;
Tao Baod7db5942015-01-28 10:07:51 -0800117 fr_proto_pvc_info __user * fr_pvc_info;
118 sync_serial_settings __user * sync;
119 te1_settings __user * te1;
120 } ifs_ifsu;
Ben Cheng655a7c02013-10-16 16:09:24 -0700121};
Christopher Ferris82ef6a12016-05-19 16:36:40 -0700122#if __UAPI_DEF_IF_IFREQ
Ben Cheng655a7c02013-10-16 16:09:24 -0700123struct ifreq {
124#define IFHWADDRLEN 6
Tao Baod7db5942015-01-28 10:07:51 -0800125 union {
Tao Baod7db5942015-01-28 10:07:51 -0800126 char ifrn_name[IFNAMSIZ];
127 } ifr_ifrn;
128 union {
129 struct sockaddr ifru_addr;
Tao Baod7db5942015-01-28 10:07:51 -0800130 struct sockaddr ifru_dstaddr;
131 struct sockaddr ifru_broadaddr;
132 struct sockaddr ifru_netmask;
133 struct sockaddr ifru_hwaddr;
Tao Baod7db5942015-01-28 10:07:51 -0800134 short ifru_flags;
135 int ifru_ivalue;
136 int ifru_mtu;
137 struct ifmap ifru_map;
Tao Baod7db5942015-01-28 10:07:51 -0800138 char ifru_slave[IFNAMSIZ];
139 char ifru_newname[IFNAMSIZ];
140 void __user * ifru_data;
141 struct if_settings ifru_settings;
Tao Baod7db5942015-01-28 10:07:51 -0800142 } ifr_ifru;
Ben Cheng655a7c02013-10-16 16:09:24 -0700143};
Christopher Ferris82ef6a12016-05-19 16:36:40 -0700144#endif
Christopher Ferris38062f92014-07-09 15:33:25 -0700145#define ifr_name ifr_ifrn.ifrn_name
Ben Cheng655a7c02013-10-16 16:09:24 -0700146#define ifr_hwaddr ifr_ifru.ifru_hwaddr
147#define ifr_addr ifr_ifru.ifru_addr
148#define ifr_dstaddr ifr_ifru.ifru_dstaddr
Christopher Ferris38062f92014-07-09 15:33:25 -0700149#define ifr_broadaddr ifr_ifru.ifru_broadaddr
Ben Cheng655a7c02013-10-16 16:09:24 -0700150#define ifr_netmask ifr_ifru.ifru_netmask
151#define ifr_flags ifr_ifru.ifru_flags
152#define ifr_metric ifr_ifru.ifru_ivalue
Christopher Ferris38062f92014-07-09 15:33:25 -0700153#define ifr_mtu ifr_ifru.ifru_mtu
Ben Cheng655a7c02013-10-16 16:09:24 -0700154#define ifr_map ifr_ifru.ifru_map
155#define ifr_slave ifr_ifru.ifru_slave
156#define ifr_data ifr_ifru.ifru_data
Christopher Ferris38062f92014-07-09 15:33:25 -0700157#define ifr_ifindex ifr_ifru.ifru_ivalue
Ben Cheng655a7c02013-10-16 16:09:24 -0700158#define ifr_bandwidth ifr_ifru.ifru_ivalue
159#define ifr_qlen ifr_ifru.ifru_ivalue
160#define ifr_newname ifr_ifru.ifru_newname
Christopher Ferris38062f92014-07-09 15:33:25 -0700161#define ifr_settings ifr_ifru.ifru_settings
Christopher Ferris82ef6a12016-05-19 16:36:40 -0700162#if __UAPI_DEF_IF_IFCONF
Christopher Ferris82ef6a12016-05-19 16:36:40 -0700163struct ifconf {
Tao Baod7db5942015-01-28 10:07:51 -0800164 int ifc_len;
165 union {
166 char __user * ifcu_buf;
Christopher Ferris82ef6a12016-05-19 16:36:40 -0700167 struct ifreq __user * ifcu_req;
Tao Baod7db5942015-01-28 10:07:51 -0800168 } ifc_ifcu;
Ben Cheng655a7c02013-10-16 16:09:24 -0700169};
Christopher Ferris82ef6a12016-05-19 16:36:40 -0700170#endif
Christopher Ferris38062f92014-07-09 15:33:25 -0700171#define ifc_buf ifc_ifcu.ifcu_buf
Ben Cheng655a7c02013-10-16 16:09:24 -0700172#define ifc_req ifc_ifcu.ifcu_req
Ben Cheng655a7c02013-10-16 16:09:24 -0700173#endif