#bpf #ebpf #xdp #linux #kernel

bpf-rs

A safe, lean library for inspecting and querying eBPF objects

10 unstable releases (3 breaking)

Uses new Rust 2021

0.3.0 Aug 28, 2022
0.2.0 Jul 15, 2022
0.1.0 May 22, 2022
0.0.9 May 9, 2022
0.0.6 Apr 25, 2022

#327 in Unix APIs

Download history 10/week @ 2022-06-12 5/week @ 2022-06-19 3/week @ 2022-06-26 22/week @ 2022-07-03 40/week @ 2022-07-10 34/week @ 2022-07-17 36/week @ 2022-07-24 16/week @ 2022-07-31 7/week @ 2022-08-07 4/week @ 2022-08-14 15/week @ 2022-08-21 23/week @ 2022-08-28 46/week @ 2022-09-04 5/week @ 2022-09-11 4/week @ 2022-09-18 11/week @ 2022-09-25

69 downloads per month
Used in bpf-feature

BSD-2-Clause

50KB
963 lines

bpf-rs

A safe, flexible library for inspecting and querying eBPF objects.


Background

It is based upon the work of libbpf-sys to safely create wrappers around libbpf. A lot of the design & inspiration stems from bpftool and libbpf-rs.

This crate is NOT meant to help with the writing and loading of eBPF programs and maps. For that, we highly recommend libbpf-rs and libbpf-cargo.

The goal of this library is to aid in eBPF clients interested in managing and monitoring their host's eBPF objects. As an example of this use case, check out bpf-feature.

Install

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

To use in your project, add into your Cargo.toml:

[dependencies]
bpf-rs = "0.3.0"

or using cargo-edit:

$ cargo add bpf-rs

Documentation

See documentation here

License

BSD 2-Clause - Maintained by bpfdeploy.io

Dependencies

~1.4–2MB
~50K SLoC