diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b64146de..8078b744 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,7 +56,7 @@ jobs: set -euxo pipefail cargo hack miri test --all-targets --feature-powerset \ --exclude aya-bpf \ - --exclude aya-bpf-bindings \ + --exclude aya-ebpf-bindings \ --exclude aya-log-ebpf \ --exclude integration-ebpf \ --exclude integration-test \ @@ -93,7 +93,7 @@ jobs: set -euxo pipefail cargo hack build --all-targets --feature-powerset \ --exclude aya-bpf \ - --exclude aya-bpf-bindings \ + --exclude aya-ebpf-bindings \ --exclude aya-log-ebpf \ --exclude integration-ebpf \ --workspace @@ -105,7 +105,7 @@ jobs: set -euxo pipefail cargo hack test --all-targets --feature-powerset \ --exclude aya-bpf \ - --exclude aya-bpf-bindings \ + --exclude aya-ebpf-bindings \ --exclude aya-log-ebpf \ --exclude integration-ebpf \ --exclude integration-test \ @@ -118,7 +118,7 @@ jobs: set -euxo pipefail cargo hack test --doc --feature-powerset \ --exclude aya-bpf \ - --exclude aya-bpf-bindings \ + --exclude aya-ebpf-bindings \ --exclude aya-log-ebpf \ --exclude init \ --exclude integration-ebpf \ diff --git a/Cargo.toml b/Cargo.toml index 9812e45b..02d31299 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ members = [ # ebpf crates "ebpf/aya-bpf", - "ebpf/aya-bpf-bindings", + "ebpf/aya-ebpf-bindings", "ebpf/aya-log-ebpf", "test/integration-ebpf", ] diff --git a/aya/CHANGELOG.md b/aya/CHANGELOG.md index 131e5e9f..9ce08d15 100644 --- a/aya/CHANGELOG.md +++ b/aya/CHANGELOG.md @@ -2032,7 +2032,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Don't error out parsing padded map sections ([`b657930`](https://github.com/aya-rs/aya/commit/b657930a3ee61f88ada0630afdac6b1c77459244)) - Added support for armv7-unknown-linux-gnueabi and armv7-unknown-linux-gnueabihf ([`8311abf`](https://github.com/aya-rs/aya/commit/8311abfdcbbe70da6abdd67b78b831d53998aad5)) - Tc: make qdisc_add_clsact return io::Error ([`9c8e78b`](https://github.com/aya-rs/aya/commit/9c8e78b7d4192b376ec2e532d9ddcf81c3c5182e)) - - Aya, aya-bpf-bindings: regenerate bindings ([`122a530`](https://github.com/aya-rs/aya/commit/122a5306e72c7560629bcef160e7f676b84eabd7)) + - Aya, aya-ebpf-bindings: regenerate bindings ([`122a530`](https://github.com/aya-rs/aya/commit/122a5306e72c7560629bcef160e7f676b84eabd7)) - Kprobe: remove pid argument ([`08c71df`](https://github.com/aya-rs/aya/commit/08c71dfeb19b2b4358d75baf5b95f8d4e6521935)) - Add missing load() in kprobe example ([`bb15e82`](https://github.com/aya-rs/aya/commit/bb15e82c1d8373700dda52f69d6c4bf6f5489a03)) - Support both bpf_map_def layout variants ([`d8d3117`](https://github.com/aya-rs/aya/commit/d8d311738c974f3b6fad22006ab2b827d0925ce8)) diff --git a/ebpf/aya-bpf/Cargo.toml b/ebpf/aya-bpf/Cargo.toml index ccfb6c11..44059ef3 100644 --- a/ebpf/aya-bpf/Cargo.toml +++ b/ebpf/aya-bpf/Cargo.toml @@ -11,7 +11,7 @@ edition.workspace = true [dependencies] aya-ebpf-cty = { path = "../aya-ebpf-cty" } aya-bpf-macros = { path = "../../aya-bpf-macros" } -aya-bpf-bindings = { path = "../aya-bpf-bindings" } +aya-ebpf-bindings = { path = "../aya-ebpf-bindings" } const-assert = { workspace = true, optional = true } [build-dependencies] diff --git a/ebpf/aya-bpf/src/helpers.rs b/ebpf/aya-bpf/src/helpers.rs index 169c83ac..0a26e48c 100644 --- a/ebpf/aya-bpf/src/helpers.rs +++ b/ebpf/aya-bpf/src/helpers.rs @@ -9,7 +9,7 @@ use core::mem::{self, MaybeUninit}; -pub use aya_bpf_bindings::helpers as gen; +pub use aya_ebpf_bindings::helpers as gen; #[doc(hidden)] pub use gen::*; diff --git a/ebpf/aya-bpf/src/lib.rs b/ebpf/aya-bpf/src/lib.rs index 89875339..9e6fb28e 100644 --- a/ebpf/aya-bpf/src/lib.rs +++ b/ebpf/aya-bpf/src/lib.rs @@ -19,7 +19,7 @@ #![warn(clippy::cast_lossless, clippy::cast_sign_loss)] #![no_std] -pub use aya_bpf_bindings::bindings; +pub use aya_ebpf_bindings::bindings; mod args; pub use args::PtRegs; diff --git a/ebpf/aya-bpf/src/maps/hash_map.rs b/ebpf/aya-bpf/src/maps/hash_map.rs index 04dd7d4c..765188dc 100644 --- a/ebpf/aya-bpf/src/maps/hash_map.rs +++ b/ebpf/aya-bpf/src/maps/hash_map.rs @@ -1,6 +1,6 @@ use core::{cell::UnsafeCell, marker::PhantomData, mem, ptr::NonNull}; -use aya_bpf_bindings::bindings::bpf_map_type::{ +use aya_ebpf_bindings::bindings::bpf_map_type::{ BPF_MAP_TYPE_LRU_HASH, BPF_MAP_TYPE_LRU_PERCPU_HASH, BPF_MAP_TYPE_PERCPU_HASH, }; use aya_ebpf_cty::{c_long, c_void}; diff --git a/ebpf/aya-bpf/src/maps/lpm_trie.rs b/ebpf/aya-bpf/src/maps/lpm_trie.rs index 4b68435a..16f94726 100644 --- a/ebpf/aya-bpf/src/maps/lpm_trie.rs +++ b/ebpf/aya-bpf/src/maps/lpm_trie.rs @@ -1,6 +1,6 @@ use core::{cell::UnsafeCell, marker::PhantomData, mem, ptr::NonNull}; -use aya_bpf_bindings::bindings::BPF_F_NO_PREALLOC; +use aya_ebpf_bindings::bindings::BPF_F_NO_PREALLOC; use aya_ebpf_cty::{c_long, c_void}; use crate::{ diff --git a/ebpf/aya-bpf/src/maps/xdp/cpu_map.rs b/ebpf/aya-bpf/src/maps/xdp/cpu_map.rs index 6a86351a..5f89f67a 100644 --- a/ebpf/aya-bpf/src/maps/xdp/cpu_map.rs +++ b/ebpf/aya-bpf/src/maps/xdp/cpu_map.rs @@ -1,6 +1,6 @@ use core::{cell::UnsafeCell, mem}; -use aya_bpf_bindings::bindings::bpf_cpumap_val; +use aya_ebpf_bindings::bindings::bpf_cpumap_val; use super::try_redirect_map; use crate::{ diff --git a/ebpf/aya-bpf/src/maps/xdp/dev_map.rs b/ebpf/aya-bpf/src/maps/xdp/dev_map.rs index b5b56b7e..98828df6 100644 --- a/ebpf/aya-bpf/src/maps/xdp/dev_map.rs +++ b/ebpf/aya-bpf/src/maps/xdp/dev_map.rs @@ -1,6 +1,6 @@ use core::{cell::UnsafeCell, mem, num::NonZeroU32, ptr::NonNull}; -use aya_bpf_bindings::bindings::bpf_devmap_val; +use aya_ebpf_bindings::bindings::bpf_devmap_val; use aya_ebpf_cty::c_void; use super::try_redirect_map; diff --git a/ebpf/aya-bpf/src/maps/xdp/dev_map_hash.rs b/ebpf/aya-bpf/src/maps/xdp/dev_map_hash.rs index c86b579d..85cb8622 100644 --- a/ebpf/aya-bpf/src/maps/xdp/dev_map_hash.rs +++ b/ebpf/aya-bpf/src/maps/xdp/dev_map_hash.rs @@ -1,6 +1,6 @@ use core::{cell::UnsafeCell, mem, num::NonZeroU32, ptr::NonNull}; -use aya_bpf_bindings::bindings::bpf_devmap_val; +use aya_ebpf_bindings::bindings::bpf_devmap_val; use aya_ebpf_cty::c_void; use super::{dev_map::DevMapValue, try_redirect_map}; diff --git a/ebpf/aya-bpf/src/maps/xdp/mod.rs b/ebpf/aya-bpf/src/maps/xdp/mod.rs index 5c8df0e5..fdb2af35 100644 --- a/ebpf/aya-bpf/src/maps/xdp/mod.rs +++ b/ebpf/aya-bpf/src/maps/xdp/mod.rs @@ -5,7 +5,7 @@ mod xsk_map; use core::cell::UnsafeCell; -use aya_bpf_bindings::{ +use aya_ebpf_bindings::{ bindings::{bpf_map_def, xdp_action::XDP_REDIRECT}, helpers::bpf_redirect_map, }; diff --git a/ebpf/aya-bpf/src/maps/xdp/xsk_map.rs b/ebpf/aya-bpf/src/maps/xdp/xsk_map.rs index 9f0dd125..830b0307 100644 --- a/ebpf/aya-bpf/src/maps/xdp/xsk_map.rs +++ b/ebpf/aya-bpf/src/maps/xdp/xsk_map.rs @@ -1,6 +1,6 @@ use core::{cell::UnsafeCell, mem, ptr::NonNull}; -use aya_bpf_bindings::bindings::bpf_xdp_sock; +use aya_ebpf_bindings::bindings::bpf_xdp_sock; use aya_ebpf_cty::c_void; use super::try_redirect_map; diff --git a/ebpf/aya-bpf/src/programs/sk_buff.rs b/ebpf/aya-bpf/src/programs/sk_buff.rs index 92d12aa3..7602417f 100644 --- a/ebpf/aya-bpf/src/programs/sk_buff.rs +++ b/ebpf/aya-bpf/src/programs/sk_buff.rs @@ -3,7 +3,7 @@ use core::{ mem::{self, MaybeUninit}, }; -use aya_bpf_bindings::helpers::{ +use aya_ebpf_bindings::helpers::{ bpf_clone_redirect, bpf_get_socket_uid, bpf_l3_csum_replace, bpf_l4_csum_replace, bpf_skb_adjust_room, bpf_skb_change_proto, bpf_skb_change_type, bpf_skb_load_bytes, bpf_skb_pull_data, bpf_skb_store_bytes, diff --git a/ebpf/aya-bpf/src/programs/sock_ops.rs b/ebpf/aya-bpf/src/programs/sock_ops.rs index 4baa469b..9b23c213 100644 --- a/ebpf/aya-bpf/src/programs/sock_ops.rs +++ b/ebpf/aya-bpf/src/programs/sock_ops.rs @@ -1,6 +1,6 @@ use core::ffi::c_void; -use aya_bpf_bindings::helpers::bpf_sock_ops_cb_flags_set; +use aya_ebpf_bindings::helpers::bpf_sock_ops_cb_flags_set; use crate::{bindings::bpf_sock_ops, BpfContext}; diff --git a/ebpf/aya-bpf-bindings/Cargo.toml b/ebpf/aya-ebpf-bindings/Cargo.toml similarity index 91% rename from ebpf/aya-bpf-bindings/Cargo.toml rename to ebpf/aya-ebpf-bindings/Cargo.toml index 2d323b6c..25b1babd 100644 --- a/ebpf/aya-bpf-bindings/Cargo.toml +++ b/ebpf/aya-ebpf-bindings/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "aya-bpf-bindings" +name = "aya-ebpf-bindings" version = "0.1.0" description = "Bindings for Linux Kernel eBPF types and helpers" authors.workspace = true diff --git a/ebpf/aya-bpf-bindings/build.rs b/ebpf/aya-ebpf-bindings/build.rs similarity index 100% rename from ebpf/aya-bpf-bindings/build.rs rename to ebpf/aya-ebpf-bindings/build.rs diff --git a/ebpf/aya-bpf-bindings/include/bindings.h b/ebpf/aya-ebpf-bindings/include/bindings.h similarity index 100% rename from ebpf/aya-bpf-bindings/include/bindings.h rename to ebpf/aya-ebpf-bindings/include/bindings.h diff --git a/ebpf/aya-bpf-bindings/src/aarch64/bindings.rs b/ebpf/aya-ebpf-bindings/src/aarch64/bindings.rs similarity index 100% rename from ebpf/aya-bpf-bindings/src/aarch64/bindings.rs rename to ebpf/aya-ebpf-bindings/src/aarch64/bindings.rs diff --git a/ebpf/aya-bpf-bindings/src/aarch64/helpers.rs b/ebpf/aya-ebpf-bindings/src/aarch64/helpers.rs similarity index 100% rename from ebpf/aya-bpf-bindings/src/aarch64/helpers.rs rename to ebpf/aya-ebpf-bindings/src/aarch64/helpers.rs diff --git a/ebpf/aya-bpf-bindings/src/aarch64/mod.rs b/ebpf/aya-ebpf-bindings/src/aarch64/mod.rs similarity index 100% rename from ebpf/aya-bpf-bindings/src/aarch64/mod.rs rename to ebpf/aya-ebpf-bindings/src/aarch64/mod.rs diff --git a/ebpf/aya-bpf-bindings/src/armv7/bindings.rs b/ebpf/aya-ebpf-bindings/src/armv7/bindings.rs similarity index 100% rename from ebpf/aya-bpf-bindings/src/armv7/bindings.rs rename to ebpf/aya-ebpf-bindings/src/armv7/bindings.rs diff --git a/ebpf/aya-bpf-bindings/src/armv7/helpers.rs b/ebpf/aya-ebpf-bindings/src/armv7/helpers.rs similarity index 100% rename from ebpf/aya-bpf-bindings/src/armv7/helpers.rs rename to ebpf/aya-ebpf-bindings/src/armv7/helpers.rs diff --git a/ebpf/aya-bpf-bindings/src/armv7/mod.rs b/ebpf/aya-ebpf-bindings/src/armv7/mod.rs similarity index 100% rename from ebpf/aya-bpf-bindings/src/armv7/mod.rs rename to ebpf/aya-ebpf-bindings/src/armv7/mod.rs diff --git a/ebpf/aya-bpf-bindings/src/lib.rs b/ebpf/aya-ebpf-bindings/src/lib.rs similarity index 100% rename from ebpf/aya-bpf-bindings/src/lib.rs rename to ebpf/aya-ebpf-bindings/src/lib.rs diff --git a/ebpf/aya-bpf-bindings/src/riscv64/bindings.rs b/ebpf/aya-ebpf-bindings/src/riscv64/bindings.rs similarity index 100% rename from ebpf/aya-bpf-bindings/src/riscv64/bindings.rs rename to ebpf/aya-ebpf-bindings/src/riscv64/bindings.rs diff --git a/ebpf/aya-bpf-bindings/src/riscv64/helpers.rs b/ebpf/aya-ebpf-bindings/src/riscv64/helpers.rs similarity index 100% rename from ebpf/aya-bpf-bindings/src/riscv64/helpers.rs rename to ebpf/aya-ebpf-bindings/src/riscv64/helpers.rs diff --git a/ebpf/aya-bpf-bindings/src/riscv64/mod.rs b/ebpf/aya-ebpf-bindings/src/riscv64/mod.rs similarity index 100% rename from ebpf/aya-bpf-bindings/src/riscv64/mod.rs rename to ebpf/aya-ebpf-bindings/src/riscv64/mod.rs diff --git a/ebpf/aya-bpf-bindings/src/x86_64/bindings.rs b/ebpf/aya-ebpf-bindings/src/x86_64/bindings.rs similarity index 100% rename from ebpf/aya-bpf-bindings/src/x86_64/bindings.rs rename to ebpf/aya-ebpf-bindings/src/x86_64/bindings.rs diff --git a/ebpf/aya-bpf-bindings/src/x86_64/helpers.rs b/ebpf/aya-ebpf-bindings/src/x86_64/helpers.rs similarity index 100% rename from ebpf/aya-bpf-bindings/src/x86_64/helpers.rs rename to ebpf/aya-ebpf-bindings/src/x86_64/helpers.rs diff --git a/ebpf/aya-bpf-bindings/src/x86_64/mod.rs b/ebpf/aya-ebpf-bindings/src/x86_64/mod.rs similarity index 100% rename from ebpf/aya-bpf-bindings/src/x86_64/mod.rs rename to ebpf/aya-ebpf-bindings/src/x86_64/mod.rs diff --git a/xtask/src/codegen/aya_bpf_bindings.rs b/xtask/src/codegen/aya_ebpf_bindings.rs similarity index 95% rename from xtask/src/codegen/aya_bpf_bindings.rs rename to xtask/src/codegen/aya_ebpf_bindings.rs index 790847cd..23189466 100644 --- a/xtask/src/codegen/aya_bpf_bindings.rs +++ b/xtask/src/codegen/aya_ebpf_bindings.rs @@ -19,18 +19,18 @@ pub fn codegen(opts: &SysrootOptions, libbpf_dir: &Path) -> Result<(), anyhow::E riscv64_sysroot, } = opts; - let dir = PathBuf::from("bpf/aya-bpf-bindings"); + let dir = PathBuf::from("bpf/aya-ebpf-bindings"); let builder = || { let mut bindgen = bindgen::bpf_builder() .header(&*dir.join("include/bindings.h").to_string_lossy()) // aya-tool uses aya_bpf::cty. We can't use that here since aya-bpf - // depends on aya-bpf-bindings so it would create a circular dep. + // depends on aya-ebpf-bindings so it would create a circular dep. .ctypes_prefix("::aya_ebpf_cty") .clang_args(&["-I", &*libbpf_dir.join("include/uapi").to_string_lossy()]) .clang_args(&["-I", &*libbpf_dir.join("include").to_string_lossy()]) .clang_args(&["-I", &*libbpf_dir.join("src").to_string_lossy()]) - // open aya-bpf-bindings/.../bindings.rs and look for mod + // open aya-ebpf-bindings/.../bindings.rs and look for mod // _bindgen, those are anonymous enums .constified_enum("BPF_F_.*") .constified_enum("BPF_REG_.*") diff --git a/xtask/src/codegen/mod.rs b/xtask/src/codegen/mod.rs index 9645be6d..4c279684 100644 --- a/xtask/src/codegen/mod.rs +++ b/xtask/src/codegen/mod.rs @@ -1,5 +1,5 @@ mod aya; -mod aya_bpf_bindings; +mod aya_ebpf_bindings; mod helpers; use std::path::{Path, PathBuf}; @@ -82,8 +82,8 @@ pub struct Options { enum Command { #[command(name = "aya")] Aya, - #[command(name = "aya-bpf-bindings")] - AyaBpfBindings, + #[command(name = "aya-ebpf-bindings")] + AyaEbpfBindings, } pub fn codegen(opts: Options, libbpf_dir: &Path) -> Result<(), anyhow::Error> { @@ -94,11 +94,11 @@ pub fn codegen(opts: Options, libbpf_dir: &Path) -> Result<(), anyhow::Error> { match command { Some(command) => match command { Command::Aya => aya::codegen(&sysroot_options, libbpf_dir), - Command::AyaBpfBindings => aya_bpf_bindings::codegen(&sysroot_options, libbpf_dir), + Command::AyaEbpfBindings => aya_ebpf_bindings::codegen(&sysroot_options, libbpf_dir), }, None => { aya::codegen(&sysroot_options, libbpf_dir)?; - aya_bpf_bindings::codegen(&sysroot_options, libbpf_dir) + aya_ebpf_bindings::codegen(&sysroot_options, libbpf_dir) } } }