Commit Graph

774 Commits (7c244e1f65fdb80f65c6a317773f3ff069255cd8)
 

Author SHA1 Message Date
gianluigi a9c0fccb2e Add riscv64 bindings 3 years ago
Dave Tucker de1559ab77
Merge pull request #279 from aya-rs/codegen
Update libbpf to 47595c2f08aece55baaf21ed0b72f5c5abf2cb5e
3 years ago
dave-tucker 4767664d5d [codegen] Update libbpf to 47595c2f08aece55baaf21ed0b72f5c5abf2cb5eUpdate libbpf to 47595c2f08aece55baaf21ed0b72f5c5abf2cb5e
Files changed:\nM	aya/src/generated/linux_bindings_riscv64.rs
M	bpf/aya-bpf-bindings/src/riscv64/bindings.rs
M	bpf/aya-bpf-bindings/src/riscv64/getters.rs
M	bpf/aya-bpf-bindings/src/riscv64/helpers.rs
3 years ago
Dave Tucker ce7a8b7dc1
.github: gen - add rustfmt to toolchain 3 years ago
Dave Tucker b71fe64a10
Merge pull request #278 from dave-tucker/riscv
riscv scaffolding for codegen
3 years ago
Dave Tucker 8b7950bb0f .github: use nightly for codegen
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Dave Tucker edaa70b5ba riscv scaffolding for codegen
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Dave Tucker 3acd8d3650
Merge pull request #275 from krsh/riscv64-arch
Add riscv64 architecture support to xtask/codegen
3 years ago
gianluigi d35680f30c Add riscv64 architecture support to xtask/codegen 3 years ago
Dave Tucker 0d7fb4472d
Merge pull request #276 from dave-tucker/clippy
clippy: fix new lints on nightly
3 years ago
Dave Tucker 4a32e7d985 clippy: fix new lints on nightly
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Michal Rostecki 3262f85925 bpf(doc): Hide docs of bindings
Before this change, documentation of helper functions (defined by us,
not bindings) were not visible, because `use gen::*` was overriding them
with helpers coming from aya-bpf-bindings, which have the same names and
no docs.

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
3 years ago
Amos Wenger a1e7b58d7c Don't use #[no_mangle] (clashes with `#[export_name]`)
This closes #270.

