diff --git a/libc-test/build.rs b/libc-test/build.rs index 16964b75e1d62..c510f21ffa3bc 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -453,6 +453,7 @@ fn test_openbsd(target: &str) { "netinet/ip.h", "netinet/tcp.h", "netinet/udp.h", + "netinet6/in6_var.h", "net/bpf.h", "regex.h", "resolv.h", @@ -1035,6 +1036,7 @@ fn test_netbsd(target: &str) { "netinet/ip.h", "netinet/tcp.h", "netinet/udp.h", + "netinet6/in6_var.h", "poll.h", "pthread.h", "pwd.h", @@ -1240,6 +1242,7 @@ fn test_dragonflybsd(target: &str) { "netinet/ip.h", "netinet/tcp.h", "netinet/udp.h", + "netinet6/in6_var.h", "poll.h", "pthread.h", "pthread_np.h", @@ -2056,6 +2059,7 @@ fn test_freebsd(target: &str) { "netinet/sctp.h", "netinet/tcp.h", "netinet/udp.h", + "netinet6/in6_var.h", "poll.h", "pthread.h", "pthread_np.h", diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt index bb80ce86b48cf..1442c1ad75a18 100644 --- a/libc-test/semver/apple.txt +++ b/libc-test/semver/apple.txt @@ -1313,7 +1313,33 @@ SIGINFO SIGIO SIGNATURE SIGSTKSZ +SIOCADDMULTI +SIOCAIFADDR +SIOCAIFADDR_IN6 +SIOCDELMULTI +SIOCDIFADDR +SIOCDIFADDR_IN6 SIOCGIFADDR +SIOCGIFBRDADDR +SIOCGIFCAP +SIOCGIFDEVMTU +SIOCGIFDSTADDR +SIOCGIFFLAGS +SIOCGIFLLADDR +SIOCGIFMTU +SIOCGIFNETMASK +SIOCIFCREATE +SIOCIFCREATE2 +SIOCIFDESTROY +SIOCSDRVSPEC +SIOCSIFADDR +SIOCSIFBRDADDR +SIOCSIFCAP +SIOCSIFDSTADDR +SIOCSIFFLAGS +SIOCSIFLLADDR +SIOCSIFMTU +SIOCSIFNETMASK SOCK_MAXADDRLEN SOCK_RAW SOCK_RDM @@ -1768,6 +1794,8 @@ backtrace_symbols_fd basename boolean_t bpf_hdr +bpf_stat +bpf_version brk bsearch chflags diff --git a/libc-test/semver/dragonfly.txt b/libc-test/semver/dragonfly.txt index a0cc6c6c83fc5..fb3ef20079388 100644 --- a/libc-test/semver/dragonfly.txt +++ b/libc-test/semver/dragonfly.txt @@ -82,22 +82,26 @@ B14400 B28800 B7200 B76800 +BIOCFEEDBACK BIOCFLUSH BIOCGBLEN BIOCGDLT BIOCGDLTLIST BIOCGETIF +BIOCGFEEDBACK BIOCGHDRCMPLT BIOCGRSIG BIOCGRTIMEOUT BIOCGSEESENT BIOCGSTATS BIOCIMMEDIATE +BIOCLOCK BIOCPROMISC BIOCSBLEN BIOCSDLT BIOCSETF BIOCSETIF +BIOCSFEEDBACK BIOCSHDRCMPLT BIOCSRSIG BIOCSRTIMEOUT @@ -870,6 +874,22 @@ RLIMIT_STACK RLIMIT_VMEM RLIM_INFINITY RLIM_NLIMITS +RTAX_AUTHOR +RTAX_BRD +RTAX_DST +RTAX_GATEWAY +RTAX_GENMASK +RTAX_IFA +RTAX_IFP +RTAX_NETMASK +RTA_AUTHOR +RTA_BRD +RTA_DST +RTA_GATEWAY +RTA_GENMASK +RTA_IFA +RTA_IFP +RTA_NETMASK RTLD_NEXT RTLD_NODELETE RTLD_NOLOAD @@ -918,7 +938,30 @@ SIGINFO SIGIO SIGNATURE SIGSTKSZ +SIOCADDMULTI +SIOCAIFADDR +SIOCAIFADDR_IN6 +SIOCDELMULTI +SIOCDIFADDR +SIOCDIFADDR_IN6 SIOCGIFADDR +SIOCGIFBRDADDR +SIOCGIFCAP +SIOCGIFDSTADDR +SIOCGIFFLAGS +SIOCGIFMTU +SIOCGIFNETMASK +SIOCIFCREATE +SIOCIFCREATE2 +SIOCIFDESTROY +SIOCSDRVSPEC +SIOCSIFADDR +SIOCSIFBRDADDR +SIOCSIFCAP +SIOCSIFDSTADDR +SIOCSIFFLAGS +SIOCSIFMTU +SIOCSIFNETMASK SLIPDISC SOCK_CLOEXEC SOCK_MAXADDRLEN diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt index 4e1f998f39982..3edb9dcb27646 100644 --- a/libc-test/semver/freebsd.txt +++ b/libc-test/semver/freebsd.txt @@ -117,6 +117,7 @@ B7200 B76800 B921600 BIOCFLUSH +BIOCFEEDBACK BIOCGBLEN BIOCGDLT BIOCGDLTLIST @@ -127,12 +128,15 @@ BIOCGRTIMEOUT BIOCGSEESENT BIOCGSTATS BIOCIMMEDIATE +BIOCLOCK BIOCPROMISC +BIOCROTZBUF BIOCSBLEN BIOCSDLT BIOCSETF BIOCSETFNR BIOCSETIF +BIOCSETZBUF BIOCSHDRCMPLT BIOCSRSIG BIOCSRTIMEOUT @@ -1221,6 +1225,22 @@ RLIMIT_UMTXP RLIMIT_VMEM RLIM_INFINITY RLIM_NLIMITS +RTAX_AUTHOR +RTAX_BRD +RTAX_DST +RTAX_GATEWAY +RTAX_GENMASK +RTAX_IFA +RTAX_IFP +RTAX_NETMASK +RTA_AUTHOR +RTA_BRD +RTA_DST +RTA_GATEWAY +RTA_GENMASK +RTA_IFA +RTA_IFP +RTA_NETMASK RTLD_NEXT RTLD_NODELETE RTLD_NOLOAD @@ -1417,7 +1437,30 @@ SIGLIBRT SIGLWP SIGSTKSZ SIGTHR +SIOCADDMULTI +SIOCAIFADDR +SIOCAIFADDR_IN6 +SIOCDELMULTI +SIOCDIFADDR +SIOCDIFADDR_IN6 SIOCGIFADDR +SIOCGIFBRDADDR +SIOCGIFCAP +SIOCGIFDSTADDR +SIOCGIFFLAGS +SIOCGIFMTU +SIOCGIFNETMASK +SIOCIFCREATE +SIOCIFCREATE2 +SIOCIFDESTROY +SIOCSDRVSPEC +SIOCSIFADDR +SIOCSIFBRDADDR +SIOCSIFCAP +SIOCSIFDSTADDR +SIOCSIFFLAGS +SIOCSIFMTU +SIOCSIFNETMASK SLIPDISC SOCKCREDSIZE SOCK_CLOEXEC @@ -1819,7 +1862,10 @@ bpf_hdr bpf_insn bpf_program bpf_stat +bpf_ts bpf_version +bpf_xhdr +bpf_zbuf bsearch cap_enter cap_getmode diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt index b82d9cbeca065..44d08df7b866f 100644 --- a/libc-test/semver/netbsd.txt +++ b/libc-test/semver/netbsd.txt @@ -104,19 +104,23 @@ B460800 B7200 B76800 B921600 +BIOCFEEDBACK BIOCFLUSH BIOCGBLEN BIOCGDLT BIOCGETIF +BIOCGFEEDBACK BIOCGHDRCMPLT BIOCGRSIG BIOCGSEESENT BIOCGSTATS BIOCIMMEDIATE +BIOCLOCK BIOCPROMISC BIOCSBLEN BIOCSDLT BIOCSETIF +BIOCSFEEDBACK BIOCSHDRCMPLT BIOCSRSIG BIOCSSEESENT @@ -926,6 +930,22 @@ RLIM_INFINITY RLIM_NLIMITS RLIM_SAVED_CUR RLIM_SAVED_MAX +RTAX_AUTHOR +RTAX_BRD +RTAX_DST +RTAX_GATEWAY +RTAX_GENMASK +RTAX_IFA +RTAX_IFP +RTAX_NETMASK +RTA_AUTHOR +RTA_BRD +RTA_DST +RTA_GATEWAY +RTA_GENMASK +RTA_IFA +RTA_IFP +RTA_NETMASK RTLD_NEXT RTLD_NOLOAD RTLD_SELF @@ -958,7 +978,30 @@ SIGINFO SIGIO SIGNATURE SIGSTKSZ +SIOCADDMULTI +SIOCAIFADDR +SIOCAIFADDR_IN6 +SIOCDELMULTI +SIOCDIFADDR +SIOCDIFADDR_IN6 SIOCGIFADDR +SIOCGIFBRDADDR +SIOCGIFCAP +SIOCGIFDSTADDR +SIOCGIFFLAGS +SIOCGIFMTU +SIOCGIFNETMASK +SIOCIFCREATE +SIOCIFCREATE2 +SIOCIFDESTROY +SIOCSDRVSPEC +SIOCSIFADDR +SIOCSIFBRDADDR +SIOCSIFCAP +SIOCSIFDSTADDR +SIOCSIFFLAGS +SIOCSIFMTU +SIOCSIFNETMASK SOCKCREDSIZE SOCK_CLOEXEC SOCK_CONN_DGRAM @@ -1214,6 +1257,8 @@ backtrace_symbols backtrace_symbols_fd backtrace_symbols_fmt backtrace_symbols_fd_fmt +bpf_stat +bpf_version bsearch chflags chroot diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt index afb8afa7f50f0..7edf8aaab3a71 100644 --- a/libc-test/semver/openbsd.txt +++ b/libc-test/semver/openbsd.txt @@ -78,6 +78,7 @@ BIOCGHDRCMPLT BIOCGRSIG BIOCGSTATS BIOCIMMEDIATE +BIOCLOCK BIOCPROMISC BIOCSBLEN BIOCSDLT @@ -760,6 +761,22 @@ RLIM_INFINITY RLIM_NLIMITS RLIM_SAVED_CUR RLIM_SAVED_MAX +RTAX_AUTHOR +RTAX_BRD +RTAX_DST +RTAX_GATEWAY +RTAX_GENMASK +RTAX_IFA +RTAX_IFP +RTAX_NETMASK +RTA_AUTHOR +RTA_BRD +RTA_DST +RTA_GATEWAY +RTA_GENMASK +RTA_IFA +RTA_IFP +RTA_NETMASK RTLD_NEXT RTLD_SELF RUSAGE_CHILDREN @@ -781,7 +798,27 @@ SIGEMT SIGINFO SIGIO SIGSTKSZ +SIOCADDMULTI +SIOCAIFADDR +SIOCAIFADDR_IN6 +SIOCDELMULTI +SIOCDIFADDR +SIOCDIFADDR_IN6 SIOCGIFADDR +SIOCGIFBRDADDR +SIOCGIFDSTADDR +SIOCGIFFLAGS +SIOCGIFMTU +SIOCGIFNETMASK +SIOCIFCREATE +SIOCIFCREATE2 +SIOCIFDESTROY +SIOCSIFADDR +SIOCGIFBRDADDR +SIOCSIFDSTADDR +SIOCSIFFLAGS +SIOCSIFMTU +SIOCSIFNETMASK SOCK_CLOEXEC SOCK_DNS SOCK_NONBLOCK @@ -1012,6 +1049,8 @@ backtrace_symbols backtrace_symbols_fd backtrace_symbols_fmt basename +bpf_stat +bpf_version bsearch caddr_t calloc_conceal diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 9951f2314153d..ec0e478dccdab 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -161,6 +161,8 @@ pub type copyfile_callback_t = ::Option< pub type attrgroup_t = u32; pub type vol_capabilities_set_t = [u32; 4]; +pub type u_int = ::c_uint; + #[cfg_attr(feature = "extra_traits", derive(Debug))] pub enum timezone {} impl ::Copy for timezone {} @@ -1208,6 +1210,12 @@ s! { pub ifs6_out_mldreport: ::u_quad_t, pub ifs6_out_mlddone: ::u_quad_t, } + + // net/bpf.h + pub struct bpf_stat { + pub bs_recv: ::u_int, + pub bs_drop: ::u_int, + } } s_no_extra_traits! { @@ -3813,6 +3821,23 @@ pub const MINCORE_MODIFIED_OTHER: ::c_int = 0x10; pub const CTLIOCGINFO: c_ulong = 0xc0644e03; +// +pub const SIOCAIFADDR: ::c_ulong = 0x8020691a; +pub const SIOCGIFCAP: ::c_ulong = 0xc020695b; +pub const SIOCGIFDEVMTU: ::c_ulong = 0xc0206944; +pub const SIOCGIFLLADDR: ::c_ulong = 0xc020699e; +pub const SIOCGIFMTU: ::c_ulong = 0xc0206933; +pub const SIOCIFCREATE: ::c_ulong = 0xc0206978; +pub const SIOCIFCREATE2: ::c_ulong = 0xc020697a; +pub const SIOCSDRVSPEC: ::c_ulong = 0x8020697b; +pub const SIOCSIFCAP: ::c_ulong = 0x8020695a; +pub const SIOCSIFLLADDR: ::c_ulong = 0x8020693c; +pub const SIOCSIFMTU: ::c_ulong = 0x80206934; + +// +pub const SIOCAIFADDR_IN6: ::c_ulong = 0x80206919; +pub const SIOCDIFADDR_IN6: ::c_ulong = 0x80206918; + // // sys/netinet/in.h // Protocols (RFC 1700) @@ -4966,25 +4991,6 @@ pub const RTV_SSTHRESH: ::c_int = 0x20; pub const RTV_RTT: ::c_int = 0x40; pub const RTV_RTTVAR: ::c_int = 0x80; -// Bitmask values for rtm_addrs. -pub const RTA_DST: ::c_int = 0x1; -pub const RTA_GATEWAY: ::c_int = 0x2; -pub const RTA_NETMASK: ::c_int = 0x4; -pub const RTA_GENMASK: ::c_int = 0x8; -pub const RTA_IFP: ::c_int = 0x10; -pub const RTA_IFA: ::c_int = 0x20; -pub const RTA_AUTHOR: ::c_int = 0x40; -pub const RTA_BRD: ::c_int = 0x80; - -// Index offsets for sockaddr array for alternate internal encoding. -pub const RTAX_DST: ::c_int = 0; -pub const RTAX_GATEWAY: ::c_int = 1; -pub const RTAX_NETMASK: ::c_int = 2; -pub const RTAX_GENMASK: ::c_int = 3; -pub const RTAX_IFP: ::c_int = 4; -pub const RTAX_IFA: ::c_int = 5; -pub const RTAX_AUTHOR: ::c_int = 6; -pub const RTAX_BRD: ::c_int = 7; pub const RTAX_MAX: ::c_int = 8; pub const KERN_PROCARGS2: ::c_int = 49; diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs index 489b82adb84b9..23657fa323f79 100644 --- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -1159,6 +1159,19 @@ pub const IFF_STATICARP: ::c_int = 0x80000; // static ARP pub const IFF_NPOLLING: ::c_int = 0x100000; // interface is in polling mode pub const IFF_IDIRECT: ::c_int = 0x200000; // direct input +// +pub const BIOCLOCK: ::c_ulong = 0x2004427a; +pub const BIOCGFEEDBACK: ::c_ulong = 0x4004427c; +pub const BIOCSFEEDBACK: ::c_ulong = 0x8004427d; +pub const BIOCFEEDBACK: ::c_ulong = ::BIOCSFEEDBACK; + +// +pub const SIOCAIFADDR: ::c_ulong = 0x8020691a; + +// +pub const SIOCAIFADDR_IN6: ::c_ulong = 0x80206919; +pub const SIOCDIFADDR_IN6: ::c_ulong = 0x80206918; + // // sys/netinet/in.h // Protocols (RFC 1700) diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 307ca87127f31..dfe102c8fa762 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -50,6 +50,13 @@ pub type sctp_assoc_t = u32; pub type eventfd_t = u64; +// net/bpf.h + +type bpf_int32 = i32; +type bpf_u_int32 = u32; +type bpf_int64 = i64; +type bpf_u_int64 = u64; + #[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))] #[repr(u32)] pub enum devstat_support_flags { @@ -1350,6 +1357,26 @@ s! { pub strchange_instrms: u16, pub strchange_outstrms: u16, } + + // net/bpf.h + + pub struct bpf_zbuf { + pub bz_bufa: *mut libc::c_void, + pub bz_bufb: *mut libc::c_void, + pub bz_buflen: libc::size_t, + } + + pub struct bpf_ts { + pub bt_sec: ::bpf_int64, + pub bt_frac: ::bpf_u_int64, + } + + pub struct bpf_xhdr { + pub bh_tstamp: ::bpf_ts, + pub bh_caplen: ::bpf_u_int32, + pub bh_datalen: ::bpf_u_int32, + pub bh_hdrlen: ::c_ushort, + } } s_no_extra_traits! { @@ -3311,6 +3338,21 @@ pub const AF_IEEE80211: ::c_int = 37; pub const AF_INET_SDP: ::c_int = 40; pub const AF_INET6_SDP: ::c_int = 42; +// +pub const BIOCROTZBUF: ::c_ulong = 0x80184280; +pub const BIOCSETZBUF: ::c_ulong = 0x80184281; +pub const BIOCLOCK: ::c_ulong = 0x2000427a; +pub const BIOCFEEDBACK: ::c_ulong = 0x8004427c; + +// +pub const OSIOCAIFADDR: ::c_ulong = 0x8020691a; +pub const SIOCAIFADDR: ::c_ulong = 0x8020692b; + +// +pub const OSIOCAIFADDR_IN6: ::c_ulong = 0x8020691a; +pub const SIOCAIFADDR_IN6: ::c_ulong = 0x8020691b; +pub const SIOCDIFADDR_IN6: ::c_ulong = 0x80206919; + // sys/net/if.h pub const IF_MAXUNIT: ::c_int = 0x7fff; /// (n) interface is up diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs index 89557e1520622..01dafc4d88a36 100644 --- a/src/unix/bsd/freebsdlike/mod.rs +++ b/src/unix/bsd/freebsdlike/mod.rs @@ -306,11 +306,6 @@ s! { pub bs_drop: ::c_uint, } - pub struct bpf_version { - pub bv_major: ::c_ushort, - pub bv_minor: ::c_ushort, - } - pub struct bpf_hdr { pub bh_tstamp: ::timeval, pub bh_caplen: u32, @@ -1354,7 +1349,16 @@ pub const SF_NOUNLINK: ::c_ulong = 0x00100000; pub const TIMER_ABSTIME: ::c_int = 1; -// +// +pub const SIOCGIFCAP: ::c_ulong = 0xc020691f; +pub const SIOCGIFMTU: ::c_ulong = 0xc0206933; +pub const SIOCIFCREATE: ::c_ulong = 0xc020697a; +pub const SIOCIFCREATE2: ::c_ulong = 0xc020697c; +pub const SIOCSDRVSPEC: ::c_ulong = 0x8020697b; +pub const SIOCSIFCAP: ::c_ulong = 0x8020691e; +pub const SIOCSIFMTU: ::c_ulong = 0x80206934; + +// pub const NTP_API: ::c_int = 4; pub const MAXPHASE: ::c_long = 500000000; pub const MAXFREQ: ::c_long = 500000; diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs index 83e675ca3474d..e0a58b10141b1 100644 --- a/src/unix/bsd/mod.rs +++ b/src/unix/bsd/mod.rs @@ -122,6 +122,11 @@ s! { pub flag: *mut ::c_int, pub val: ::c_int, } + + pub struct bpf_version { + pub bv_major: ::c_ushort, + pub bv_minor: ::c_ushort, + } } s_no_extra_traits! { @@ -493,7 +498,22 @@ pub const BIOCIMMEDIATE: ::c_ulong = 0x80044270; pub const BIOCVERSION: ::c_ulong = 0x40044271; pub const BIOCGHDRCMPLT: ::c_ulong = 0x40044274; pub const BIOCSHDRCMPLT: ::c_ulong = 0x80044275; + +// +pub const SIOCADDMULTI: ::c_ulong = 0x80206931; +pub const SIOCDELMULTI: ::c_ulong = 0x80206932; +pub const SIOCDIFADDR: ::c_ulong = 0x80206919; pub const SIOCGIFADDR: ::c_ulong = 0xc0206921; +pub const SIOCGIFBRDADDR: ::c_ulong = 0xc0206923; +pub const SIOCGIFDSTADDR: ::c_ulong = 0xc0206922; +pub const SIOCGIFFLAGS: ::c_ulong = 0xc0206911; +pub const SIOCGIFNETMASK: ::c_ulong = 0xc0206925; +pub const SIOCIFDESTROY: ::c_ulong = 0x80206979; +pub const SIOCSIFADDR: ::c_ulong = 0x8020690c; +pub const SIOCSIFBRDADDR: ::c_ulong = 0xc0206913; +pub const SIOCSIFDSTADDR: ::c_ulong = 0x8020690e; +pub const SIOCSIFFLAGS: ::c_ulong = 0xc0206910; +pub const SIOCSIFNETMASK: ::c_ulong = 0x80206916; pub const REG_BASIC: ::c_int = 0o0000; pub const REG_EXTENDED: ::c_int = 0o0001; @@ -541,6 +561,28 @@ pub const ITIMER_REAL: ::c_int = 0; pub const ITIMER_VIRTUAL: ::c_int = 1; pub const ITIMER_PROF: ::c_int = 2; +// + +// Bitmask values for rtm_addrs. +pub const RTA_DST: ::c_int = 0x1; +pub const RTA_GATEWAY: ::c_int = 0x2; +pub const RTA_NETMASK: ::c_int = 0x4; +pub const RTA_GENMASK: ::c_int = 0x8; +pub const RTA_IFP: ::c_int = 0x10; +pub const RTA_IFA: ::c_int = 0x20; +pub const RTA_AUTHOR: ::c_int = 0x40; +pub const RTA_BRD: ::c_int = 0x80; + +// Index offsets for sockaddr array for alternate internal encoding. +pub const RTAX_DST: ::c_int = 0; +pub const RTAX_GATEWAY: ::c_int = 1; +pub const RTAX_NETMASK: ::c_int = 2; +pub const RTAX_GENMASK: ::c_int = 3; +pub const RTAX_IFP: ::c_int = 4; +pub const RTAX_IFA: ::c_int = 5; +pub const RTAX_AUTHOR: ::c_int = 6; +pub const RTAX_BRD: ::c_int = 7; + f! { pub fn CMSG_FIRSTHDR(mhdr: *const ::msghdr) -> *mut ::cmsghdr { if (*mhdr).msg_controllen as usize >= ::mem::size_of::<::cmsghdr>() { diff --git a/src/unix/bsd/netbsdlike/mod.rs b/src/unix/bsd/netbsdlike/mod.rs index 35a8c0255be69..f5bf002c96e89 100644 --- a/src/unix/bsd/netbsdlike/mod.rs +++ b/src/unix/bsd/netbsdlike/mod.rs @@ -659,6 +659,11 @@ pub const RB_AUTOBOOT: ::c_int = 0; pub const TCP_INFO: ::c_int = 9; +// +pub const SIOCAIFADDR: ::c_ulong = 0x8020691a; +pub const SIOCIFCREATE: ::c_ulong = 0xc020697a; +pub const SIOCIFCREATE2: ::c_ulong = 0xc020697c; + #[link(name = "util")] extern "C" { pub fn setgrent(); diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs index 7c58e85c4434c..97c322820c751 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -782,6 +782,15 @@ s! { pub tcpi_snd_zerowin: u32, pub __tcpi_pad: [u32; 26], } + + // net/bpf.h + + pub struct bpf_stat { + pub bs_recv: u64, + pub bs_drop: u64, + pub bs_capt: u64, + pub bs_padding[u64; 13], + }; } s_no_extra_traits! { @@ -1857,6 +1866,21 @@ pub const BIOCSDLT: ::c_ulong = 0x80044278; pub const BIOCGSEESENT: ::c_ulong = 0x40044276; pub const BIOCSSEESENT: ::c_ulong = 0x80044277; +// +pub const BIOCGFEEDBACK: ::c_ulong = 0x4004427c; +pub const BIOCSFEEDBACK: ::c_ulong = 0x8004427d; +pub const BIOCFEEDBACK: ::c_ulong = ::BIOCSFEEDBACK; +pub const BIOCLOCK: ::c_ulong = 0x2004427e; + +// +pub const SIOCGIFCAP: ::c_ulong = 0xc0206976; +pub const SIOCSDRVSPEC: ::c_ulong = 0x8020697b; +pub const SIOCSIFCAP: ::c_ulong = 0x80206975; + +// +pub const SIOCAIFADDR_IN6: ::c_ulong = 0x8020696b; +pub const SIOCDIFADDR_IN6: ::c_ulong = 0x80206919; + // pub const MNT_UNION: ::c_int = 0x00000020; pub const MNT_NOCOREDUMP: ::c_int = 0x00008000; diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs index 357662547b8e3..fa51c4470b075 100644 --- a/src/unix/bsd/netbsdlike/openbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs @@ -604,6 +604,13 @@ s! { pub tcpi_so_snd_sb_lowat: u32, pub tcpi_so_snd_sb_wat: u32, } + + // net/bpf.h + + pub struct bpf_stat { + pub bs_recv: ::u_int, + pub bs_drop: ::u_int, + } } impl siginfo_t { @@ -1881,6 +1888,13 @@ pub const RB_RESET: ::c_int = 0x08000; pub const RB_GOODRANDOM: ::c_int = 0x10000; pub const RB_UNHIBERNATE: ::c_int = 0x20000; +// +pub const BIOCLOCK: ::c_ulong = 0x20004276; + +// +pub const SIOCAIFADDR_IN6: ::c_ulong = 0x8020691a; +pub const SIOCDIFADDR_IN6: ::c_ulong = 0x80206919; + const_fn! { {const} fn _ALIGN(p: usize) -> usize { (p + _ALIGNBYTES) & !_ALIGNBYTES