summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author寧靜 <luozijun.assistant@protonmail.com>2018-02-01 04:42:56 +0800
committerluozijun <luozijun.assistant@protonmail.com>2018-02-08 08:47:11 +0800
commitc755da826818f9f1120159fb41b5e3ce60fa5add (patch)
tree51b6b14caf23eb2bf69fc663aa1f2f363a849ca4
parent0a128f04b8ad64069a909bfb7184428021f2c082 (diff)
downloadnix-c755da826818f9f1120159fb41b5e3ce60fa5add.zip
Update `InterfaceFlags`
Add Flags: `IFF_NO_PI`, `IFF_TUN`, `IFF_TAP`.
-rw-r--r--CHANGELOG.md3
-rw-r--r--src/net/if_.rs9
2 files changed, 11 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e434e5c4..a446f2be 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,8 +8,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Added
- Added `getsid` in `::nix::unistd`
([#850](https://github.com/nix-rust/nix/pull/850))
-
- Added `alarm`. ([#830](https://github.com/nix-rust/nix/pull/830))
+- Added interface flags `IFF_NO_PI, IFF_TUN, IFF_TAP` on linux-like systems.
+ ([#853](https://github.com/nix-rust/nix/pull/853))
### Changed
- Display and Debug for SysControlAddr now includes all fields.
diff --git a/src/net/if_.rs b/src/net/if_.rs
index 19b1ee73..0da9016a 100644
--- a/src/net/if_.rs
+++ b/src/net/if_.rs
@@ -215,6 +215,15 @@ libc_bitflags!(
/// Don't exchange routing info.
#[cfg(any(target_os = "solaris"))]
IFF_NORTEXCH;
+ /// Do not provide packet information
+ #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))]
+ IFF_NO_PI as libc::c_int;
+ /// TUN device (no Ethernet headers)
+ #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))]
+ IFF_TUN as libc::c_int;
+ /// TAP device
+ #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))]
+ IFF_TAP as libc::c_int;
/// IPv4 interface.
#[cfg(any(target_os = "solaris"))]
IFF_IPV4;