summaryrefslogtreecommitdiff
path: root/src/phy/sys/linux.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/phy/sys/linux.rs')
-rw-r--r--src/phy/sys/linux.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/phy/sys/linux.rs b/src/phy/sys/linux.rs
new file mode 100644
index 0000000..c73eb4f
--- /dev/null
+++ b/src/phy/sys/linux.rs
@@ -0,0 +1,26 @@
+#![allow(unused)]
+
+pub const SIOCGIFMTU: libc::c_ulong = 0x8921;
+pub const SIOCGIFINDEX: libc::c_ulong = 0x8933;
+pub const ETH_P_ALL: libc::c_short = 0x0003;
+pub const ETH_P_IEEE802154: libc::c_short = 0x00F6;
+
+// Constant definition as per
+// https://github.com/golang/sys/blob/master/unix/zerrors_linux_<arch>.go
+pub const TUNSETIFF: libc::c_ulong = if cfg!(any(
+ target_arch = "mips",
+ target_arch = "mips64",
+ target_arch = "mips64el",
+ target_arch = "mipsel",
+ target_arch = "powerpc",
+ target_arch = "powerpc64",
+ target_arch = "powerpc64le",
+ target_arch = "sparc64"
+)) {
+ 0x800454CA
+} else {
+ 0x400454CA
+};
+pub const IFF_TUN: libc::c_int = 0x0001;
+pub const IFF_TAP: libc::c_int = 0x0002;
+pub const IFF_NO_PI: libc::c_int = 0x1000;