With this, the symbol name is correct in the intermediate LLVM bitcode
object file (`.rcgu.o`) and in the final BPF program.
3 years ago
Dave Tucker 9904237ac1
Merge pull request #273 from dave-tucker/fix_sidebar
xtask: Add all crates to sidebar
3 years ago
Dave Tucker ba312c48d5 xtask: Add all crates to sidebar
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Kenjiro Nakayama e68d734c68
Add support for BPF_PROG_TYPE_CGROUP_SOCKOPT (#268) 3 years ago
Alessandro Decina 63b6286bd9
Merge pull request #263 from nak3/cgroup-skb-attach-type
Set attach type during load for BPF_PROG_TYPE_CGROUP_SKB
3 years ago
Alessandro Decina aacf6ec110
Merge pull request #267 from aya-rs/codegen
Update libbpf to 86eb09863c1c0177e99c2c703092042d3cdba910
3 years ago
alessandrod 7f7c78ad6b [codegen] Update libbpf to 86eb09863c1c0177e99c2c703092042d3cdba910Update libbpf to 86eb09863c1c0177e99c2c703092042d3cdba910
Files changed:\nM	aya/src/generated/linux_bindings_aarch64.rs
M	aya/src/generated/linux_bindings_armv7.rs
M	aya/src/generated/linux_bindings_x86_64.rs
M	bpf/aya-bpf-bindings/src/aarch64/bindings.rs
M	bpf/aya-bpf-bindings/src/aarch64/getters.rs
M	bpf/aya-bpf-bindings/src/aarch64/helpers.rs
M	bpf/aya-bpf-bindings/src/armv7/bindings.rs
M	bpf/aya-bpf-bindings/src/armv7/getters.rs
M	bpf/aya-bpf-bindings/src/armv7/helpers.rs
M	bpf/aya-bpf-bindings/src/x86_64/bindings.rs
M	bpf/aya-bpf-bindings/src/x86_64/getters.rs
M	bpf/aya-bpf-bindings/src/x86_64/helpers.rs
3 years ago
Alessandro Decina daf3386601
Merge pull request #266 from nak3/add-sk_type
xtask: Add `bpf_.*` instead of `bpf_map_.*` to allowed type
3 years ago
Kenjiro Nakayama 42baf1c074 Remove bpf_adj_room_mode 3 years ago
Kenjiro Nakayama 5d228695a4 Use map() 3 years ago
Alessandro Decina 8fd8816dfd
Merge pull request #261 from dave-tucker/cgroup_sock
Add Support for BPF_PROG_TYPE_CGROUP_SOCK_ADDR
3 years ago
Kenjiro Nakayama 200d42e414 xtask: Add `bpf_.*` instead of `bpf_map_.*` to allowed type
This patch replaces `bpf_map_.*` with `bpf_.*`.

Currently some types that are not used in helper functions are not generated for bindings - e.g. `bpf_sk_lookup`, `bpf_sockopt` and etc.
This patch replaces `bpf_map_.*` with `bpf_.*`.

Note, this PR does not include bindings files as it would be better to be created by auto script.
The missing bindings can be created by `cargo xtask codegen --libbpf-dir /<PATH_TO>/libbp`.
3 years ago
Dave Tucker 2bac924464 bpf: Add support for BPF_PROG_TYPE_CGROUP_SOCK_ADDR
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Dave Tucker af54b6c818 aya: Add BPF_PROG_TYPE_CGROUP_SOCK_ADDR
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Kenjiro Nakayama 29c10fafb7 Set attach type during load for BPF_PROG_TYPE_CGROUP_SKB
As per title, this patch sets `expected_attach_type` during load.
3 years ago
Alessandro Decina 41a27e3784
Merge pull request #260 from dave-tucker/netlify
Add Netlify Config and Update README
3 years ago
Dave Tucker 7e6530ff1e readme: Add unreleased docs link
This rearranges the README to use fancy badges!
And adds links to the docs published on netlify.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Dave Tucker 713ea349fd docs: Add netlify.toml
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Dave Tucker 5ff672d8a0
Merge pull request #259 from dave-tucker/xtask
xtask: Add docs build
3 years ago
Dave Tucker 8205bee930 xtask: Add docs build
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Kenjiro Nakayama f721021a0a
Add support for BPF_PROG_TYPE_CGROUP_SYSCTL (#256)
* Add support for BPF_PROG_TYPE_CGROUP_SYSCTL

This patch adds support for `BPF_PROG_TYPE_CGROUP_SYSCTL`.

* Parse unnamed macro

* Fix docs
3 years ago
Dave Tucker 2fca4aee4e
Merge pull request #253 from dave-tucker/forget
aya: Implement forget_link
3 years ago
Dave Tucker 8069ad14d0 aya: Implement forget_link
Fixes #51

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Alessandro Decina b9a544831c
Merge pull request #255 from NoneTirex/main
aya-bpf: Set skb_buff visbility to pub
3 years ago
tirex f1f7185dab Set skb_buff visbility to pub 3 years ago
Alessandro Decina e71e07f88e
Merge pull request #254 from dave-tucker/clippy
clippy: Fix lint against latest nightly
3 years ago
Dave Tucker cdaa3af5ae clippy: Fix lint against latest nightly
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Dave Tucker 4afc5ea711
Merge pull request #252 from dave-tucker/multimap-relo
aya: Relocate maps using symbol_index
3 years ago
Dave Tucker d1f2215193 aya: Relocate maps using symbol_index
Since we support multiple maps in the same section, the section_index is
no longer a unique way to identify maps. This commit uses the symbol
index as the identifier, but falls back to section_index for rodata
and bss maps since we don't retrieve the symbol_index during parsing.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Alessandro Decina 4e57d1fe32 aya: revert version to 0.10.7
The world isn't ready to have pre-releases in git
3 years ago
Dave Tucker e1f448e6b7
Merge pull request #251 from aya-rs/codegen
Update libbpf to 3a4e26307d0f9b227e3ebd28b443a1a715e4e17d
3 years ago
dave-tucker d6ca3e1ae7 [codegen] Update libbpf to 3a4e26307d0f9b227e3ebd28b443a1a715e4e17dUpdate libbpf to 3a4e26307d0f9b227e3ebd28b443a1a715e4e17d
Files changed:\nM	aya/src/generated/linux_bindings_aarch64.rs
M	aya/src/generated/linux_bindings_armv7.rs
M	aya/src/generated/linux_bindings_x86_64.rs
M	bpf/aya-bpf-bindings/src/aarch64/bindings.rs
M	bpf/aya-bpf-bindings/src/aarch64/getters.rs
M	bpf/aya-bpf-bindings/src/aarch64/helpers.rs
M	bpf/aya-bpf-bindings/src/armv7/bindings.rs
M	bpf/aya-bpf-bindings/src/armv7/getters.rs
M	bpf/aya-bpf-bindings/src/armv7/helpers.rs
M	bpf/aya-bpf-bindings/src/x86_64/bindings.rs
M	bpf/aya-bpf-bindings/src/x86_64/getters.rs
M	bpf/aya-bpf-bindings/src/x86_64/helpers.rs
3 years ago
Dave Tucker b039ac524e
Merge pull request #249 from alessandrod/new-links
aya: rework links
3 years ago
Dave Tucker e2ebd85d5c
Merge pull request #250 from vadorovsky/aya-gen-disable-debug
aya-gen: Disable Debug derive for BTF types
3 years ago
Michal Rostecki bd336acb02 aya-gen: Disable Debug derive for BTF types
It's a workaround for the upstream bindgen issue:

https://github.com/rust-lang/rust-bindgen/issues/2083

tl;dr: Rust nightly complains about #[repr(packed)] structs deriving
Debug without Copy.

It needs to be fixed properly upstream, but for now we have to disable
Debug derive here.

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
3 years ago
Alessandro Decina 69cc844bbf
Merge pull request #248 from dave-tucker/map_sec
bpf: Maps live in maps section
3 years ago
Dave Tucker f12c0269d0 bpf: Maps live in maps section
This forces all maps to the maps section so we remain compatible with
libbpf. This requires #181 to avoid breaking userspace.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Alessandro Decina cb57d10d25 aya: rework links
Remove LinkRef and remove the Rc<RefCell<_>> that was used to store
type-erased link values in ProgramData. Among other things, this allows
`Bpf` to be `Send`, which makes it easier to use it with async runtimes.

Change the link API to:

    let link_id = prog.attach(...)?;
    ...
    prog.detach(link_id)?;

Link ids are strongly typed, so it's impossible to eg:

    let link_id = uprobe.attach(...)?;
    xdp.detach(link_id);

As it would result in a compile time error.

Links are still stored inside ProgramData, and unless detached
explicitly, they are automatically detached when the parent program gets
dropped.
3 years ago