chore(aya-ebpf-bindings): Rename bpf -> ebpf

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
pull/528/head
Dave Tucker 7 months ago
parent 21f570a19c
commit 70ac91dc1e

@ -56,7 +56,7 @@ jobs:
set -euxo pipefail set -euxo pipefail
cargo hack miri test --all-targets --feature-powerset \ cargo hack miri test --all-targets --feature-powerset \
--exclude aya-bpf \ --exclude aya-bpf \
--exclude aya-bpf-bindings \ --exclude aya-ebpf-bindings \
--exclude aya-log-ebpf \ --exclude aya-log-ebpf \
--exclude integration-ebpf \ --exclude integration-ebpf \
--exclude integration-test \ --exclude integration-test \
@ -93,7 +93,7 @@ jobs:
set -euxo pipefail set -euxo pipefail
cargo hack build --all-targets --feature-powerset \ cargo hack build --all-targets --feature-powerset \
--exclude aya-bpf \ --exclude aya-bpf \
--exclude aya-bpf-bindings \ --exclude aya-ebpf-bindings \
--exclude aya-log-ebpf \ --exclude aya-log-ebpf \
--exclude integration-ebpf \ --exclude integration-ebpf \
--workspace --workspace
@ -105,7 +105,7 @@ jobs:
set -euxo pipefail set -euxo pipefail
cargo hack test --all-targets --feature-powerset \ cargo hack test --all-targets --feature-powerset \
--exclude aya-bpf \ --exclude aya-bpf \
--exclude aya-bpf-bindings \ --exclude aya-ebpf-bindings \
--exclude aya-log-ebpf \ --exclude aya-log-ebpf \
--exclude integration-ebpf \ --exclude integration-ebpf \
--exclude integration-test \ --exclude integration-test \
@ -118,7 +118,7 @@ jobs:
set -euxo pipefail set -euxo pipefail
cargo hack test --doc --feature-powerset \ cargo hack test --doc --feature-powerset \
--exclude aya-bpf \ --exclude aya-bpf \
--exclude aya-bpf-bindings \ --exclude aya-ebpf-bindings \
--exclude aya-log-ebpf \ --exclude aya-log-ebpf \
--exclude init \ --exclude init \
--exclude integration-ebpf \ --exclude integration-ebpf \

@ -16,7 +16,7 @@ members = [
# ebpf crates # ebpf crates
"ebpf/aya-bpf", "ebpf/aya-bpf",
"ebpf/aya-bpf-bindings", "ebpf/aya-ebpf-bindings",
"ebpf/aya-log-ebpf", "ebpf/aya-log-ebpf",
"test/integration-ebpf", "test/integration-ebpf",
] ]

@ -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)) - 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)) - 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)) - 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)) - 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)) - 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)) - Support both bpf_map_def layout variants ([`d8d3117`](https://github.com/aya-rs/aya/commit/d8d311738c974f3b6fad22006ab2b827d0925ce8))

@ -11,7 +11,7 @@ edition.workspace = true
[dependencies] [dependencies]
aya-ebpf-cty = { path = "../aya-ebpf-cty" } aya-ebpf-cty = { path = "../aya-ebpf-cty" }
aya-bpf-macros = { path = "../../aya-bpf-macros" } 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 } const-assert = { workspace = true, optional = true }
[build-dependencies] [build-dependencies]

@ -9,7 +9,7 @@
use core::mem::{self, MaybeUninit}; use core::mem::{self, MaybeUninit};
pub use aya_bpf_bindings::helpers as gen; pub use aya_ebpf_bindings::helpers as gen;
#[doc(hidden)] #[doc(hidden)]
pub use gen::*; pub use gen::*;

@ -19,7 +19,7 @@
#![warn(clippy::cast_lossless, clippy::cast_sign_loss)] #![warn(clippy::cast_lossless, clippy::cast_sign_loss)]
#![no_std] #![no_std]
pub use aya_bpf_bindings::bindings; pub use aya_ebpf_bindings::bindings;
mod args; mod args;
pub use args::PtRegs; pub use args::PtRegs;

@ -1,6 +1,6 @@
use core::{cell::UnsafeCell, marker::PhantomData, mem, ptr::NonNull}; 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, BPF_MAP_TYPE_LRU_HASH, BPF_MAP_TYPE_LRU_PERCPU_HASH, BPF_MAP_TYPE_PERCPU_HASH,
}; };
use aya_ebpf_cty::{c_long, c_void}; use aya_ebpf_cty::{c_long, c_void};

