Skip to content

Commit

Permalink
Drop the bitmask info and the grouping of IFF_* constants.
Browse files Browse the repository at this point in the history
  • Loading branch information
mwanner committed Dec 3, 2017
1 parent a4c7214 commit e200bc4
Showing 1 changed file with 0 additions and 79 deletions.
79 changes: 0 additions & 79 deletions src/net/if_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,21 @@ pub fn if_nametoindex<P: ?Sized + NixPath>(name: &P) -> Result<c_uint> {
libc_bitflags!(
/// Standard interface flags, used by `getifaddrs`
pub struct InterfaceFlags: libc::c_int {
// bitmask: 0x01
/// Interface is running. (see
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
IFF_UP;

// bitmask: 0x02
/// Valid broadcast address set. (see
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
IFF_BROADCAST;

// bitmask: 0x04
/// Internal debugging flag. (see
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
IFF_DEBUG;

// bitmask: 0x08
/// Interface is a loopback interface. (see
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
IFF_LOOPBACK;

// bitmask: 0x10
/// Interface is a point-to-point link. (see
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
IFF_POINTOPOINT;

// bitmask: 0x20
/// Avoid use of trailers. (see
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
#[cfg(any(target_os = "android",
Expand All @@ -61,8 +50,6 @@ libc_bitflags!(
/// Interface manages own routes.
#[cfg(any(target_os = "dragonfly"))]
IFF_SMART;

// bitmask: 0x40
/// Resources allocated. (see
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
#[cfg(any(target_os = "android",
Expand All @@ -76,23 +63,15 @@ libc_bitflags!(
target_os = "openbsd",
target_os = "solaris"))]
IFF_RUNNING;

// bitmask: 0x80
/// No arp protocol, L2 destination address not set. (see
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
IFF_NOARP;

// bitmask: 0x0100
/// Interface is in promiscuous mode. (see
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
IFF_PROMISC;

// bitmask: 0x0200
/// Receive all multicast packets. (see
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
IFF_ALLMULTI;

// bitmask: 0x0400
/// Master of a load balancing bundle. (see
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))]
Expand All @@ -107,8 +86,6 @@ libc_bitflags!(
/// Protocol code on board.
#[cfg(target_os = "solaris")]
IFF_INTELLIGENT;

// bitmask: 0x0800
/// Slave of a load balancing bundle. (see
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))]
Expand All @@ -121,15 +98,9 @@ libc_bitflags!(
target_os = "openbsd",
target_os = "osx"))]
IFF_SIMPLEX;

// This has bitmask: 0x1000 on android, fuchsia, and linux
// but 0x0800 on solaris
// and 0x8000 on dragonfly, macos, netbsd, openbsd, and ios
/// Supports multicast. (see
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
IFF_MULTICAST;

