• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  ****************************************************************************
11  ****************************************************************************/
12 #ifndef _LINUX_IF_H
13 #define _LINUX_IF_H
14 
15 #include <linux/types.h>
16 #include <linux/socket.h>
17 #include <linux/compiler.h>
18 
19 #define IFNAMSIZ 16
20 #define IFALIASZ 256
21 #include <linux/hdlc/ioctl.h>
22 
23 #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
33 
34 #define IFF_MASTER 0x400
35 #define IFF_SLAVE 0x800
36 
37 #define IFF_MULTICAST 0x1000
38 
39 #define IFF_PORTSEL 0x2000
40 #define IFF_AUTOMEDIA 0x4000
41 #define IFF_DYNAMIC 0x8000
42 
43 #define IFF_LOWER_UP 0x10000
44 #define IFF_DORMANT 0x20000
45 
46 #define IFF_ECHO 0x40000
47 
48 #define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_ECHO|  IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT)
49 
50 #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
55 #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
64 
65 #define IF_GET_IFACE 0x0001
66 #define IF_GET_PROTO 0x0002
67 
68 #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
75 
76 #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
89 
90 enum {
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 };
99 
100 enum {
101  IF_LINK_MODE_DEFAULT,
102  IF_LINK_MODE_DORMANT,
103 };
104 
105 struct ifmap {
106  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;
112 
113 };
114 
115 struct if_settings {
116  unsigned int type;
117  unsigned int size;
118  union {
119 
120  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;
125 
126  sync_serial_settings __user *sync;
127  te1_settings __user *te1;
128  } ifs_ifsu;
129 };
130 
131 struct ifreq {
132 #define IFHWADDRLEN 6
133  union
134  {
135  char ifrn_name[IFNAMSIZ];
136  } ifr_ifrn;
137 
138  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 };
154 
155 #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
172 
173 struct ifconf {
174  int ifc_len;
175  union {
176  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
182 
183 #endif
184 
185