@ -1,6 +1,6 @@
use core::{cell::UnsafeCell, marker::PhantomData, mem, ptr::NonNull}; 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 aya_ebpf_cty::{c_long, c_void};
use crate::{ use crate::{

@ -1,6 +1,6 @@
use core::{cell::UnsafeCell, mem}; 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 super::try_redirect_map;
use crate::{ use crate::{

@ -1,6 +1,6 @@
use core::{cell::UnsafeCell, mem, num::NonZeroU32, ptr::NonNull}; 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 aya_ebpf_cty::c_void;
use super::try_redirect_map; use super::try_redirect_map;

@ -1,6 +1,6 @@
use core::{cell::UnsafeCell, mem, num::NonZeroU32, ptr::NonNull}; 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 aya_ebpf_cty::c_void;
use super::{dev_map::DevMapValue, try_redirect_map}; use super::{dev_map::DevMapValue, try_redirect_map};

@ -5,7 +5,7 @@ mod xsk_map;
use core::cell::UnsafeCell; use core::cell::UnsafeCell;
use aya_bpf_bindings::{ use aya_ebpf_bindings::{
bindings::{bpf_map_def, xdp_action::XDP_REDIRECT}, bindings::{bpf_map_def, xdp_action::XDP_REDIRECT},
helpers::bpf_redirect_map, helpers::bpf_redirect_map,
}; };

@ -1,6 +1,6 @@
use core::{cell::UnsafeCell, mem, ptr::NonNull}; 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 aya_ebpf_cty::c_void;
use super::try_redirect_map; use super::try_redirect_map;

@ -3,7 +3,7 @@ use core::{
mem::{self, MaybeUninit}, 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_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_adjust_room, bpf_skb_change_proto, bpf_skb_change_type, bpf_skb_load_bytes,
bpf_skb_pull_data, bpf_skb_store_bytes, bpf_skb_pull_data, bpf_skb_store_bytes,

@ -1,6 +1,6 @@
use core::ffi::c_void; 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}; use crate::{bindings::bpf_sock_ops, BpfContext};

@ -1,5 +1,5 @@
[package] [package]
name = "aya-bpf-bindings" name = "aya-ebpf-bindings"
version = "0.1.0" version = "0.1.0"
description = "Bindings for Linux Kernel eBPF types and helpers" description = "Bindings for Linux Kernel eBPF types and helpers"
authors.workspace = true authors.workspace = true

@ -19,18 +19,18 @@ pub fn codegen(opts: &SysrootOptions, libbpf_dir: &Path) -> Result<(), anyhow::E
riscv64_sysroot, riscv64_sysroot,
} = opts; } = opts;
let dir = PathBuf::from("bpf/aya-bpf-bindings"); let dir = PathBuf::from("bpf/aya-ebpf-bindings");
let builder = || { let builder = || {
let mut bindgen = bindgen::bpf_builder() let mut bindgen = bindgen::bpf_builder()
.header(&*dir.join("include/bindings.h").to_string_lossy()) .header(&*dir.join("include/bindings.h").to_string_lossy())
// aya-tool uses aya_bpf::cty. We can't use that here since aya-bpf // 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") .ctypes_prefix("::aya_ebpf_cty")
.clang_args(&["-I", &*libbpf_dir.join("include/uapi").to_string_lossy()]) .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("include").to_string_lossy()])
.clang_args(&["-I", &*libbpf_dir.join("src").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 // _bindgen, those are anonymous enums
.constified_enum("BPF_F_.*") .constified_enum("BPF_F_.*")
.constified_enum("BPF_REG_.*") .constified_enum("BPF_REG_.*")

@ -1,5 +1,5 @@
mod aya; mod aya;
mod aya_bpf_bindings; mod aya_ebpf_bindings;
mod helpers; mod helpers;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
@ -82,8 +82,8 @@ pub struct Options {
enum Command { enum Command {
#[command(name = "aya")] #[command(name = "aya")]
Aya, Aya,
#[command(name = "aya-bpf-bindings")] #[command(name = "aya-ebpf-bindings")]
AyaBpfBindings, AyaEbpfBindings,
} }
pub fn codegen(opts: Options, libbpf_dir: &Path) -> Result<(), anyhow::Error> { 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 { match command {
Some(command) => match command { Some(command) => match command {
Command::Aya => aya::codegen(&sysroot_options, libbpf_dir), 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 => { None => {
aya::codegen(&sysroot_options, libbpf_dir)?; aya::codegen(&sysroot_options, libbpf_dir)?;
aya_bpf_bindings::codegen(&sysroot_options, libbpf_dir) aya_ebpf_bindings::codegen(&sysroot_options, libbpf_dir)
} }
} }
} }

Loading…
Cancel
Save