Add struct `bpf_hdr` on macOS

This commit is contained in:
luozijun 2017-12-26 15:57:11 +08:00
parent 5221616a77
commit 629908abe3
3 changed files with 15 additions and 0 deletions

View File

@ -170,6 +170,7 @@ fn main() {
cfg.header("sys/xattr.h");
cfg.header("sys/sys_domain.h");
cfg.header("net/if_utun.h");
cfg.header("net/bpf.h");
if target.starts_with("x86") {
cfg.header("crt_externs.h");
}

View File

@ -41,6 +41,13 @@ s! {
pub ifi_reserved1: u32,
pub ifi_reserved2: u32,
}
pub struct bpf_hdr {
pub bh_tstamp: ::timeval,
pub bh_caplen: ::uint32_t,
pub bh_datalen: ::uint32_t,
pub bh_hdrlen: ::c_ushort,
}
}
pub const __PTHREAD_MUTEX_SIZE__: usize = 40;

View File

@ -46,6 +46,13 @@ s! {
pub ifi_reserved1: u32,
pub ifi_reserved2: u32,
}
pub struct bpf_hdr {
pub bh_tstamp: ::timeval32,
pub bh_caplen: ::uint32_t,
pub bh_datalen: ::uint32_t,
pub bh_hdrlen: ::c_ushort,
}
}
pub const __PTHREAD_MUTEX_SIZE__: usize = 56;