use libc::{c_uchar, c_uint, c_ulong, c_ushort};
pub const IFNAMSIZ: usize = 16;
pub const IFALIASZ: usize = 256;
pub const ALTIFNAMSIZ: usize = 128;
#[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum NetDeviceFlags {
Up = 1 << 0, Broadcast = 1 << 1, Debug = 1 << 2, Loopback = 1 << 3, Pointopoint = 1 << 4, Notrailers = 1 << 5, Running = 1 << 6, Noarp = 1 << 7, Promisc = 1 << 8, Allmulti = 1 << 9, Master = 1 << 10, Slave = 1 << 11, Multicast = 1 << 12, Portsel = 1 << 13, Automedia = 1 << 14, Dynamic = 1 << 15, LowerUp = 1 << 16, Dormant = 1 << 17, Echo = 1 << 18, }
pub const IFF_UP: c_uint = NetDeviceFlags::Up as c_uint;
pub const IFF_BROADCAST: c_uint = NetDeviceFlags::Broadcast as c_uint;
pub const IFF_DEBUG: c_uint = NetDeviceFlags::Debug as c_uint;
pub const IFF_LOOPBACK: c_uint = NetDeviceFlags::Loopback as c_uint;
pub const IFF_POINTOPOINT: c_uint = NetDeviceFlags::Pointopoint as c_uint;
pub const IFF_NOTRAILERS: c_uint = NetDeviceFlags::Notrailers as c_uint;
pub const IFF_RUNNING: c_uint = NetDeviceFlags::Running as c_uint;
pub const IFF_NOARP: c_uint = NetDeviceFlags::Noarp as c_uint;
pub const IFF_PROMISC: c_uint = NetDeviceFlags::Promisc as c_uint;
pub const IFF_ALLMULTI: c_uint = NetDeviceFlags::Allmulti as c_uint;
pub const IFF_MASTER: c_uint = NetDeviceFlags::Master as c_uint;
pub const IFF_SLAVE: c_uint = NetDeviceFlags::Slave as c_uint;
pub const IFF_MULTICAST: c_uint = NetDeviceFlags::Multicast as c_uint;
pub const IFF_PORTSEL: c_uint = NetDeviceFlags::Portsel as c_uint;
pub const IFF_AUTOMEDIA: c_uint = NetDeviceFlags::Automedia as c_uint;
pub const IFF_DYNAMIC: c_uint = NetDeviceFlags::Dynamic as c_uint;
pub const IFF_LOWER_UP: c_uint = NetDeviceFlags::LowerUp as c_uint;
pub const IFF_DORMANT: c_uint = NetDeviceFlags::Dormant as c_uint;
pub const IFF_ECHO: c_uint = NetDeviceFlags::Echo as c_uint;
pub const IFF_VOLATILE: c_uint = IFF_LOOPBACK
| IFF_POINTOPOINT
| IFF_BROADCAST
| IFF_ECHO
| IFF_MASTER
| IFF_SLAVE
| IFF_RUNNING
| IFF_LOWER_UP
| IFF_DORMANT;
pub const IF_GET_IFACE: c_uint = 0x0001; pub const IF_GET_PROTO: c_uint = 0x0002;
pub const IF_IFACE_V35: c_uint = 0x1000; pub const IF_IFACE_V24: c_uint = 0x1001; pub const IF_IFACE_X21: c_uint = 0x1002; pub const IF_IFACE_T1: c_uint = 0x1003; pub const IF_IFACE_E1: c_uint = 0x1004; pub const IF_IFACE_SYNC_SERIAL: c_uint = 0x1005; pub const IF_IFACE_X21D: c_uint = 0x1006;
pub const IF_PROTO_HDLC: c_uint = 0x2000; pub const IF_PROTO_PPP: c_uint = 0x2001; pub const IF_PROTO_CISCO: c_uint = 0x2002; pub const IF_PROTO_FR: c_uint = 0x2003; pub const IF_PROTO_FR_ADD_PVC: c_uint = 0x2004; pub const IF_PROTO_FR_DEL_PVC: c_uint = 0x2005; pub const IF_PROTO_X25: c_uint = 0x2006; pub const IF_PROTO_HDLC_ETH: c_uint = 0x2007; pub const IF_PROTO_FR_ADD_ETH_PVC: c_uint = 0x2008; pub const IF_PROTO_FR_DEL_ETH_PVC: c_uint = 0x2009; pub const IF_PROTO_FR_PVC: c_uint = 0x200A; pub const IF_PROTO_FR_ETH_PVC: c_uint = 0x200B;
pub const IF_PROTO_RAW: c_uint = 0x200C; #[repr(u8)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum IfOper {
Unknown,
Notpresent,
Down,
Lowerlayerdown,
Testing,
Dormant,
Up,
}
pub const IF_OPER_UNKNOWN: u8 = IfOper::Unknown as u8;
pub const IF_OPER_NOTPRESENT: u8 = IfOper::Notpresent as u8;
pub const IF_OPER_DOWN: u8 = IfOper::Down as u8;
pub const IF_OPER_LOWERLAYERDOWN: u8 = IfOper::Lowerlayerdown as u8;
pub const IF_OPER_TESTING: u8 = IfOper::Testing as u8;
pub const IF_OPER_DORMANT: u8 = IfOper::Dormant as u8;
pub const IF_OPER_UP: u8 = IfOper::Up as u8;
#[repr(u8)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum IfLinkMode {
Default = 0,
Dormant, Testing, }
pub const IF_LINK_MODE_DEFAULT: u8 = IfLinkMode::Default as u8;
pub const IF_LINK_MODE_DORMANT: u8 = IfLinkMode::Dormant as u8;
pub const IF_LINK_MODE_TESTING: u8 = IfLinkMode::Testing as u8;
#[repr(C)]
#[derive(Debug, Clone, Copy)]
pub struct Ifmap {
mem_start: c_ulong,
mem_end: c_ulong,
base_addr: c_ushort,
irq: c_uchar,
dma: c_uchar,
port: c_uchar, }