Skip to content

Commit

Permalink
Merge pull request #839 from blechschmidt/main
Browse files Browse the repository at this point in the history
Support TUNSETIFF on MIPS, PPC and SPARC
  • Loading branch information
thvdveld authored Sep 20, 2023
2 parents 28a5dd1 + 47c9a59 commit e6dd013
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/phy/sys/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,22 @@ 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;

pub const TUNSETIFF: libc::c_ulong = 0x400454CA;
// 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;

0 comments on commit e6dd013

Please sign in to comment.