#![allow(non_camel_case_types, dead_code)]
#[cfg(apple)]
pub(super) use libc::rt_msghdr as RtMsghdr;
#[cfg(any(target_os = "freebsd", target_os = "dragonfly"))]
#[repr(C)]
pub(super) struct RtMsghdr {
pub rtm_msglen: u16,
pub rtm_version: u8,
pub rtm_type: u8,
pub rtm_index: u16,
_pad_to_flags: u16,
pub rtm_flags: libc::c_int,
pub rtm_addrs: libc::c_int,
pub rtm_pid: libc::pid_t,
pub rtm_seq: libc::c_int,
pub rtm_errno: libc::c_int,
pub rtm_fmask: libc::c_int,
pub rtm_inits: libc::c_ulong,
pub rtm_rmx: RtMetricsLong,
}
#[cfg(any(target_os = "freebsd", target_os = "dragonfly"))]
#[repr(C)]
pub(super) struct RtMetricsLong {
pub rmx_locks: libc::c_ulong,
pub rmx_mtu: libc::c_ulong,
pub rmx_hopcount: libc::c_ulong,
pub rmx_expire: libc::c_ulong,
pub rmx_recvpipe: libc::c_ulong,
pub rmx_sendpipe: libc::c_ulong,
pub rmx_ssthresh: libc::c_ulong,
pub rmx_rtt: libc::c_ulong,
pub rmx_rttvar: libc::c_ulong,
pub rmx_pksent: libc::c_ulong,
pub rmx_weight: libc::c_ulong,
pub rmx_nhidx: libc::c_ulong,
_filler: [libc::c_ulong; 2],
}
#[cfg(all(
any(target_os = "freebsd", target_os = "dragonfly"),
target_pointer_width = "64"
))]
const _: () = assert!(core::mem::size_of::<RtMetricsLong>() == 112);
#[cfg(all(
any(target_os = "freebsd", target_os = "dragonfly"),
target_pointer_width = "64"
))]
const _: () = assert!(core::mem::size_of::<RtMsghdr>() == 152);
#[cfg(all(
any(target_os = "freebsd", target_os = "dragonfly"),
target_pointer_width = "64"
))]
const _: () = {
use core::mem::offset_of;
assert!(offset_of!(RtMsghdr, rtm_msglen) == 0);
assert!(offset_of!(RtMsghdr, rtm_index) == 4);
assert!(offset_of!(RtMsghdr, rtm_flags) == 8);
assert!(offset_of!(RtMsghdr, rtm_addrs) == 12);
assert!(offset_of!(RtMsghdr, rtm_rmx) == 40);
assert!(offset_of!(RtMetricsLong, rmx_recvpipe) == 32);
};
#[cfg(target_os = "netbsd")]
#[repr(C)]
pub(super) struct RtMsghdr {
pub rtm_msglen: u16,
pub rtm_version: u8,
pub rtm_type: u8,
pub rtm_index: u16,
_pad_index: u16,
pub rtm_flags: libc::c_int,
pub rtm_addrs: libc::c_int,
pub rtm_pid: libc::pid_t,
pub rtm_seq: libc::c_int,
pub rtm_errno: libc::c_int,
pub rtm_use: libc::c_int,
pub rtm_inits: libc::c_int,
pub rtm_rmx: RtMetricsU64,
}
#[cfg(target_os = "netbsd")]
#[repr(C)]
pub(super) struct RtMetricsU64 {
pub rmx_locks: u64,
pub rmx_mtu: u64,
pub rmx_hopcount: u64,
pub rmx_recvpipe: u64,
pub rmx_sendpipe: u64,
pub rmx_ssthresh: u64,
pub rmx_rtt: u64,
pub rmx_rttvar: u64,
pub rmx_expire: libc::time_t,
pub rmx_pksent: libc::time_t,
}
#[cfg(target_os = "netbsd")]
const _: () = assert!(core::mem::size_of::<RtMetricsU64>() == 80);
#[cfg(target_os = "netbsd")]
const _: () = assert!(core::mem::size_of::<RtMsghdr>() == 120);
#[cfg(target_os = "netbsd")]
const _: () = {
use core::mem::offset_of;
assert!(offset_of!(RtMsghdr, rtm_msglen) == 0);
assert!(offset_of!(RtMsghdr, rtm_index) == 4);
assert!(offset_of!(RtMsghdr, rtm_flags) == 8);
assert!(offset_of!(RtMsghdr, rtm_addrs) == 12);
assert!(offset_of!(RtMsghdr, rtm_inits) == 32);
assert!(offset_of!(RtMsghdr, rtm_rmx) == 40);
assert!(offset_of!(RtMetricsU64, rmx_recvpipe) == 24);
assert!(offset_of!(RtMetricsU64, rmx_expire) == 64);
assert!(offset_of!(RtMetricsU64, rmx_pksent) == 72);
};
#[cfg(target_os = "openbsd")]
#[repr(C)]
pub(super) struct RtMsghdr {
pub rtm_msglen: u16,
pub rtm_version: u8,
pub rtm_type: u8,
pub rtm_hdrlen: u16,
pub rtm_index: u16,
pub rtm_tableid: u16,
pub rtm_priority: u8,
pub rtm_mpls: u8,
pub rtm_addrs: libc::c_int,
pub rtm_flags: libc::c_int,
pub rtm_fmask: libc::c_int,
pub rtm_pid: libc::pid_t,
pub rtm_seq: libc::c_int,
pub rtm_errno: libc::c_int,
pub rtm_inits: libc::c_uint,
pub rtm_rmx: RtMetricsOpenBsd,
}
#[cfg(target_os = "openbsd")]
#[repr(C)]
pub(super) struct RtMetricsOpenBsd {
pub rmx_pksent: u64,
pub rmx_expire: u64,
pub rmx_locks: libc::c_uint,
pub rmx_mtu: libc::c_uint,
pub rmx_refcnt: libc::c_uint,
pub rmx_hopcount: libc::c_uint,
pub rmx_recvpipe: libc::c_uint,
pub rmx_sendpipe: libc::c_uint,
pub rmx_ssthresh: libc::c_uint,
pub rmx_rtt: libc::c_uint,
pub rmx_rttvar: libc::c_uint,
pub rmx_pad: libc::c_uint,
}
#[cfg(target_os = "openbsd")]
const _: () = assert!(core::mem::size_of::<RtMetricsOpenBsd>() == 56);
#[cfg(target_os = "openbsd")]
const _: () = assert!(core::mem::size_of::<RtMsghdr>() == 96);
#[cfg(target_os = "openbsd")]
const _: () = {
use core::mem::offset_of;
assert!(offset_of!(RtMsghdr, rtm_msglen) == 0);
assert!(offset_of!(RtMsghdr, rtm_index) == 6);
assert!(offset_of!(RtMsghdr, rtm_addrs) == 12);
assert!(offset_of!(RtMsghdr, rtm_flags) == 16);
assert!(offset_of!(RtMsghdr, rtm_rmx) == 40);
assert!(offset_of!(RtMetricsOpenBsd, rmx_recvpipe) == 32);
};
#[cfg(target_os = "freebsd")]
pub(super) use libc::ifma_msghdr as IfmaMsghdr;
#[cfg(target_os = "freebsd")]
pub(super) use libc::NET_RT_IFMALIST;
#[cfg(any(apple, target_os = "freebsd"))]
pub(super) use libc::ifa_msghdr as IfaMsghdr;
#[cfg(target_os = "dragonfly")]
#[repr(C)]
pub(super) struct IfaMsghdr {
pub ifam_msglen: u16,
pub ifam_version: u8,
pub ifam_type: u8,
pub ifam_addrs: libc::c_int,
pub ifam_flags: libc::c_int,
pub ifam_index: u16,
_pad: u16,
pub ifam_metric: libc::c_int,
}
#[cfg(target_os = "netbsd")]
#[repr(C)]
pub(super) struct IfaMsghdr {
pub ifam_msglen: u16,
pub ifam_version: u8,
pub ifam_type: u8,
pub ifam_index: u16,
_pad_to_flags: u16,
pub ifam_flags: libc::c_int,
pub ifam_addrs: libc::c_int,
pub ifam_pid: libc::pid_t,
pub ifam_addrflags: libc::c_int,
pub ifam_metric: libc::c_int,
}
#[cfg(target_os = "openbsd")]
#[repr(C)]
pub(super) struct IfaMsghdr {
pub ifam_msglen: u16,
pub ifam_version: u8,
pub ifam_type: u8,
pub ifam_hdrlen: u16,
pub ifam_index: u16,
pub ifam_tableid: u16,
pub ifam_pad1: u8,
pub ifam_pad2: u8,
pub ifam_addrs: libc::c_int,
pub ifam_flags: libc::c_int,
pub ifam_metric: libc::c_int,
}