Commit Graph

683 Commits (741957f94598d149960a5296b2010a07ffac02e5)
 

Author SHA1 Message Date
Dave Tucker 713cd4e858 docs: Add crabby logo
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Davide Bertola 4f13576594
aya-gen: allow passing custom --ctypes-prefix to bindgen (#312)
Allows users to pass a custom --ctypes-prefix to bindgen #186
2 years ago
Alessandro Decina 7549eb979c
Merge pull request #315 from dave-tucker/sock
Add support for BPF_PROG_TYPE_CGROUP_SOCK
2 years ago
Dave Tucker 0786afa9ca
Merge pull request #319 from dave-tucker/moar-regs
bpf: bpf_probe_read_kernel fields in pt_regs
2 years ago
Dave Tucker cf3c8f355e ci: test aya-bpf-macros on nightly
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker 05c1586202 bpf: bpf_probe_read_kernel fields in pt_regs
As it turns out, the verifier gets upset if you try to read the values
directly without using bpf_probe_read.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker f3574b0e70
Merge pull request #318 from ishitatsuyuki/patch-1
bpf: Remove unnecessary Sync bound on PerCpuArray<T>
2 years ago
Tatsuyuki Ishi 5e24cf7a29
bpf: Remove unnecessary Sync bound on PerCpuArray<T> 2 years ago
Alessandro Decina 82cd3e695a ebpf: PerCpuArray: remove get_mut() and add get_ptr() and get_ptr_mut()
get_mut() wasn't sound as it allowed creating multiple mutable
references.
2 years ago
Alessandro Decina 1eb9ef5488
Merge pull request #290 from ishitatsuyuki/immut-self
bpf: Replace map types to use &self, remove HashMap::get_mut
2 years ago
Dave Tucker 7b21a2d17e aya: Implement BPF_PROG_TYPE_CGROUP_SOCK
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker 6f51b616e1 bpf: Implement BPF_PROG_TYPE_CGROUP_SOCK
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker 3f6b2507b6
Merge pull request #314 from dave-tucker/sockops
bpf: Add accessors to SockOpsContext
2 years ago
Dave Tucker 9d18a48c3c bpf: Add accessors to SockOpsContext
Allow getting family, remote/local v4/v6 addresses and the remote and
local ports.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker 52eb6bd1ef
Merge pull request #313 from aya-rs/add-code-of-conduct
Add a Code of Conduct
2 years ago
Dave Tucker e752ffb3be
Add a Code of Conduct
Adapted from the contributor covenant template
2 years ago
Alessandro Decina cffff273a1 aya-gen: fix lint 👀 2 years ago
Alessandro Decina e675e51bd9 aya-gen: re-export generate::{InputFile, generate} 2 years ago
Dave Tucker bbb5d7124a
Merge pull request #310 from dave-tucker/cross-ci
Enable CI for all supported architectures
2 years ago
Dave Tucker c725e72796 bpf: re-reun build.rs if env changed
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker e3c8c659a1 bpf: arm fix pt_regs handling
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker 88834c497d ci: Skip riscv64 for bpf
There is a missing pt_regs implementation in args.rs

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Tatsuyuki Ishi e852f7e0cc test: Update to use non-mut map types 2 years ago
Tatsuyuki Ishi 41c6b56142 bpf: Replace map types to use &self, remove HashMap::get_mut
The bpf_map_defs are now wrapped with UnsafeCell, which also happens to
provide a cozy way to get a *mut pointer. An UnsafeCell isn't strictly
required as the struct fields are practically opaque to us, but using an
UnsafeCell follows the general best practices against miscompilation and
also prevents some obvious errors.

HashMap::get_mut was removed because the idea is completely unsound.
Previous users should wrap their data with UnsafeCell instead or use
atomics.

Closes: https://github.com/aya-rs/aya/issues/233
2 years ago
Dave Tucker 218d4842d6 bpf: Be consistent with arm target_arch
This is `arm` in bindings but `armv7` in args.
Let's use `arm`

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker 7f6da53c34 bpf: Fix pt_regs for aarch64 (again)
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker 1d06b41e57 ci: Test all architectures
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker ef3b029d26
Merge pull request #309 from dave-tucker/bpf-regs-bug
bpf: Fix aarch64 access to regs
2 years ago
Dave Tucker 7e828df1c9 bpf: Fix aarch64 access to regs
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Davide Bertola cda9ab4f66 upgrade from structopt to clap 3 2 years ago
Davide Bertola 68bc11e42c
aya-gen cli rework (#297)
* update aya-gen from structopt to clap 3

* aya-gen: add --header option

* aya-gen: run bindgen as a child process

* aya-gen: add support for passing additional bindgen args
2 years ago
dependabot[bot] ddf26300c8 build(deps): update bindgen requirement from 0.59 to 0.60
Updates the requirements on [bindgen](https://github.com/rust-lang/rust-bindgen) to permit the latest version.
- [Release notes](https://github.com/rust-lang/rust-bindgen/releases)
- [Changelog](https://github.com/rust-lang/rust-bindgen/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/rust-bindgen/compare/v0.59.0...v0.60.1)

---
updated-dependencies:
- dependency-name: bindgen
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years ago
Dave Tucker 0cd1e51476 aya: Unload programs on drop
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Alessandro Decina d85b36f6d8 (cargo-release) version 0.11.0 2 years ago
Dave Tucker 4ae5bc4b9b
Merge pull request #306 from dave-tucker/take_link
aya: Rename forget_link to take_link
2 years ago
Dave Tucker b2a6f00212 aya: Rename forget_link to take_link
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker 79e06f2644
Merge pull request #299 from aya-rs/revert-298-fix-docs
Revert "docs: Merge search indexes"
2 years ago
crabby-the-crab de4e97aa51
Revert "docs: Merge search indexes" 2 years ago
Dave Tucker f275ce0274
Merge pull request #298 from dave-tucker/fix-docs
docs: Merge search indexes
2 years ago
Dave Tucker a00d16dc0e docs: Merge search indexes
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago
Dave Tucker de8ab7f415
Merge pull request #296 from aya-rs/codegen
Update libbpf to 4eb6485c08867edaa5a0a81c64ddb23580420340
2 years ago
dave-tucker bbb34b3285 [codegen] Update libbpf to 4eb6485c08867edaa5a0a81c64ddb23580420340Update libbpf to 4eb6485c08867edaa5a0a81c64ddb23580420340
Files changed:\nM	aya/src/generated/linux_bindings_aarch64.rs
M	aya/src/generated/linux_bindings_armv7.rs
M	aya/src/generated/linux_bindings_riscv64.rs
M	aya/src/generated/linux_bindings_x86_64.rs
2 years ago
Dave Tucker 934da6e851
Merge pull request #295 from ishitatsuyuki/ringbuf-codegen
Codegen changes for RingBuf
2 years ago
William Findlay 777e6a2a5d xtask/codegen: generate bindings for BPF_RINGBUF types 2 years ago
Davide Bertola e2685c98d8
Program unload API (#264)
aya: add `program.unload()` API
2 years ago
Alessandro Decina 6b1f47323b
Merge pull request #293 from dave-tucker/getters-be-gone
Getters be gone
2 years ago
Alessandro Decina 16337001e4
Merge pull request #286 from nak3/add-BPF_MAP_TYPE_BLOOM_FILTER
Add support for BPF_MAP_TYPE_BLOOM_FILTER
2 years ago
Kenjiro Nakayama c192817a59 Fix typo, take & to query the value 2 years ago
Kenjiro Nakayama c5d5695a71 Add missing BPF_MAP_TYPE_STACK in BPF code
Currently BPF_MAP_TYPE_STACK is supported by user code (`aya/src/maps/stack.rs`),
but it does not support the BPF_MAP_TYPE_STACK BPF code.

This patch fixes it.
2 years ago
Dave Tucker 8672ff6c56 bpf: Remove generated getters
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago