summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lee <jbit@jbit.net>2021-02-25 17:18:07 +1100
committerJames Lee <jbit@jbit.net>2021-02-25 17:18:07 +1100
commit4b55c8715cf41d5b6848ea2d5ea26a5a58c0e7fe (patch)
treef22ccc7ba49deff5fc099806fb4c737417fd0e9d
parented1256a366d6059266eb8c1df3f5b1b48dd11622 (diff)
downloadrust-libc-4b55c8715cf41d5b6848ea2d5ea26a5a58c0e7fe.tar.gz
Add BPF structures for FreeBSD
-rw-r--r--src/unix/bsd/freebsdlike/mod.rs36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs
index b2c896d801..94d30972e8 100644
--- a/src/unix/bsd/freebsdlike/mod.rs
+++ b/src/unix/bsd/freebsdlike/mod.rs
@@ -272,6 +272,42 @@ s! {
pub piod_len: ::size_t,
}
+ // bpf.h
+
+ pub struct bpf_program {
+ pub bf_len: ::c_uint,
+ pub bf_insns: *mut bpf_insn,
+ }
+
+ pub struct bpf_stat {
+ pub bs_recv: ::c_uint,
+ 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,
+ pub bh_datalen: u32,
+ pub bh_hdrlen: ::c_ushort,
+ }
+
+ pub struct bpf_insn {
+ pub code: ::c_ushort,
+ pub jt: ::c_uchar,
+ pub jf: ::c_uchar,
+ pub k: u32,
+ }
+
+ pub struct bpf_dltlist {
+ bfl_len: ::c_uint,
+ bfl_list: *mut ::c_uint,
+ }
+
// elf.h
pub struct Elf32_Phdr {