Skip to content

Commit e200bc4

Browse files
committed
Drop the bitmask info and the grouping of IFF_* constants.
1 parent a4c7214 commit e200bc4

File tree

1 file changed

+0
-79
lines changed

1 file changed

+0
-79
lines changed

src/net/if_.rs

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,21 @@ pub fn if_nametoindex<P: ?Sized + NixPath>(name: &P) -> Result<c_uint> {
2121
libc_bitflags!(
2222
/// Standard interface flags, used by `getifaddrs`
2323
pub struct InterfaceFlags: libc::c_int {
24-
// bitmask: 0x01
2524
/// Interface is running. (see
2625
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
2726
IFF_UP;
28-
29-
// bitmask: 0x02
3027
/// Valid broadcast address set. (see
3128
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
3229
IFF_BROADCAST;
33-
34-
// bitmask: 0x04
3530
/// Internal debugging flag. (see
3631
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
3732
IFF_DEBUG;
38-
39-
// bitmask: 0x08
4033
/// Interface is a loopback interface. (see
4134
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
4235
IFF_LOOPBACK;
43-
44-
// bitmask: 0x10
4536
/// Interface is a point-to-point link. (see
4637
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
4738
IFF_POINTOPOINT;
48-
49-
// bitmask: 0x20
5039
/// Avoid use of trailers. (see
5140
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
5241
#[cfg(any(target_os = "android",
@@ -61,8 +50,6 @@ libc_bitflags!(
6150
/// Interface manages own routes.
6251
#[cfg(any(target_os = "dragonfly"))]
6352
IFF_SMART;
64-
65-
// bitmask: 0x40
6653
/// Resources allocated. (see
6754
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
6855
#[cfg(any(target_os = "android",
@@ -76,23 +63,15 @@ libc_bitflags!(
7663
target_os = "openbsd",
7764
target_os = "solaris"))]
7865
IFF_RUNNING;
79-
80-
// bitmask: 0x80
8166
/// No arp protocol, L2 destination address not set. (see
8267
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
8368
IFF_NOARP;
84-
85-
// bitmask: 0x0100
8669
/// Interface is in promiscuous mode. (see
8770
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
8871
IFF_PROMISC;
89-
90-
// bitmask: 0x0200
9172
/// Receive all multicast packets. (see
9273
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
9374
IFF_ALLMULTI;
94-
95-
// bitmask: 0x0400
9675
/// Master of a load balancing bundle. (see
9776
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
9877
#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))]
@@ -107,8 +86,6 @@ libc_bitflags!(
10786
/// Protocol code on board.
10887
#[cfg(target_os = "solaris")]
10988
IFF_INTELLIGENT;
110-
111-
// bitmask: 0x0800
11289
/// Slave of a load balancing bundle. (see
11390
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
11491
#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))]
@@ -121,15 +98,9 @@ libc_bitflags!(
12198
target_os = "openbsd",
12299
target_os = "osx"))]
123100
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
128101
/// Supports multicast. (see
129102
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
130103
IFF_MULTICAST;
131-
132-
// bitmask: 0x1000
133104
/// Per link layer defined bit.
134105
#[cfg(any(target_os = "dragonfly",
135106
target_os = "freebsd",
@@ -141,8 +112,6 @@ libc_bitflags!(
141112
/// Multicast using broadcast.
142113
#[cfg(any(target_os = "solaris"))]
143114
IFF_MULTI_BCAST;
144-
145-
// bitmask: 0x2000
146115
/// Is able to select media type via ifmap. (see
147116
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
148117
#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))]
@@ -158,8 +127,6 @@ libc_bitflags!(
158127
/// Non-unique address.
159128
#[cfg(any(target_os = "solaris"))]
160129
IFF_UNNUMBERED;
161-
162-
// bitmask: 0x4000
163130
/// Auto media selection active. (see
164131
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
165132
#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))]
@@ -181,17 +148,13 @@ libc_bitflags!(
181148
/// DHCP controlls interface.
182149
#[cfg(any(target_os = "solaris"))]
183150
IFF_DHCPRUNNING;
184-
185-
// bitmask: 0x8000
186151
/// The addresses are lost when the interface goes down. (see
187152
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
188153
#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))]
189154
IFF_DYNAMIC;
190155
/// Do not advertise.
191156
#[cfg(any(target_os = "solaris"))]
192157
IFF_PRIVATE;
193-
194-
// bitmask: 0x010000
195158
/// Driver signals L1 up. Volatile.
196159
#[cfg(any(target_os = "fuchsia", target_os = "linux"))]
197160
IFF_LOWER_UP;
@@ -204,8 +167,6 @@ libc_bitflags!(
204167
/// Do not transmit packets.
205168
#[cfg(any(target_os = "solaris"))]
206169
IFF_NOXMIT;
207-
208-
// bitmask: 0x020000
209170
/// Driver signals dormant. Volatile.
210171
#[cfg(any(target_os = "fuchsia", target_os = "linux"))]
211172
IFF_DORMANT;
@@ -215,8 +176,6 @@ libc_bitflags!(
215176
/// Just on-link subnet.
216177
#[cfg(any(target_os = "solaris"))]
217178
IFF_NOLOCAL;
218-
219-
// bitmask: 0x040000
220179
/// Echo sent packets. Volatile.
221180
#[cfg(any(target_os = "fuchsia", target_os = "linux"))]
222181
IFF_ECHO;
@@ -226,24 +185,18 @@ libc_bitflags!(
226185
/// Address is deprecated.
227186
#[cfg(any(target_os = "solaris"))]
228187
IFF_DEPRECATED;
229-
230-
// bitmask: 0x080000
231188
/// Static ARP.
232189
#[cfg(any(target_os = "dragonfly", target_os = "freebsd"))]
233190
IFF_STATICARP;
234191
/// Address from stateless addrconf.
235192
#[cfg(any(target_os = "solaris"))]
236193
IFF_ADDRCONF;
237-
238-
// bitmask: 0x100000
239194
/// Interface is in polling mode.
240195
#[cfg(any(target_os = "dragonfly"))]
241196
IFF_NPOLLING;
242197
/// Router on interface.
243198
#[cfg(any(target_os = "solaris"))]
244199
IFF_ROUTER;
245-
246-
// bitmask: 0x200000
247200
/// Interface is in polling mode.
248201
#[cfg(any(target_os = "dragonfly"))]
249202
IFF_IDIRECT;
@@ -253,85 +206,53 @@ libc_bitflags!(
253206
/// No NUD on interface.
254207
#[cfg(any(target_os = "solaris"))]
255208
IFF_NONUD;
256-
257-
// bitmask: 0x400000
258209
/// Interface is being renamed
259210
#[cfg(any(target_os = "freebsd"))]
260211
IFF_RENAMING;
261212
/// Anycast address.
262213
#[cfg(any(target_os = "solaris"))]
263214
IFF_ANYCAST;
264-
265-
// bitmask: 0x800000
266215
/// Don't exchange routing info.
267216
#[cfg(any(target_os = "solaris"))]
268217
IFF_NORTEXCH;
269-
270-
// bitmask: 0x01000000
271218
/// IPv4 interface.
272219
#[cfg(any(target_os = "solaris"))]
273220
IFF_IPV4;
274-
275-
// bitmask: 0x02000000
276221
/// IPv6 interface.
277222
#[cfg(any(target_os = "solaris"))]
278223
IFF_IPV6;
279-
280-
// bitmask: 0x08000000
281224
/// in.mpathd test address
282225
#[cfg(any(target_os = "solaris"))]
283226
IFF_NOFAILOVER;
284-
285-
// bitmask: 0x10000000
286227
/// Interface has failed
287228
#[cfg(any(target_os = "solaris"))]
288229
IFF_FAILED;
289-
290-
// bitmask: 0x20000000
291230
/// Interface is a hot-spare
292231
#[cfg(any(target_os = "solaris"))]
293232
IFF_STANDBY;
294-
295-
// bitmask: 0x40000000
296233
/// Functioning but not used
297234
#[cfg(any(target_os = "solaris"))]
298235
IFF_INACTIVE;
299-
300-
// bitmask: 0x80000000
301236
/// Interface is offline
302237
#[cfg(any(target_os = "solaris"))]
303238
IFF_OFFLINE;
304-
305-
// bitmask: 0x0200000000
306239
#[cfg(any(target_os = "solaris"))]
307240
IFF_COS_ENABLED;
308-
309-
// bitmask: 0x0400000000
310241
/// Prefer as source addr.
311242
#[cfg(any(target_os = "solaris"))]
312243
IFF_PREFERRED;
313-
314-
// bitmask: 0x0800000000
315244
/// RFC3041
316245
#[cfg(any(target_os = "solaris"))]
317246
IFF_TEMPORARY;
318-
319-
// bitmask: 0x1000000000
320247
/// MTU set with SIOCSLIFMTU
321248
#[cfg(any(target_os = "solaris"))]
322249
IFF_FIXEDMTU;
323-
324-
// bitmask: 0x2000000000
325250
/// Cannot send / receive packets
326251
#[cfg(any(target_os = "solaris"))]
327252
IFF_VIRTUAL;
328-
329-
// bitmask: 0x4000000000
330253
/// Local address in use
331254
#[cfg(any(target_os = "solaris"))]
332255
IFF_DUPLICATE;
333-
334-
// bitmask: 0x8000000000
335256
/// IPMP IP interface
336257
#[cfg(any(target_os = "solaris"))]
337258
IFF_IPMP;

0 commit comments

Comments
 (0)