linux.rs 857 B

1234567891011121314151617181920212223242526
  1. #![allow(unused)]
  2. pub const SIOCGIFMTU: libc::c_ulong = 0x8921;
  3. pub const SIOCGIFINDEX: libc::c_ulong = 0x8933;
  4. pub const ETH_P_ALL: libc::c_short = 0x0003;
  5. pub const ETH_P_IEEE802154: libc::c_short = 0x00F6;
  6. // Constant definition as per
  7. // https://github.com/golang/sys/blob/master/unix/zerrors_linux_<arch>.go
  8. pub const TUNSETIFF: libc::c_ulong = if cfg!(any(
  9. target_arch = "mips",
  10. all(target_arch = "mips", target_endian = "little"),
  11. target_arch = "mips64",
  12. all(target_arch = "mips64", target_endian = "little"),
  13. target_arch = "powerpc",
  14. target_arch = "powerpc64",
  15. all(target_arch = "powerpc64", target_endian = "little"),
  16. target_arch = "sparc64"
  17. )) {
  18. 0x800454CA
  19. } else {
  20. 0x400454CA
  21. };
  22. pub const IFF_TUN: libc::c_int = 0x0001;
  23. pub const IFF_TAP: libc::c_int = 0x0002;
  24. pub const IFF_NO_PI: libc::c_int = 0x1000;