@@ -21,32 +21,21 @@ pub fn if_nametoindex<P: ?Sized + NixPath>(name: &P) -> Result<c_uint> {
21
21
libc_bitflags ! (
22
22
/// Standard interface flags, used by `getifaddrs`
23
23
pub struct InterfaceFlags : libc:: c_int {
24
- // bitmask: 0x01
25
24
/// Interface is running. (see
26
25
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
27
26
IFF_UP ;
28
-
29
- // bitmask: 0x02
30
27
/// Valid broadcast address set. (see
31
28
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
32
29
IFF_BROADCAST ;
33
-
34
- // bitmask: 0x04
35
30
/// Internal debugging flag. (see
36
31
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
37
32
IFF_DEBUG ;
38
-
39
- // bitmask: 0x08
40
33
/// Interface is a loopback interface. (see
41
34
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
42
35
IFF_LOOPBACK ;
43
-
44
- // bitmask: 0x10
45
36
/// Interface is a point-to-point link. (see
46
37
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
47
38
IFF_POINTOPOINT ;
48
-
49
- // bitmask: 0x20
50
39
/// Avoid use of trailers. (see
51
40
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
52
41
#[ cfg( any( target_os = "android" ,
@@ -61,8 +50,6 @@ libc_bitflags!(
61
50
/// Interface manages own routes.
62
51
#[ cfg( any( target_os = "dragonfly" ) ) ]
63
52
IFF_SMART ;
64
-
65
- // bitmask: 0x40
66
53
/// Resources allocated. (see
67
54
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
68
55
#[ cfg( any( target_os = "android" ,
@@ -76,23 +63,15 @@ libc_bitflags!(
76
63
target_os = "openbsd" ,
77
64
target_os = "solaris" ) ) ]
78
65
IFF_RUNNING ;
79
-
80
- // bitmask: 0x80
81
66
/// No arp protocol, L2 destination address not set. (see
82
67
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
83
68
IFF_NOARP ;
84
-
85
- // bitmask: 0x0100
86
69
/// Interface is in promiscuous mode. (see
87
70
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
88
71
IFF_PROMISC ;
89
-
90
- // bitmask: 0x0200
91
72
/// Receive all multicast packets. (see
92
73
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
93
74
IFF_ALLMULTI ;
94
-
95
- // bitmask: 0x0400
96
75
/// Master of a load balancing bundle. (see
97
76
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
98
77
#[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" ) ) ]
@@ -107,8 +86,6 @@ libc_bitflags!(
107
86
/// Protocol code on board.
108
87
#[ cfg( target_os = "solaris" ) ]
109
88
IFF_INTELLIGENT ;
110
-
111
- // bitmask: 0x0800
112
89
/// Slave of a load balancing bundle. (see
113
90
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
114
91
#[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" ) ) ]
@@ -121,15 +98,9 @@ libc_bitflags!(
121
98
target_os = "openbsd" ,
122
99
target_os = "osx" ) ) ]
123
100
IFF_SIMPLEX ;
124
-
125
- // This has bitmask: 0x1000 on android, fuchsia, and linux
126
- // but 0x0800 on solaris
127
- // and 0x8000 on dragonfly, macos, netbsd, openbsd, and ios
128
101
/// Supports multicast. (see
129
102
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
130
103
IFF_MULTICAST ;
131
-
132
- // bitmask: 0x1000
133
104
/// Per link layer defined bit.
134
105
#[ cfg( any( target_os = "dragonfly" ,
135
106
target_os = "freebsd" ,
@@ -141,8 +112,6 @@ libc_bitflags!(
141
112
/// Multicast using broadcast.
142
113
#[ cfg( any( target_os = "solaris" ) ) ]
143
114
IFF_MULTI_BCAST ;
144
-
145
- // bitmask: 0x2000
146
115
/// Is able to select media type via ifmap. (see
147
116
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
148
117
#[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" ) ) ]
@@ -158,8 +127,6 @@ libc_bitflags!(
158
127
/// Non-unique address.
159
128
#[ cfg( any( target_os = "solaris" ) ) ]
160
129
IFF_UNNUMBERED ;
161
-
162
- // bitmask: 0x4000
163
130
/// Auto media selection active. (see
164
131
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
165
132
#[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" ) ) ]
@@ -181,17 +148,13 @@ libc_bitflags!(
181
148
/// DHCP controlls interface.
182
149
#[ cfg( any( target_os = "solaris" ) ) ]
183
150
IFF_DHCPRUNNING ;
184
-
185
- // bitmask: 0x8000
186
151
/// The addresses are lost when the interface goes down. (see
187
152
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
188
153
#[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" ) ) ]
189
154
IFF_DYNAMIC ;
190
155
/// Do not advertise.
191
156
#[ cfg( any( target_os = "solaris" ) ) ]
192
157
IFF_PRIVATE ;
193
-
194
- // bitmask: 0x010000
195
158
/// Driver signals L1 up. Volatile.
196
159
#[ cfg( any( target_os = "fuchsia" , target_os = "linux" ) ) ]
197
160
IFF_LOWER_UP ;
@@ -204,8 +167,6 @@ libc_bitflags!(
204
167
/// Do not transmit packets.
205
168
#[ cfg( any( target_os = "solaris" ) ) ]
206
169
IFF_NOXMIT ;
207
-
208
- // bitmask: 0x020000
209
170
/// Driver signals dormant. Volatile.
210
171
#[ cfg( any( target_os = "fuchsia" , target_os = "linux" ) ) ]
211
172
IFF_DORMANT ;
@@ -215,8 +176,6 @@ libc_bitflags!(
215
176
/// Just on-link subnet.
216
177
#[ cfg( any( target_os = "solaris" ) ) ]
217
178
IFF_NOLOCAL ;
218
-
219
- // bitmask: 0x040000
220
179
/// Echo sent packets. Volatile.
221
180
#[ cfg( any( target_os = "fuchsia" , target_os = "linux" ) ) ]
222
181
IFF_ECHO ;
@@ -226,24 +185,18 @@ libc_bitflags!(
226
185
/// Address is deprecated.
227
186
#[ cfg( any( target_os = "solaris" ) ) ]
228
187
IFF_DEPRECATED ;
229
-
230
- // bitmask: 0x080000
231
188
/// Static ARP.
232
189
#[ cfg( any( target_os = "dragonfly" , target_os = "freebsd" ) ) ]
233
190
IFF_STATICARP ;
234
191
/// Address from stateless addrconf.
235
192
#[ cfg( any( target_os = "solaris" ) ) ]
236
193
IFF_ADDRCONF ;
237
-
238
- // bitmask: 0x100000
239
194
/// Interface is in polling mode.
240
195
#[ cfg( any( target_os = "dragonfly" ) ) ]
241
196
IFF_NPOLLING ;
242
197
/// Router on interface.
243
198
#[ cfg( any( target_os = "solaris" ) ) ]
244
199
IFF_ROUTER ;
245
-
246
- // bitmask: 0x200000
247
200
/// Interface is in polling mode.
248
201
#[ cfg( any( target_os = "dragonfly" ) ) ]
249
202
IFF_IDIRECT ;
@@ -253,85 +206,53 @@ libc_bitflags!(
253
206
/// No NUD on interface.
254
207
#[ cfg( any( target_os = "solaris" ) ) ]
255
208
IFF_NONUD ;
256
-
257
- // bitmask: 0x400000
258
209
/// Interface is being renamed
259
210
#[ cfg( any( target_os = "freebsd" ) ) ]
260
211
IFF_RENAMING ;
261
212
/// Anycast address.
262
213
#[ cfg( any( target_os = "solaris" ) ) ]
263
214
IFF_ANYCAST ;
264
-
265
- // bitmask: 0x800000
266
215
/// Don't exchange routing info.
267
216
#[ cfg( any( target_os = "solaris" ) ) ]
268
217
IFF_NORTEXCH ;
269
-
270
- // bitmask: 0x01000000
271
218
/// IPv4 interface.
272
219
#[ cfg( any( target_os = "solaris" ) ) ]
273
220
IFF_IPV4 ;
274
-
275
- // bitmask: 0x02000000
276
221
/// IPv6 interface.
277
222
#[ cfg( any( target_os = "solaris" ) ) ]
278
223
IFF_IPV6 ;
279
-
280
- // bitmask: 0x08000000
281
224
/// in.mpathd test address
282
225
#[ cfg( any( target_os = "solaris" ) ) ]
283
226
IFF_NOFAILOVER ;
284
-
285
- // bitmask: 0x10000000
286
227
/// Interface has failed
287
228
#[ cfg( any( target_os = "solaris" ) ) ]
288
229
IFF_FAILED ;
289
-
290
- // bitmask: 0x20000000
291
230
/// Interface is a hot-spare
292
231
#[ cfg( any( target_os = "solaris" ) ) ]
293
232
IFF_STANDBY ;
294
-
295
- // bitmask: 0x40000000
296
233
/// Functioning but not used
297
234
#[ cfg( any( target_os = "solaris" ) ) ]
298
235
IFF_INACTIVE ;
299
-
300
- // bitmask: 0x80000000
301
236
/// Interface is offline
302
237
#[ cfg( any( target_os = "solaris" ) ) ]
303
238
IFF_OFFLINE ;
304
-
305
- // bitmask: 0x0200000000
306
239
#[ cfg( any( target_os = "solaris" ) ) ]
307
240
IFF_COS_ENABLED ;
308
-
309
- // bitmask: 0x0400000000
310
241
/// Prefer as source addr.
311
242
#[ cfg( any( target_os = "solaris" ) ) ]
312
243
IFF_PREFERRED ;
313
-
314
- // bitmask: 0x0800000000
315
244
/// RFC3041
316
245
#[ cfg( any( target_os = "solaris" ) ) ]
317
246
IFF_TEMPORARY ;
318
-
319
- // bitmask: 0x1000000000
320
247
/// MTU set with SIOCSLIFMTU
321
248
#[ cfg( any( target_os = "solaris" ) ) ]
322
249
IFF_FIXEDMTU ;
323
-
324
- // bitmask: 0x2000000000
325
250
/// Cannot send / receive packets
326
251
#[ cfg( any( target_os = "solaris" ) ) ]
327
252
IFF_VIRTUAL ;
328
-
329
- // bitmask: 0x4000000000
330
253
/// Local address in use
331
254
#[ cfg( any( target_os = "solaris" ) ) ]
332
255
IFF_DUPLICATE ;
333
-
334
- // bitmask: 0x8000000000
335
256
/// IPMP IP interface
336
257
#[ cfg( any( target_os = "solaris" ) ) ]
337
258
IFF_IPMP ;
0 commit comments