Open willfindlay opened 3 years ago
Oh absolutely! Docs - both on how to contribute and how to use the library - are my personal #1 priority right now.
In the meantime:
aya
crate includes the user space library, that is what is used to load and attach eBPF programsxtask
crate is an internal crate used to automate some tasks, see https://github.com/matklad/cargo-xtaskaya-gen
is a crate (and a binary) used to generate rust bindings from BTF debug info. It's used to generate some internal bindings used by the aya
crate, and for some bindings exported by aya-bpf
.aya-bpf
is a crate you can use from eBPF programs (so kernel side). It provides a high level API for maps and programs similar to the API aya
exports in userspace. It also exports proc_macro
s you can use to simplify defining programs, eg:
#[classifier(name = "ingress_filter")]
fn tc_cls_ingress_proxy(skb: SkSkbContext) -> i32 {
match try_tc_cls_ingress_filter(skb) {
Ok(ret) => ret,
Err(_) => TC_ACT_OK as i32,
}
}
aya-bpf-bindings
includes generated bindings for bpf-helpers and some common eBPF kernel structs, it's re-exported by aya-bpf
.aya-bpf-macros
includes the proc_macro
s used to define eBPF programs. Also re-exported by aya-bpf
. Thanks for the high-level explanation, that helps quite a lot. :)
I think an ARCHITECTURE.md would also go a long way for getting new contributors up to speed. Even something simple that describes what each crate is for, etc. This looks like an awesome (and very promising) project, and I would love to contribute, but the number of crates and subcrates in this workspace can be a bit overwhelming at first glance. Thanks a lot for your work on the library :)