Skip to content

bpfdeploy-io/bpf-rs

Repository files navigation

bpf-rs

A collection of Rust crates for inspecting & managing eBPF objects.


crates.io badge crates.io badge crates.io badge

A core library for managing eBPF objects, focused on ergonomics and serialization.

See documentation here

crates.io badge crates.io badge crates.io badge

An eBPF feature detection library based on bpftool's feature subcommand.

Clients can determine available bpf features (such as program & map types, kernel config values, bpf helper functions etc.) supported in their current kernels.

See documentation here

See examples here

crates.io badge

A work-in-progress library to aid in the dumping of eBPF programs and maps.

Contributing & Testing

The development here was based on a Debian-based distro on the x86_64 arch against a v5.18 Linux kernel version. The eBPF landscape is progressing quickly but with an eye towards backward compatibility. We aim to do the same so if an issue occurs in your environment, please feel free to file an issue.

Testing

This project uses just as its task runner. You can run tests locally with:

$ just test

Licenses

Most, if not all, of the crates published here fall under the permissive BSD 2-Clause license.

Acknowledgements

A lot of the techniques here were inspired by bpftool, libbpf and libbpf-rs. We aim to support these efforts by contributing back and directly referencing them as the canonical implementations.

Maintained by bpfdeploy.io