// bitmask: 0x1000
/// Per link layer defined bit.
#[cfg(any(target_os = "dragonfly",
target_os = "freebsd",
Expand All @@ -141,8 +112,6 @@ libc_bitflags!(
/// Multicast using broadcast.
#[cfg(any(target_os = "solaris"))]
IFF_MULTI_BCAST;

// bitmask: 0x2000
/// Is able to select media type via ifmap. (see
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))]
Expand All @@ -158,8 +127,6 @@ libc_bitflags!(
/// Non-unique address.
#[cfg(any(target_os = "solaris"))]
IFF_UNNUMBERED;

// bitmask: 0x4000
/// Auto media selection active. (see
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))]
Expand All @@ -181,17 +148,13 @@ libc_bitflags!(
/// DHCP controlls interface.
#[cfg(any(target_os = "solaris"))]
IFF_DHCPRUNNING;

// bitmask: 0x8000
/// The addresses are lost when the interface goes down. (see
/// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html))
#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))]
IFF_DYNAMIC;
/// Do not advertise.
#[cfg(any(target_os = "solaris"))]
IFF_PRIVATE;

// bitmask: 0x010000
/// Driver signals L1 up. Volatile.
#[cfg(any(target_os = "fuchsia", target_os = "linux"))]
IFF_LOWER_UP;
Expand All @@ -204,8 +167,6 @@ libc_bitflags!(
/// Do not transmit packets.
#[cfg(any(target_os = "solaris"))]
IFF_NOXMIT;

// bitmask: 0x020000
/// Driver signals dormant. Volatile.
#[cfg(any(target_os = "fuchsia", target_os = "linux"))]
IFF_DORMANT;
Expand All @@ -215,8 +176,6 @@ libc_bitflags!(
/// Just on-link subnet.
#[cfg(any(target_os = "solaris"))]
IFF_NOLOCAL;

// bitmask: 0x040000
/// Echo sent packets. Volatile.
#[cfg(any(target_os = "fuchsia", target_os = "linux"))]
IFF_ECHO;
Expand All @@ -226,24 +185,18 @@ libc_bitflags!(
/// Address is deprecated.
#[cfg(any(target_os = "solaris"))]
IFF_DEPRECATED;

// bitmask: 0x080000
/// Static ARP.
#[cfg(any(target_os = "dragonfly", target_os = "freebsd"))]
IFF_STATICARP;
/// Address from stateless addrconf.
#[cfg(any(target_os = "solaris"))]
IFF_ADDRCONF;

// bitmask: 0x100000
/// Interface is in polling mode.
#[cfg(any(target_os = "dragonfly"))]
IFF_NPOLLING;
/// Router on interface.
#[cfg(any(target_os = "solaris"))]
IFF_ROUTER;

// bitmask: 0x200000
/// Interface is in polling mode.
#[cfg(any(target_os = "dragonfly"))]
IFF_IDIRECT;
Expand All @@ -253,85 +206,53 @@ libc_bitflags!(
/// No NUD on interface.
#[cfg(any(target_os = "solaris"))]
IFF_NONUD;

// bitmask: 0x400000
/// Interface is being renamed
#[cfg(any(target_os = "freebsd"))]
IFF_RENAMING;
/// Anycast address.
#[cfg(any(target_os = "solaris"))]
IFF_ANYCAST;

// bitmask: 0x800000
/// Don't exchange routing info.
#[cfg(any(target_os = "solaris"))]
IFF_NORTEXCH;

// bitmask: 0x01000000
/// IPv4 interface.
#[cfg(any(target_os = "solaris"))]
IFF_IPV4;

// bitmask: 0x02000000
/// IPv6 interface.
#[cfg(any(target_os = "solaris"))]
IFF_IPV6;

// bitmask: 0x08000000
/// in.mpathd test address
#[cfg(any(target_os = "solaris"))]
IFF_NOFAILOVER;

// bitmask: 0x10000000
/// Interface has failed
#[cfg(any(target_os = "solaris"))]
IFF_FAILED;

// bitmask: 0x20000000
/// Interface is a hot-spare
#[cfg(any(target_os = "solaris"))]
IFF_STANDBY;

// bitmask: 0x40000000
/// Functioning but not used
#[cfg(any(target_os = "solaris"))]
IFF_INACTIVE;

// bitmask: 0x80000000
/// Interface is offline
#[cfg(any(target_os = "solaris"))]
IFF_OFFLINE;

// bitmask: 0x0200000000
#[cfg(any(target_os = "solaris"))]
IFF_COS_ENABLED;

// bitmask: 0x0400000000
/// Prefer as source addr.
#[cfg(any(target_os = "solaris"))]
IFF_PREFERRED;

// bitmask: 0x0800000000
/// RFC3041
#[cfg(any(target_os = "solaris"))]
IFF_TEMPORARY;

// bitmask: 0x1000000000
/// MTU set with SIOCSLIFMTU
#[cfg(any(target_os = "solaris"))]
IFF_FIXEDMTU;

// bitmask: 0x2000000000
/// Cannot send / receive packets
#[cfg(any(target_os = "solaris"))]
IFF_VIRTUAL;

// bitmask: 0x4000000000
/// Local address in use
#[cfg(any(target_os = "solaris"))]
IFF_DUPLICATE;

// bitmask: 0x8000000000
/// IPMP IP interface
#[cfg(any(target_os = "solaris"))]
IFF_IPMP;
Expand Down

0 comments on commit e200bc4

Please sign in to comment.