diff --git a/libc-test/build.rs b/libc-test/build.rs index 0d52a86053b80..e543f53c00e87 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -2473,6 +2473,33 @@ fn test_freebsd(target: &str) { // FIXME: Removed in FreeBSD 15: "LOCAL_CONNWAIT" if freebsd_ver >= Some(15) => true, + // submodule ifmib, cannot be checked today + "DOT3COMPLIANCE_STATS" + | "DOT3COMPLIANCE_COLLS" + | "IFDATA_GENERAL" + | "IFDATA_LINKSPECIFIC" + | "IFDATA_DRIVERNAME" + | "IFMIB_IFCOUNT" + | "IFMIB_IFDATA" + | "IFMIB_SYSTEM" + | "NETLINK_GENERIC" + | "dot3ChipSetAMD7990" + | "dot3ChipSetAMD79900" + | "dot3ChipSetAMD79C940" + | "dot3ChipSetIntel82586" + | "dot3ChipSetIntel82596" + | "dot3ChipSetIntel82557" + | "dot3ChipSetNational8390" + | "dot3ChipSetNationalSonic" + | "dot3ChipSetFujitsu86950" + | "dot3ChipSetDigitalDC21040" + | "dot3ChipSetDigitalDC21140" + | "dot3ChipSetDigitalDC21041" + | "dot3ChipSetDigitalDC21140A" + | "dot3ChipSetDigitalDC21142" + | "dot3ChipSetWesternDigital83C690" + | "dot3ChipSetWesternDigital83C790" => true, + _ => false, } }); diff --git a/src/unix/bsd/freebsdlike/freebsd/ifmib.rs b/src/unix/bsd/freebsdlike/freebsd/ifmib.rs new file mode 100644 index 0000000000000..0297e1bc9a0b7 --- /dev/null +++ b/src/unix/bsd/freebsdlike/freebsd/ifmib.rs @@ -0,0 +1,44 @@ +// sys/net/if_mib.h + +/// non-interface-specific +pub const IFMIB_SYSTEM: ::c_int = 1; +/// per-interface data table +pub const IFMIB_IFDATA: ::c_int = 2; + +/// generic stats for all kinds of ifaces +pub const IFDATA_GENERAL: ::c_int = 1; +/// specific to the type of interface +pub const IFDATA_LINKSPECIFIC: ::c_int = 2; +/// driver name and unit +pub const IFDATA_DRIVERNAME: ::c_int = 3; + +/// number of interfaces configured +pub const IFMIB_IFCOUNT: ::c_int = 1; + +/// functions not specific to a type of iface +pub const NETLINK_GENERIC: ::c_int = 0; + +pub const DOT3COMPLIANCE_STATS: ::c_int = 1; +pub const DOT3COMPLIANCE_COLLS: ::c_int = 2; + +pub const dot3ChipSetAMD7990: ::c_int = 1; +pub const dot3ChipSetAMD79900: ::c_int = 2; +pub const dot3ChipSetAMD79C940: ::c_int = 3; + +pub const dot3ChipSetIntel82586: ::c_int = 1; +pub const dot3ChipSetIntel82596: ::c_int = 2; +pub const dot3ChipSetIntel82557: ::c_int = 3; + +pub const dot3ChipSetNational8390: ::c_int = 1; +pub const dot3ChipSetNationalSonic: ::c_int = 2; + +pub const dot3ChipSetFujitsu86950: ::c_int = 1; + +pub const dot3ChipSetDigitalDC21040: ::c_int = 1; +pub const dot3ChipSetDigitalDC21140: ::c_int = 2; +pub const dot3ChipSetDigitalDC21041: ::c_int = 3; +pub const dot3ChipSetDigitalDC21140A: ::c_int = 4; +pub const dot3ChipSetDigitalDC21142: ::c_int = 5; + +pub const dot3ChipSetWesternDigital83C690: ::c_int = 1; +pub const dot3ChipSetWesternDigital83C790: ::c_int = 2; diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 78314084cc6ec..5d544264de9eb 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -3361,51 +3361,6 @@ pub const IFDR_MSG_SIZE: ::c_int = 64; pub const IFDR_REASON_MSG: ::c_int = 1; pub const IFDR_REASON_VENDOR: ::c_int = 2; -// sys/net/if_mib.h - -/// non-interface-specific -pub const IFMIB_SYSTEM: ::c_int = 1; -/// per-interface data table -pub const IFMIB_IFDATA: ::c_int = 2; - -/// generic stats for all kinds of ifaces -pub const IFDATA_GENERAL: ::c_int = 1; -/// specific to the type of interface -pub const IFDATA_LINKSPECIFIC: ::c_int = 2; -/// driver name and unit -pub const IFDATA_DRIVERNAME: ::c_int = 3; - -/// number of interfaces configured -pub const IFMIB_IFCOUNT: ::c_int = 1; - -/// functions not specific to a type of iface -pub const NETLINK_GENERIC: ::c_int = 0; - -pub const DOT3COMPLIANCE_STATS: ::c_int = 1; -pub const DOT3COMPLIANCE_COLLS: ::c_int = 2; - -pub const dot3ChipSetAMD7990: ::c_int = 1; -pub const dot3ChipSetAMD79900: ::c_int = 2; -pub const dot3ChipSetAMD79C940: ::c_int = 3; - -pub const dot3ChipSetIntel82586: ::c_int = 1; -pub const dot3ChipSetIntel82596: ::c_int = 2; -pub const dot3ChipSetIntel82557: ::c_int = 3; - -pub const dot3ChipSetNational8390: ::c_int = 1; -pub const dot3ChipSetNationalSonic: ::c_int = 2; - -pub const dot3ChipSetFujitsu86950: ::c_int = 1; - -pub const dot3ChipSetDigitalDC21040: ::c_int = 1; -pub const dot3ChipSetDigitalDC21140: ::c_int = 2; -pub const dot3ChipSetDigitalDC21041: ::c_int = 3; -pub const dot3ChipSetDigitalDC21140A: ::c_int = 4; -pub const dot3ChipSetDigitalDC21142: ::c_int = 5; - -pub const dot3ChipSetWesternDigital83C690: ::c_int = 1; -pub const dot3ChipSetWesternDigital83C790: ::c_int = 2; - // sys/netinet/in.h // Protocols (RFC 1700) // NOTE: These are in addition to the constants defined in src/unix/mod.rs @@ -5756,3 +5711,6 @@ cfg_if! { // Unknown target_arch } } + +// sys/net/if_mib.h +pub mod ifmib;