blob: 7db4888e7a333f6f2e81b48cad5bf4b778e97bf9 [file] [log] [blame]
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001/****************************************************************************
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 ****************************************************************************
11 ****************************************************************************/
12#ifndef _LINUX_IF_H
13#define _LINUX_IF_H
Ben Cheng4b29af02012-03-07 16:14:53 -080014
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080015#include <linux/types.h>
16#include <linux/socket.h>
17#include <linux/compiler.h>
Ben Cheng4b29af02012-03-07 16:14:53 -080018
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080019#define IFNAMSIZ 16
Dmitry Shmidt2a8245c2010-09-08 11:32:16 -070020#define IFALIASZ 256
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080021#include <linux/hdlc/ioctl.h>
Ben Cheng4b29af02012-03-07 16:14:53 -080022
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080023#define IFF_UP 0x1
24#define IFF_BROADCAST 0x2
25#define IFF_DEBUG 0x4
26#define IFF_LOOPBACK 0x8
27#define IFF_POINTOPOINT 0x10
28#define IFF_NOTRAILERS 0x20
29#define IFF_RUNNING 0x40
30#define IFF_NOARP 0x80
31#define IFF_PROMISC 0x100
32#define IFF_ALLMULTI 0x200
Ben Cheng4b29af02012-03-07 16:14:53 -080033
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080034#define IFF_MASTER 0x400
35#define IFF_SLAVE 0x800
Ben Cheng4b29af02012-03-07 16:14:53 -080036
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080037#define IFF_MULTICAST 0x1000
Ben Cheng4b29af02012-03-07 16:14:53 -080038
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080039#define IFF_PORTSEL 0x2000
40#define IFF_AUTOMEDIA 0x4000
41#define IFF_DYNAMIC 0x8000
Ben Cheng4b29af02012-03-07 16:14:53 -080042
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080043#define IFF_LOWER_UP 0x10000
44#define IFF_DORMANT 0x20000
Ben Cheng4b29af02012-03-07 16:14:53 -080045
Dmitry Shmidt2a8245c2010-09-08 11:32:16 -070046#define IFF_ECHO 0x40000
Ben Cheng4b29af02012-03-07 16:14:53 -080047
Dmitry Shmidt2a8245c2010-09-08 11:32:16 -070048#define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_ECHO| IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT)
Ben Cheng4b29af02012-03-07 16:14:53 -080049
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080050#define IFF_802_1Q_VLAN 0x1
51#define IFF_EBRIDGE 0x2
52#define IFF_SLAVE_INACTIVE 0x4
53#define IFF_MASTER_8023AD 0x8
54#define IFF_MASTER_ALB 0x10
Dmitry Shmidt2a8245c2010-09-08 11:32:16 -070055#define IFF_BONDING 0x20
56#define IFF_SLAVE_NEEDARP 0x40
57#define IFF_ISATAP 0x80
58#define IFF_MASTER_ARPMON 0x100
59#define IFF_WAN_HDLC 0x200
60#define IFF_XMIT_DST_RELEASE 0x400
61#define IFF_DONT_BRIDGE 0x800
62#define IFF_IN_NETPOLL 0x1000
63#define IFF_DISABLE_NETPOLL 0x2000
Ben Cheng4b29af02012-03-07 16:14:53 -080064
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080065#define IF_GET_IFACE 0x0001
66#define IF_GET_PROTO 0x0002
Ben Cheng4b29af02012-03-07 16:14:53 -080067
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080068#define IF_IFACE_V35 0x1000
69#define IF_IFACE_V24 0x1001
70#define IF_IFACE_X21 0x1002
71#define IF_IFACE_T1 0x1003
72#define IF_IFACE_E1 0x1004
73#define IF_IFACE_SYNC_SERIAL 0x1005
74#define IF_IFACE_X21D 0x1006
Ben Cheng4b29af02012-03-07 16:14:53 -080075
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080076#define IF_PROTO_HDLC 0x2000
77#define IF_PROTO_PPP 0x2001
78#define IF_PROTO_CISCO 0x2002
79#define IF_PROTO_FR 0x2003
80#define IF_PROTO_FR_ADD_PVC 0x2004
81#define IF_PROTO_FR_DEL_PVC 0x2005
82#define IF_PROTO_X25 0x2006
83#define IF_PROTO_HDLC_ETH 0x2007
84#define IF_PROTO_FR_ADD_ETH_PVC 0x2008
85#define IF_PROTO_FR_DEL_ETH_PVC 0x2009
86#define IF_PROTO_FR_PVC 0x200A
87#define IF_PROTO_FR_ETH_PVC 0x200B
88#define IF_PROTO_RAW 0x200C
Ben Cheng4b29af02012-03-07 16:14:53 -080089
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080090enum {
91 IF_OPER_UNKNOWN,
92 IF_OPER_NOTPRESENT,
93 IF_OPER_DOWN,
94 IF_OPER_LOWERLAYERDOWN,
95 IF_OPER_TESTING,
96 IF_OPER_DORMANT,
97 IF_OPER_UP,
98};
Ben Cheng4b29af02012-03-07 16:14:53 -080099
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800100enum {
101 IF_LINK_MODE_DEFAULT,
102 IF_LINK_MODE_DORMANT,
103};
Ben Cheng4b29af02012-03-07 16:14:53 -0800104
Dmitry Shmidt2a8245c2010-09-08 11:32:16 -0700105struct ifmap {
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800106 unsigned long mem_start;
107 unsigned long mem_end;
108 unsigned short base_addr;
109 unsigned char irq;
110 unsigned char dma;
111 unsigned char port;
Ben Cheng4b29af02012-03-07 16:14:53 -0800112
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800113};
Ben Cheng4b29af02012-03-07 16:14:53 -0800114
Dmitry Shmidt2a8245c2010-09-08 11:32:16 -0700115struct if_settings {
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800116 unsigned int type;
117 unsigned int size;
118 union {
Ben Cheng4b29af02012-03-07 16:14:53 -0800119
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800120 raw_hdlc_proto __user *raw_hdlc;
121 cisco_proto __user *cisco;
122 fr_proto __user *fr;
123 fr_proto_pvc __user *fr_pvc;
124 fr_proto_pvc_info __user *fr_pvc_info;
Ben Cheng4b29af02012-03-07 16:14:53 -0800125
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800126 sync_serial_settings __user *sync;
127 te1_settings __user *te1;
128 } ifs_ifsu;
129};
Ben Cheng4b29af02012-03-07 16:14:53 -0800130
Dmitry Shmidt2a8245c2010-09-08 11:32:16 -0700131struct ifreq {
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800132#define IFHWADDRLEN 6
133 union
134 {
135 char ifrn_name[IFNAMSIZ];
136 } ifr_ifrn;
Ben Cheng4b29af02012-03-07 16:14:53 -0800137
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800138 union {
139 struct sockaddr ifru_addr;
140 struct sockaddr ifru_dstaddr;
141 struct sockaddr ifru_broadaddr;
142 struct sockaddr ifru_netmask;
143 struct sockaddr ifru_hwaddr;
144 short ifru_flags;
145 int ifru_ivalue;
146 int ifru_mtu;
147 struct ifmap ifru_map;
148 char ifru_slave[IFNAMSIZ];
149 char ifru_newname[IFNAMSIZ];
150 void __user * ifru_data;
151 struct if_settings ifru_settings;
152 } ifr_ifru;
153};
Ben Cheng4b29af02012-03-07 16:14:53 -0800154
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800155#define ifr_name ifr_ifrn.ifrn_name
156#define ifr_hwaddr ifr_ifru.ifru_hwaddr
157#define ifr_addr ifr_ifru.ifru_addr
158#define ifr_dstaddr ifr_ifru.ifru_dstaddr
159#define ifr_broadaddr ifr_ifru.ifru_broadaddr
160#define ifr_netmask ifr_ifru.ifru_netmask
161#define ifr_flags ifr_ifru.ifru_flags
162#define ifr_metric ifr_ifru.ifru_ivalue
163#define ifr_mtu ifr_ifru.ifru_mtu
164#define ifr_map ifr_ifru.ifru_map
165#define ifr_slave ifr_ifru.ifru_slave
166#define ifr_data ifr_ifru.ifru_data
167#define ifr_ifindex ifr_ifru.ifru_ivalue
168#define ifr_bandwidth ifr_ifru.ifru_ivalue
169#define ifr_qlen ifr_ifru.ifru_ivalue
170#define ifr_newname ifr_ifru.ifru_newname
171#define ifr_settings ifr_ifru.ifru_settings
Ben Cheng4b29af02012-03-07 16:14:53 -0800172
Dmitry Shmidt2a8245c2010-09-08 11:32:16 -0700173struct ifconf {
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800174 int ifc_len;
Dmitry Shmidt2a8245c2010-09-08 11:32:16 -0700175 union {
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800176 char __user *ifcu_buf;
177 struct ifreq __user *ifcu_req;
178 } ifc_ifcu;
179};
180#define ifc_buf ifc_ifcu.ifcu_buf
181#define ifc_req ifc_ifcu.ifcu_req
Ben Cheng4b29af02012-03-07 16:14:53 -0800182
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800183#endif
Ben Cheng4b29af02012-03-07 16:14:53 -0800184