From d444f1bcf20b29d0ec69e30046c71d005a2b9d72 Mon Sep 17 00:00:00 2001 From: Jason King Date: Wed, 17 Jun 2020 01:11:05 +0000 Subject: illumos and Solaris support Co-authored-by: Dominik Hassler Co-authored-by: Joshua M. Clulow --- src/net/if_.rs | 58 ++++++++++++++++++++++++++++++---------------------------- 1 file changed, 30 insertions(+), 28 deletions(-) (limited to 'src/net') diff --git a/src/net/if_.rs b/src/net/if_.rs index 96364884..3b7b4aab 100644 --- a/src/net/if_.rs +++ b/src/net/if_.rs @@ -43,6 +43,7 @@ libc_bitflags!( target_os = "linux", target_os = "macos", target_os = "netbsd", + target_os = "illumos", target_os = "solaris"))] IFF_NOTRAILERS; /// Interface manages own routes. @@ -54,6 +55,7 @@ libc_bitflags!( target_os = "dragonfly", target_os = "freebsd", target_os = "fuchsia", + target_os = "illumos", target_os = "ios", target_os = "linux", target_os = "macos", @@ -82,7 +84,7 @@ libc_bitflags!( target_os = "ios"))] IFF_OACTIVE; /// Protocol code on board. - #[cfg(target_os = "solaris")] + #[cfg(any(target_os = "illumos", target_os = "solaris"))] IFF_INTELLIGENT; /// Slave of a load balancing bundle. (see /// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html)) @@ -108,7 +110,7 @@ libc_bitflags!( target_os = "ios"))] IFF_LINK0; /// Multicast using broadcast. - #[cfg(any(target_os = "solaris"))] + #[cfg(any(target_os = "illumos", target_os = "solaris"))] IFF_MULTI_BCAST; /// Is able to select media type via ifmap. (see /// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html)) @@ -123,7 +125,7 @@ libc_bitflags!( target_os = "ios"))] IFF_LINK1; /// Non-unique address. - #[cfg(any(target_os = "solaris"))] + #[cfg(any(target_os = "illumos", target_os = "solaris"))] IFF_UNNUMBERED; /// Auto media selection active. (see /// [`netdevice(7)`](http://man7.org/linux/man-pages/man7/netdevice.7.html)) @@ -143,15 +145,15 @@ libc_bitflags!( target_os = "macos", target_os = "ios"))] IFF_ALTPHYS; - /// DHCP controlls interface. - #[cfg(any(target_os = "solaris"))] + /// DHCP controls interface. + #[cfg(any(target_os = "solaris", target_os = "illumos"))] IFF_DHCPRUNNING; /// 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"))] + #[cfg(any(target_os = "illumos", target_os = "solaris"))] IFF_PRIVATE; /// Driver signals L1 up. Volatile. #[cfg(any(target_os = "fuchsia", target_os = "linux"))] @@ -163,7 +165,7 @@ libc_bitflags!( #[cfg(any(target_os = "freebsd"))] IFF_CANTCONFIG; /// Do not transmit packets. - #[cfg(any(target_os = "solaris"))] + #[cfg(any(target_os = "illumos", target_os = "solaris"))] IFF_NOXMIT; /// Driver signals dormant. Volatile. #[cfg(any(target_os = "fuchsia", target_os = "linux"))] @@ -172,7 +174,7 @@ libc_bitflags!( #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] IFF_PPROMISC; /// Just on-link subnet. - #[cfg(any(target_os = "solaris"))] + #[cfg(any(target_os = "illumos", target_os = "solaris"))] IFF_NOLOCAL; /// Echo sent packets. Volatile. #[cfg(any(target_os = "fuchsia", target_os = "linux"))] @@ -181,19 +183,19 @@ libc_bitflags!( #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] IFF_MONITOR; /// Address is deprecated. - #[cfg(any(target_os = "solaris"))] + #[cfg(any(target_os = "illumos", target_os = "solaris"))] IFF_DEPRECATED; /// Static ARP. #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] IFF_STATICARP; /// Address from stateless addrconf. - #[cfg(any(target_os = "solaris"))] + #[cfg(any(target_os = "illumos", target_os = "solaris"))] IFF_ADDRCONF; /// Interface is in polling mode. #[cfg(any(target_os = "dragonfly"))] IFF_NPOLLING; /// Router on interface. - #[cfg(any(target_os = "solaris"))] + #[cfg(any(target_os = "illumos", target_os = "solaris"))] IFF_ROUTER; /// Interface is in polling mode. #[cfg(any(target_os = "dragonfly"))] @@ -202,16 +204,16 @@ libc_bitflags!( #[cfg(any(target_os = "freebsd"))] IFF_DYING; /// No NUD on interface. - #[cfg(any(target_os = "solaris"))] + #[cfg(any(target_os = "illumos", target_os = "solaris"))] IFF_NONUD; /// Interface is being renamed #[cfg(any(target_os = "freebsd"))] IFF_RENAMING; /// Anycast address. - #[cfg(any(target_os = "solaris"))] + #[cfg(any(target_os = "illumos", target_os = "solaris"))] IFF_ANYCAST; /// Don't exchange routing info. - #[cfg(any(target_os = "solaris"))] + #[cfg(any(target_os = "illumos", target_os = "solaris"))] IFF_NORTEXCH; /// Do not provide packet information #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] @@ -223,45 +225,45 @@ libc_bitflags!( #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))] IFF_TAP as libc::c_int; /// IPv4 interface. - #[cfg(any(target_os = "solaris"))] + #[cfg(any(target_os = "illumos", target_os = "solaris"))] IFF_IPV4; /// IPv6 interface. - #[cfg(any(target_os = "solaris"))] + #[cfg(any(target_os = "illumos", target_os = "solaris"))] IFF_IPV6; /// in.mpathd test address - #[cfg(any(target_os = "solaris"))] + #[cfg(any(target_os = "illumos", target_os = "solaris"))] IFF_NOFAILOVER; /// Interface has failed - #[cfg(any(target_os = "solaris"))] + #[cfg(any(target_os = "illumos", target_os = "solaris"))] IFF_FAILED; /// Interface is a hot-spare - #[cfg(any(target_os = "solaris"))] + #[cfg(any(target_os = "illumos", target_os = "solaris"))] IFF_STANDBY; /// Functioning but not used - #[cfg(any(target_os = "solaris"))] + #[cfg(any(target_os = "illumos", target_os = "solaris"))] IFF_INACTIVE; /// Interface is offline - #[cfg(any(target_os = "solaris"))] + #[cfg(any(target_os = "illumos", target_os = "solaris"))] IFF_OFFLINE; - #[cfg(any(target_os = "solaris"))] + #[cfg(target_os = "solaris")] IFF_COS_ENABLED; /// Prefer as source addr. - #[cfg(any(target_os = "solaris"))] + #[cfg(target_os = "solaris")] IFF_PREFERRED; /// RFC3041 - #[cfg(any(target_os = "solaris"))] + #[cfg(target_os = "solaris")] IFF_TEMPORARY; /// MTU set with SIOCSLIFMTU - #[cfg(any(target_os = "solaris"))] + #[cfg(target_os = "solaris")] IFF_FIXEDMTU; /// Cannot send / receive packets - #[cfg(any(target_os = "solaris"))] + #[cfg(target_os = "solaris")] IFF_VIRTUAL; /// Local address in use - #[cfg(any(target_os = "solaris"))] + #[cfg(target_os = "solaris")] IFF_DUPLICATE; /// IPMP IP interface - #[cfg(any(target_os = "solaris"))] + #[cfg(target_os = "solaris")] IFF_IPMP; } ); -- cgit v1.2.3