Merge pull request #528 from dave-tucker/rename-all-the-things

Rename Bpf -> Ebpf across all crates for consistency
pull/905/head
Dave Tucker 6 months ago committed by GitHub
commit 63d8d4d34b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -55,8 +55,8 @@ jobs:
run: | run: |
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-ebpf \
--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 \
@ -92,8 +92,8 @@ jobs:
run: | run: |
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-ebpf \
--exclude aya-bpf-bindings \ --exclude aya-ebpf-bindings \
--exclude aya-log-ebpf \ --exclude aya-log-ebpf \
--exclude integration-ebpf \ --exclude integration-ebpf \
--workspace --workspace
@ -104,8 +104,8 @@ jobs:
run: | run: |
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-ebpf \
--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 \
@ -117,15 +117,15 @@ jobs:
run: | run: |
set -euxo pipefail set -euxo pipefail
cargo hack test --doc --feature-powerset \ cargo hack test --doc --feature-powerset \
--exclude aya-bpf \ --exclude aya-ebpf \
--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 \
--exclude integration-test \ --exclude integration-test \
--workspace --workspace
build-test-aya-bpf: build-test-aya-ebpf:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -158,7 +158,7 @@ jobs:
CARGO_CFG_BPF_TARGET_ARCH: ${{ matrix.arch }} CARGO_CFG_BPF_TARGET_ARCH: ${{ matrix.arch }}
run: | run: |
set -euxo pipefail set -euxo pipefail
cargo hack build --package aya-bpf --package aya-log-ebpf \ cargo hack build --package aya-ebpf --package aya-log-ebpf \
--feature-powerset \ --feature-powerset \
--target ${{ matrix.target }} \ --target ${{ matrix.target }} \
-Z build-std=core -Z build-std=core
@ -170,7 +170,7 @@ jobs:
run: | run: |
set -euxo pipefail set -euxo pipefail
cargo hack test --doc \ cargo hack test --doc \
--package aya-bpf \ --package aya-ebpf \
--package aya-log-ebpf \ --package aya-log-ebpf \
--feature-powerset --feature-powerset
@ -305,7 +305,7 @@ jobs:
needs: needs:
- lint - lint
- build-test-aya - build-test-aya
- build-test-aya-bpf - build-test-aya-ebpf
- run-integration-test - run-integration-test
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

@ -52,7 +52,7 @@ pull_request_rules:
- name: add labels for aya-bpf PRs - name: add labels for aya-bpf PRs
conditions: conditions:
- files~=^(aya-bpf-macros|bpf/aya-bpf(-(cty|bindings))?)/ - files~=^(aya-ebpf-macros|ebpf/aya-ebpf(-(cty|bindings))?)/
actions: actions:
label: label:
add: add:
@ -68,7 +68,7 @@ pull_request_rules:
- name: add labels for aya-log-ebpf PRs - name: add labels for aya-log-ebpf PRs
conditions: conditions:
- files~=^(aya-log-common|bpf/aya-log-ebpf)/ - files~=^(aya-log-common|ebpf/aya-log-ebpf)/
actions: actions:
label: label:
add: add:

@ -11,13 +11,13 @@ members = [
"xtask", "xtask",
# macros # macros
"aya-bpf-macros", "aya-ebpf-macros",
"aya-log-ebpf-macros", "aya-log-ebpf-macros",
# ebpf crates # ebpf crates
"bpf/aya-bpf", "ebpf/aya-ebpf",
"bpf/aya-bpf-bindings", "ebpf/aya-ebpf-bindings",
"bpf/aya-log-ebpf", "ebpf/aya-log-ebpf",
"test/integration-ebpf", "test/integration-ebpf",
] ]
@ -35,7 +35,7 @@ default-members = [
# tests, and that doesn't work unless they've been built with `cargo xtask`. # tests, and that doesn't work unless they've been built with `cargo xtask`.
"xtask", "xtask",
"aya-bpf-macros", "aya-ebpf-macros",
"aya-log-ebpf-macros", "aya-log-ebpf-macros",
# ebpf crates are omitted; they must be built with: # ebpf crates are omitted; they must be built with:

@ -74,14 +74,14 @@ use a `BPF_PROG_TYPE_CGROUP_SKB` program with aya:
```rust ```rust
use std::fs::File; use std::fs::File;
use aya::Bpf; use aya::Ebpf;
use aya::programs::{CgroupSkb, CgroupSkbAttachType}; use aya::programs::{CgroupSkb, CgroupSkbAttachType};
// load the BPF code // load the BPF code
let mut bpf = Bpf::load_file("bpf.o")?; let mut ebpf = Ebpf::load_file("ebpf.o")?;
// get the `ingress_filter` program compiled into `bpf.o`. // get the `ingress_filter` program compiled into `ebpf.o`.
let ingress: &mut CgroupSkb = bpf.program_mut("ingress_filter")?.try_into()?; let ingress: &mut CgroupSkb = ebpf.program_mut("ingress_filter")?.try_into()?;
// load the program into the kernel // load the program into the kernel
ingress.load()?; ingress.load()?;

@ -1,7 +1,7 @@
[package] [package]
name = "aya-bpf-macros" name = "aya-ebpf-macros"
version = "0.1.0" version = "0.1.0"
description = "Proc macros used by aya-bpf" description = "Proc macros used by aya-ebpf"
authors.workspace = true authors.workspace = true
license.workspace = true license.workspace = true
repository.workspace = true repository.workspace = true
@ -18,4 +18,4 @@ quote = { workspace = true }
syn = { workspace = true, default-features = true, features = ["full"] } syn = { workspace = true, default-features = true, features = ["full"] }
[dev-dependencies] [dev-dependencies]
aya-bpf = { path = "../bpf/aya-bpf", version = "0.1.0", default-features = false } aya-ebpf = { path = "../ebpf/aya-ebpf", version = "0.1.0", default-features = false }

@ -34,7 +34,7 @@ impl BtfTracePoint {
#[no_mangle] #[no_mangle]
#[link_section = #section_name] #[link_section = #section_name]
#fn_vis fn #fn_name(ctx: *mut ::core::ffi::c_void) -> i32 { #fn_vis fn #fn_name(ctx: *mut ::core::ffi::c_void) -> i32 {
let _ = #fn_name(::aya_bpf::programs::BtfTracePointContext::new(ctx)); let _ = #fn_name(::aya_ebpf::programs::BtfTracePointContext::new(ctx));
return 0; return 0;
#item #item
@ -65,7 +65,7 @@ mod tests {
#[no_mangle] #[no_mangle]
#[link_section = "tp_btf"] #[link_section = "tp_btf"]
fn foo(ctx: *mut ::core::ffi::c_void) -> i32 { fn foo(ctx: *mut ::core::ffi::c_void) -> i32 {
let _ = foo(::aya_bpf::programs::BtfTracePointContext::new(ctx)); let _ = foo(::aya_ebpf::programs::BtfTracePointContext::new(ctx));
return 0; return 0;
fn foo(ctx: BtfTracePointContext) -> i32 { fn foo(ctx: BtfTracePointContext) -> i32 {
@ -92,7 +92,7 @@ mod tests {
#[no_mangle] #[no_mangle]
#[link_section = "tp_btf/some_func"] #[link_section = "tp_btf/some_func"]
fn foo(ctx: *mut ::core::ffi::c_void) -> i32 { fn foo(ctx: *mut ::core::ffi::c_void) -> i32 {
let _ = foo(::aya_bpf::programs::BtfTracePointContext::new(ctx)); let _ = foo(::aya_ebpf::programs::BtfTracePointContext::new(ctx));
return 0; return 0;
fn foo(ctx: BtfTracePointContext) -> i32 { fn foo(ctx: BtfTracePointContext) -> i32 {

@ -23,8 +23,8 @@ impl CgroupDevice {
Ok(quote! { Ok(quote! {
#[no_mangle] #[no_mangle]
#[link_section = "cgroup/dev"] #[link_section = "cgroup/dev"]
#fn_vis fn #fn_name(ctx: *mut ::aya_bpf::bindings::bpf_cgroup_dev_ctx) -> i32 { #fn_vis fn #fn_name(ctx: *mut ::aya_ebpf::bindings::bpf_cgroup_dev_ctx) -> i32 {
return #fn_name(::aya_bpf::programs::DeviceContext::new(ctx)); return #fn_name(::aya_ebpf::programs::DeviceContext::new(ctx));
#item #item
} }
@ -53,8 +53,8 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "cgroup/dev"] #[link_section = "cgroup/dev"]
fn foo(ctx: *mut ::aya_bpf::bindings::bpf_cgroup_dev_ctx) -> i32 { fn foo(ctx: *mut ::aya_ebpf::bindings::bpf_cgroup_dev_ctx) -> i32 {
return foo(::aya_bpf::programs::DeviceContext::new(ctx)); return foo(::aya_ebpf::programs::DeviceContext::new(ctx));
fn foo(ctx: DeviceContext) -> i32 { fn foo(ctx: DeviceContext) -> i32 {
0 0

@ -37,8 +37,8 @@ impl CgroupSkb {
Ok(quote! { Ok(quote! {
#[no_mangle] #[no_mangle]
#[link_section = #section_name] #[link_section = #section_name]
#fn_vis fn #fn_name(ctx: *mut ::aya_bpf::bindings::__sk_buff) -> i32 { #fn_vis fn #fn_name(ctx: *mut ::aya_ebpf::bindings::__sk_buff) -> i32 {
return #fn_name(::aya_bpf::programs::SkBuffContext::new(ctx)); return #fn_name(::aya_ebpf::programs::SkBuffContext::new(ctx));
#item #item
} }
@ -67,8 +67,8 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "cgroup/skb"] #[link_section = "cgroup/skb"]
fn foo(ctx: *mut ::aya_bpf::bindings::__sk_buff) -> i32 { fn foo(ctx: *mut ::aya_ebpf::bindings::__sk_buff) -> i32 {
return foo(::aya_bpf::programs::SkBuffContext::new(ctx)); return foo(::aya_ebpf::programs::SkBuffContext::new(ctx));
fn foo(ctx: SkBuffContext) -> i32 { fn foo(ctx: SkBuffContext) -> i32 {
0 0
@ -93,8 +93,8 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "cgroup_skb/egress"] #[link_section = "cgroup_skb/egress"]
fn foo(ctx: *mut ::aya_bpf::bindings::__sk_buff) -> i32 { fn foo(ctx: *mut ::aya_ebpf::bindings::__sk_buff) -> i32 {
return foo(::aya_bpf::programs::SkBuffContext::new(ctx)); return foo(::aya_ebpf::programs::SkBuffContext::new(ctx));
fn foo(ctx: SkBuffContext) -> i32 { fn foo(ctx: SkBuffContext) -> i32 {
0 0
@ -119,8 +119,8 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "cgroup_skb/ingress"] #[link_section = "cgroup_skb/ingress"]
fn foo(ctx: *mut ::aya_bpf::bindings::__sk_buff) -> i32 { fn foo(ctx: *mut ::aya_ebpf::bindings::__sk_buff) -> i32 {
return foo(::aya_bpf::programs::SkBuffContext::new(ctx)); return foo(::aya_ebpf::programs::SkBuffContext::new(ctx));
fn foo(ctx: SkBuffContext) -> i32 { fn foo(ctx: SkBuffContext) -> i32 {
0 0
@ -145,8 +145,8 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "cgroup_skb/egress"] #[link_section = "cgroup_skb/egress"]
fn foo(ctx: *mut ::aya_bpf::bindings::__sk_buff) -> i32 { fn foo(ctx: *mut ::aya_ebpf::bindings::__sk_buff) -> i32 {
return foo(::aya_bpf::programs::SkBuffContext::new(ctx)); return foo(::aya_ebpf::programs::SkBuffContext::new(ctx));
fn foo(ctx: SkBuffContext) -> i32 { fn foo(ctx: SkBuffContext) -> i32 {
0 0
@ -171,8 +171,8 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "cgroup_skb/egress"] #[link_section = "cgroup_skb/egress"]
pub fn foo(ctx: *mut ::aya_bpf::bindings::__sk_buff) -> i32 { pub fn foo(ctx: *mut ::aya_ebpf::bindings::__sk_buff) -> i32 {
return foo(::aya_bpf::programs::SkBuffContext::new(ctx)); return foo(::aya_ebpf::programs::SkBuffContext::new(ctx));
pub fn foo(ctx: SkBuffContext) -> i32 { pub fn foo(ctx: SkBuffContext) -> i32 {
0 0
@ -197,8 +197,8 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "cgroup_skb/egress"] #[link_section = "cgroup_skb/egress"]
pub(crate) fn foo(ctx: *mut ::aya_bpf::bindings::__sk_buff) -> i32 { pub(crate) fn foo(ctx: *mut ::aya_ebpf::bindings::__sk_buff) -> i32 {
return foo(::aya_bpf::programs::SkBuffContext::new(ctx)); return foo(::aya_ebpf::programs::SkBuffContext::new(ctx));
pub(crate) fn foo(ctx: SkBuffContext) -> i32 { pub(crate) fn foo(ctx: SkBuffContext) -> i32 {
0 0

@ -35,8 +35,8 @@ impl CgroupSock {
Ok(quote! { Ok(quote! {
#[no_mangle] #[no_mangle]
#[link_section = #section_name] #[link_section = #section_name]
#fn_vis fn #fn_name(ctx: *mut ::aya_bpf::bindings::bpf_sock) -> i32 { #fn_vis fn #fn_name(ctx: *mut ::aya_ebpf::bindings::bpf_sock) -> i32 {
return #fn_name(::aya_bpf::programs::SockContext::new(ctx)); return #fn_name(::aya_ebpf::programs::SockContext::new(ctx));
#item #item
} }
@ -65,8 +65,8 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "cgroup/post_bind4"] #[link_section = "cgroup/post_bind4"]
fn foo(ctx: *mut ::aya_bpf::bindings::bpf_sock) -> i32 { fn foo(ctx: *mut ::aya_ebpf::bindings::bpf_sock) -> i32 {
return foo(::aya_bpf::programs::SockContext::new(ctx)); return foo(::aya_ebpf::programs::SockContext::new(ctx));
fn foo(ctx: SockContext) -> i32 { fn foo(ctx: SockContext) -> i32 {
0 0
@ -91,8 +91,8 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "cgroup/post_bind6"] #[link_section = "cgroup/post_bind6"]
fn foo(ctx: *mut ::aya_bpf::bindings::bpf_sock) -> i32 { fn foo(ctx: *mut ::aya_ebpf::bindings::bpf_sock) -> i32 {
return foo(::aya_bpf::programs::SockContext::new(ctx)); return foo(::aya_ebpf::programs::SockContext::new(ctx));
fn foo(ctx: SockContext) -> i32 { fn foo(ctx: SockContext) -> i32 {
0 0
@ -116,8 +116,8 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "cgroup/sock_create"] #[link_section = "cgroup/sock_create"]
fn foo(ctx: *mut ::aya_bpf::bindings::bpf_sock) -> i32 { fn foo(ctx: *mut ::aya_ebpf::bindings::bpf_sock) -> i32 {
return foo(::aya_bpf::programs::SockContext::new(ctx)); return foo(::aya_ebpf::programs::SockContext::new(ctx));
fn foo(ctx: SockContext) -> i32 { fn foo(ctx: SockContext) -> i32 {
0 0
@ -141,8 +141,8 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "cgroup/sock_release"] #[link_section = "cgroup/sock_release"]
fn foo(ctx: *mut ::aya_bpf::bindings::bpf_sock) -> i32 { fn foo(ctx: *mut ::aya_ebpf::bindings::bpf_sock) -> i32 {
return foo(::aya_bpf::programs::SockContext::new(ctx)); return foo(::aya_ebpf::programs::SockContext::new(ctx));
fn foo(ctx: SockContext) -> i32 { fn foo(ctx: SockContext) -> i32 {
0 0

@ -37,8 +37,8 @@ impl CgroupSockAddr {
Ok(quote! { Ok(quote! {
#[no_mangle] #[no_mangle]
#[link_section = #section_name] #[link_section = #section_name]
#fn_vis fn #fn_name(ctx: *mut ::aya_bpf::bindings::bpf_sock_addr) -> i32 { #fn_vis fn #fn_name(ctx: *mut ::aya_ebpf::bindings::bpf_sock_addr) -> i32 {
return #fn_name(::aya_bpf::programs::SockAddrContext::new(ctx)); return #fn_name(::aya_ebpf::programs::SockAddrContext::new(ctx));
#item #item
} }
@ -67,8 +67,8 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "cgroup/connect4"] #[link_section = "cgroup/connect4"]
fn foo(ctx: *mut ::aya_bpf::bindings::bpf_sock_addr) -> i32 { fn foo(ctx: *mut ::aya_ebpf::bindings::bpf_sock_addr) -> i32 {
return foo(::aya_bpf::programs::SockAddrContext::new(ctx)); return foo(::aya_ebpf::programs::SockAddrContext::new(ctx));
fn foo(ctx: CgroupSockAddrContext) -> i32 { fn foo(ctx: CgroupSockAddrContext) -> i32 {
0 0
@ -93,8 +93,8 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "cgroup/connect6"] #[link_section = "cgroup/connect6"]
fn foo(ctx: *mut ::aya_bpf::bindings::bpf_sock_addr) -> i32 { fn foo(ctx: *mut ::aya_ebpf::bindings::bpf_sock_addr) -> i32 {
return foo(::aya_bpf::programs::SockAddrContext::new(ctx)); return foo(::aya_ebpf::programs::SockAddrContext::new(ctx));
fn foo(ctx: CgroupSockAddrContext) -> i32 { fn foo(ctx: CgroupSockAddrContext) -> i32 {
0 0
@ -119,8 +119,8 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "cgroup/bind4"] #[link_section = "cgroup/bind4"]
fn foo(ctx: *mut ::aya_bpf::bindings::bpf_sock_addr) -> i32 { fn foo(ctx: *mut ::aya_ebpf::bindings::bpf_sock_addr) -> i32 {
return foo(::aya_bpf::programs::SockAddrContext::new(ctx)); return foo(::aya_ebpf::programs::SockAddrContext::new(ctx));
fn foo(ctx: CgroupSockAddrContext) -> i32 { fn foo(ctx: CgroupSockAddrContext) -> i32 {
0 0
@ -145,8 +145,8 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "cgroup/bind6"] #[link_section = "cgroup/bind6"]
fn foo(ctx: *mut ::aya_bpf::bindings::bpf_sock_addr) -> i32 { fn foo(ctx: *mut ::aya_ebpf::bindings::bpf_sock_addr) -> i32 {
return foo(::aya_bpf::programs::SockAddrContext::new(ctx)); return foo(::aya_ebpf::programs::SockAddrContext::new(ctx));
fn foo(ctx: CgroupSockAddrContext) -> i32 { fn foo(ctx: CgroupSockAddrContext) -> i32 {
0 0
@ -171,8 +171,8 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "cgroup/getpeername4"] #[link_section = "cgroup/getpeername4"]
fn foo(ctx: *mut ::aya_bpf::bindings::bpf_sock_addr) -> i32 { fn foo(ctx: *mut ::aya_ebpf::bindings::bpf_sock_addr) -> i32 {
return foo(::aya_bpf::programs::SockAddrContext::new(ctx)); return foo(::aya_ebpf::programs::SockAddrContext::new(ctx));
fn foo(ctx: CgroupSockAddrContext) -> i32 { fn foo(ctx: CgroupSockAddrContext) -> i32 {
0 0
@ -197,8 +197,8 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "cgroup/getpeername6"] #[link_section = "cgroup/getpeername6"]
fn foo(ctx: *mut ::aya_bpf::bindings::bpf_sock_addr) -> i32 { fn foo(ctx: *mut ::aya_ebpf::bindings::bpf_sock_addr) -> i32 {
return foo(::aya_bpf::programs::SockAddrContext::new(ctx)); return foo(::aya_ebpf::programs::SockAddrContext::new(ctx));
fn foo(ctx: CgroupSockAddrContext) -> i32 { fn foo(ctx: CgroupSockAddrContext) -> i32 {
0 0
@ -223,8 +223,8 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "cgroup/getsockname4"] #[link_section = "cgroup/getsockname4"]
fn foo(ctx: *mut ::aya_bpf::bindings::bpf_sock_addr) -> i32 { fn foo(ctx: *mut ::aya_ebpf::bindings::bpf_sock_addr) -> i32 {
return foo(::aya_bpf::programs::SockAddrContext::new(ctx)); return foo(::aya_ebpf::programs::SockAddrContext::new(ctx));
fn foo(ctx: CgroupSockAddrContext) -> i32 { fn foo(ctx: CgroupSockAddrContext) -> i32 {
0 0
@ -249,8 +249,8 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "cgroup/getsockname6"] #[link_section = "cgroup/getsockname6"]
fn foo(ctx: *mut ::aya_bpf::bindings::bpf_sock_addr) -> i32 { fn foo(ctx: *mut ::aya_ebpf::bindings::bpf_sock_addr) -> i32 {
return foo(::aya_bpf::programs::SockAddrContext::new(ctx)); return foo(::aya_ebpf::programs::SockAddrContext::new(ctx));
fn foo(ctx: CgroupSockAddrContext) -> i32 { fn foo(ctx: CgroupSockAddrContext) -> i32 {
0 0
@ -275,8 +275,8 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "cgroup/sendmsg4"] #[link_section = "cgroup/sendmsg4"]
fn foo(ctx: *mut ::aya_bpf::bindings::bpf_sock_addr) -> i32 { fn foo(ctx: *mut ::aya_ebpf::bindings::bpf_sock_addr) -> i32 {
return foo(::aya_bpf::programs::SockAddrContext::new(ctx)); return foo(::aya_ebpf::programs::SockAddrContext::new(ctx));
fn foo(ctx: CgroupSockAddrContext) -> i32 { fn foo(ctx: CgroupSockAddrContext) -> i32 {
0 0
@ -301,8 +301,8 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "cgroup/sendmsg6"] #[link_section = "cgroup/sendmsg6"]
fn foo(ctx: *mut ::aya_bpf::bindings::bpf_sock_addr) -> i32 { fn foo(ctx: *mut ::aya_ebpf::bindings::bpf_sock_addr) -> i32 {
return foo(::aya_bpf::programs::SockAddrContext::new(ctx)); return foo(::aya_ebpf::programs::SockAddrContext::new(ctx));
fn foo(ctx: CgroupSockAddrContext) -> i32 { fn foo(ctx: CgroupSockAddrContext) -> i32 {
0 0
@ -327,8 +327,8 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "cgroup/recvmsg4"] #[link_section = "cgroup/recvmsg4"]
fn foo(ctx: *mut ::aya_bpf::bindings::bpf_sock_addr) -> i32 { fn foo(ctx: *mut ::aya_ebpf::bindings::bpf_sock_addr) -> i32 {
return foo(::aya_bpf::programs::SockAddrContext::new(ctx)); return foo(::aya_ebpf::programs::SockAddrContext::new(ctx));
fn foo(ctx: CgroupSockAddrContext) -> i32 { fn foo(ctx: CgroupSockAddrContext) -> i32 {
0 0
@ -353,8 +353,8 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "cgroup/recvmsg6"] #[link_section = "cgroup/recvmsg6"]
fn foo(ctx: *mut ::aya_bpf::bindings::bpf_sock_addr) -> i32 { fn foo(ctx: *mut ::aya_ebpf::bindings::bpf_sock_addr) -> i32 {
return foo(::aya_bpf::programs::SockAddrContext::new(ctx)); return foo(::aya_ebpf::programs::SockAddrContext::new(ctx));
fn foo(ctx: CgroupSockAddrContext) -> i32 { fn foo(ctx: CgroupSockAddrContext) -> i32 {
0 0

@ -35,8 +35,8 @@ impl CgroupSockopt {
Ok(quote! { Ok(quote! {
#[no_mangle] #[no_mangle]
#[link_section = #section_name] #[link_section = #section_name]
#fn_vis fn #fn_name(ctx: *mut ::aya_bpf::bindings::bpf_sockopt) -> i32 { #fn_vis fn #fn_name(ctx: *mut ::aya_ebpf::bindings::bpf_sockopt) -> i32 {
return #fn_name(::aya_bpf::programs::SockoptContext::new(ctx)); return #fn_name(::aya_ebpf::programs::SockoptContext::new(ctx));
#item #item
} }
@ -65,8 +65,8 @@ mod tests {
let expected = quote!( let expected = quote!(
#[no_mangle] #[no_mangle]
#[link_section = "cgroup/getsockopt"] #[link_section = "cgroup/getsockopt"]
fn foo(ctx: *mut ::aya_bpf::bindings::bpf_sockopt) -> i32 { fn foo(ctx: *mut ::aya_ebpf::bindings::bpf_sockopt) -> i32 {
return foo(::aya_bpf::programs::SockoptContext::new(ctx)); return foo(::aya_ebpf::programs::SockoptContext::new(ctx));
fn foo(ctx: SockoptContext) -> i32 { fn foo(ctx: SockoptContext) -> i32 {
0 0
@ -91,8 +91,8 @@ mod tests {
let expected = quote!( let expected = quote!(
#[no_mangle] #[no_mangle]
#[link_section = "cgroup/setsockopt"] #[link_section = "cgroup/setsockopt"]
fn foo(ctx: *mut ::aya_bpf::bindings::bpf_sockopt) -> i32 { fn foo(ctx: *mut ::aya_ebpf::bindings::bpf_sockopt) -> i32 {
return foo(::aya_bpf::programs::SockoptContext::new(ctx)); return foo(::aya_ebpf::programs::SockoptContext::new(ctx));
fn foo(ctx: SockoptContext) -> i32 { fn foo(ctx: SockoptContext) -> i32 {
0 0

@ -23,8 +23,8 @@ impl CgroupSysctl {
Ok(quote! { Ok(quote! {
#[no_mangle] #[no_mangle]
#[link_section = "cgroup/sysctl"] #[link_section = "cgroup/sysctl"]
#fn_vis fn #fn_name(ctx: *mut ::aya_bpf::bindings::bpf_sysctl) -> i32 { #fn_vis fn #fn_name(ctx: *mut ::aya_ebpf::bindings::bpf_sysctl) -> i32 {
return #fn_name(::aya_bpf::programs::SysctlContext::new(ctx)); return #fn_name(::aya_ebpf::programs::SysctlContext::new(ctx));
#item #item
} }
@ -53,8 +53,8 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "cgroup/sysctl"] #[link_section = "cgroup/sysctl"]
fn foo(ctx: *mut ::aya_bpf::bindings::bpf_sysctl) -> i32 { fn foo(ctx: *mut ::aya_ebpf::bindings::bpf_sysctl) -> i32 {
return foo(::aya_bpf::programs::SysctlContext::new(ctx)); return foo(::aya_ebpf::programs::SysctlContext::new(ctx));
fn foo(ctx: SysctlContext) -> i32 { fn foo(ctx: SysctlContext) -> i32 {
0 0

@ -40,7 +40,7 @@ impl FEntry {
#[no_mangle] #[no_mangle]
#[link_section = #section_name] #[link_section = #section_name]
#fn_vis fn #fn_name(ctx: *mut ::core::ffi::c_void) -> i32 { #fn_vis fn #fn_name(ctx: *mut ::core::ffi::c_void) -> i32 {
let _ = #fn_name(::aya_bpf::programs::FEntryContext::new(ctx)); let _ = #fn_name(::aya_ebpf::programs::FEntryContext::new(ctx));
return 0; return 0;
#item #item
@ -60,7 +60,7 @@ mod tests {
let prog = FEntry::parse( let prog = FEntry::parse(
parse_quote! {}, parse_quote! {},
parse_quote! { parse_quote! {
fn sys_clone(ctx: &mut aya_bpf::programs::FEntryContext) -> i32 { fn sys_clone(ctx: &mut aya_ebpf::programs::FEntryContext) -> i32 {
0 0
} }
}, },
@ -71,10 +71,10 @@ mod tests {
#[no_mangle] #[no_mangle]
#[link_section = "fentry"] #[link_section = "fentry"]
fn sys_clone(ctx: *mut ::core::ffi::c_void) -> i32 { fn sys_clone(ctx: *mut ::core::ffi::c_void) -> i32 {
let _ = sys_clone(::aya_bpf::programs::FEntryContext::new(ctx)); let _ = sys_clone(::aya_ebpf::programs::FEntryContext::new(ctx));
return 0; return 0;
fn sys_clone(ctx: &mut aya_bpf::programs::FEntryContext) -> i32 { fn sys_clone(ctx: &mut aya_ebpf::programs::FEntryContext) -> i32 {
0 0
} }
} }
@ -89,7 +89,7 @@ mod tests {
function = "sys_clone" function = "sys_clone"
}, },
parse_quote! { parse_quote! {
fn sys_clone(ctx: &mut aya_bpf::programs::FEntryContext) -> i32 { fn sys_clone(ctx: &mut aya_ebpf::programs::FEntryContext) -> i32 {
0 0
} }
}, },
@ -100,10 +100,10 @@ mod tests {
#[no_mangle] #[no_mangle]
#[link_section = "fentry/sys_clone"] #[link_section = "fentry/sys_clone"]
fn sys_clone(ctx: *mut ::core::ffi::c_void) -> i32 { fn sys_clone(ctx: *mut ::core::ffi::c_void) -> i32 {
let _ = sys_clone(::aya_bpf::programs::FEntryContext::new(ctx)); let _ = sys_clone(::aya_ebpf::programs::FEntryContext::new(ctx));
return 0; return 0;
fn sys_clone(ctx: &mut aya_bpf::programs::FEntryContext) -> i32 { fn sys_clone(ctx: &mut aya_ebpf::programs::FEntryContext) -> i32 {
0 0
} }
} }
@ -118,7 +118,7 @@ mod tests {
sleepable sleepable
}, },
parse_quote! { parse_quote! {
fn sys_clone(ctx: &mut aya_bpf::programs::FEntryContext) -> i32 { fn sys_clone(ctx: &mut aya_ebpf::programs::FEntryContext) -> i32 {
0 0
} }
}, },
@ -129,10 +129,10 @@ mod tests {
#[no_mangle] #[no_mangle]
#[link_section = "fentry.s"] #[link_section = "fentry.s"]
fn sys_clone(ctx: *mut ::core::ffi::c_void) -> i32 { fn sys_clone(ctx: *mut ::core::ffi::c_void) -> i32 {
let _ = sys_clone(::aya_bpf::programs::FEntryContext::new(ctx)); let _ = sys_clone(::aya_ebpf::programs::FEntryContext::new(ctx));
return 0; return 0;
fn sys_clone(ctx: &mut aya_bpf::programs::FEntryContext) -> i32 { fn sys_clone(ctx: &mut aya_ebpf::programs::FEntryContext) -> i32 {
0 0
} }
} }

@ -40,7 +40,7 @@ impl FExit {
#[no_mangle] #[no_mangle]
#[link_section = #section_name] #[link_section = #section_name]
#fn_vis fn #fn_name(ctx: *mut ::core::ffi::c_void) -> i32 { #fn_vis fn #fn_name(ctx: *mut ::core::ffi::c_void) -> i32 {
let _ = #fn_name(::aya_bpf::programs::FExitContext::new(ctx)); let _ = #fn_name(::aya_ebpf::programs::FExitContext::new(ctx));
return 0; return 0;
#item #item
@ -71,7 +71,7 @@ mod tests {
#[no_mangle] #[no_mangle]
#[link_section = "fexit"] #[link_section = "fexit"]
fn sys_clone(ctx: *mut ::core::ffi::c_void) -> i32 { fn sys_clone(ctx: *mut ::core::ffi::c_void) -> i32 {
let _ = sys_clone(::aya_bpf::programs::FExitContext::new(ctx)); let _ = sys_clone(::aya_ebpf::programs::FExitContext::new(ctx));
return 0; return 0;
fn sys_clone(ctx: &mut FExitContext) -> i32 { fn sys_clone(ctx: &mut FExitContext) -> i32 {
@ -100,7 +100,7 @@ mod tests {
#[no_mangle] #[no_mangle]
#[link_section = "fexit/sys_clone"] #[link_section = "fexit/sys_clone"]
fn sys_clone(ctx: *mut ::core::ffi::c_void) -> i32 { fn sys_clone(ctx: *mut ::core::ffi::c_void) -> i32 {
let _ = sys_clone(::aya_bpf::programs::FExitContext::new(ctx)); let _ = sys_clone(::aya_ebpf::programs::FExitContext::new(ctx));
return 0; return 0;
fn sys_clone(ctx: &mut FExitContext) -> i32 { fn sys_clone(ctx: &mut FExitContext) -> i32 {
@ -129,7 +129,7 @@ mod tests {
#[no_mangle] #[no_mangle]
#[link_section = "fexit.s/sys_clone"] #[link_section = "fexit.s/sys_clone"]
fn sys_clone(ctx: *mut ::core::ffi::c_void) -> i32 { fn sys_clone(ctx: *mut ::core::ffi::c_void) -> i32 {
let _ = sys_clone(::aya_bpf::programs::FExitContext::new(ctx)); let _ = sys_clone(::aya_ebpf::programs::FExitContext::new(ctx));
return 0; return 0;
fn sys_clone(ctx: &mut FExitContext) -> i32 { fn sys_clone(ctx: &mut FExitContext) -> i32 {

@ -67,7 +67,7 @@ impl KProbe {
#[no_mangle] #[no_mangle]
#[link_section = #section_name] #[link_section = #section_name]
#fn_vis fn #fn_name(ctx: *mut ::core::ffi::c_void) -> u32 { #fn_vis fn #fn_name(ctx: *mut ::core::ffi::c_void) -> u32 {
let _ = #fn_name(::aya_bpf::programs::ProbeContext::new(ctx)); let _ = #fn_name(::aya_ebpf::programs::ProbeContext::new(ctx));
return 0; return 0;
#item #item
@ -100,7 +100,7 @@ mod tests {
#[no_mangle] #[no_mangle]
#[link_section = "kprobe"] #[link_section = "kprobe"]
fn foo(ctx: *mut ::core::ffi::c_void) -> u32 { fn foo(ctx: *mut ::core::ffi::c_void) -> u32 {
let _ = foo(::aya_bpf::programs::ProbeContext::new(ctx)); let _ = foo(::aya_ebpf::programs::ProbeContext::new(ctx));
return 0; return 0;
fn foo(ctx: ProbeContext) -> u32 { fn foo(ctx: ProbeContext) -> u32 {
@ -132,7 +132,7 @@ mod tests {
#[no_mangle] #[no_mangle]
#[link_section = "kprobe/fib_lookup"] #[link_section = "kprobe/fib_lookup"]
fn foo(ctx: *mut ::core::ffi::c_void) -> u32 { fn foo(ctx: *mut ::core::ffi::c_void) -> u32 {
let _ = foo(::aya_bpf::programs::ProbeContext::new(ctx)); let _ = foo(::aya_ebpf::programs::ProbeContext::new(ctx));
return 0; return 0;
fn foo(ctx: ProbeContext) -> u32 { fn foo(ctx: ProbeContext) -> u32 {
@ -165,7 +165,7 @@ mod tests {
#[no_mangle] #[no_mangle]
#[link_section = "kprobe/fib_lookup+10"] #[link_section = "kprobe/fib_lookup+10"]
fn foo(ctx: *mut ::core::ffi::c_void) -> u32 { fn foo(ctx: *mut ::core::ffi::c_void) -> u32 {
let _ = foo(::aya_bpf::programs::ProbeContext::new(ctx)); let _ = foo(::aya_ebpf::programs::ProbeContext::new(ctx));
return 0; return 0;
fn foo(ctx: ProbeContext) -> u32 { fn foo(ctx: ProbeContext) -> u32 {
@ -195,7 +195,7 @@ mod tests {
#[no_mangle] #[no_mangle]
#[link_section = "kretprobe"] #[link_section = "kretprobe"]
fn foo(ctx: *mut ::core::ffi::c_void) -> u32 { fn foo(ctx: *mut ::core::ffi::c_void) -> u32 {
let _ = foo(::aya_bpf::programs::ProbeContext::new(ctx)); let _ = foo(::aya_ebpf::programs::ProbeContext::new(ctx));
return 0; return 0;
fn foo(ctx: ProbeContext) -> u32 { fn foo(ctx: ProbeContext) -> u32 {

@ -142,7 +142,7 @@ pub fn sk_msg(attrs: TokenStream, item: TokenStream) -> TokenStream {
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
/// use aya_bpf::{bindings::xdp_action::XDP_PASS, macros::xdp, programs::XdpContext}; /// use aya_ebpf::{bindings::xdp_action::XDP_PASS, macros::xdp, programs::XdpContext};
/// ///
/// #[xdp(frags)] /// #[xdp(frags)]
/// pub fn xdp(ctx: XdpContext) -> u32 { /// pub fn xdp(ctx: XdpContext) -> u32 {
@ -222,7 +222,7 @@ pub fn cgroup_skb(attrs: TokenStream, item: TokenStream) -> TokenStream {
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
/// use aya_bpf::{macros::cgroup_sock_addr, programs::SockAddrContext}; /// use aya_ebpf::{macros::cgroup_sock_addr, programs::SockAddrContext};
/// ///
/// #[cgroup_sock_addr(connect4)] /// #[cgroup_sock_addr(connect4)]
/// pub fn connect4(ctx: SockAddrContext) -> i32 { /// pub fn connect4(ctx: SockAddrContext) -> i32 {
@ -300,7 +300,7 @@ pub fn perf_event(attrs: TokenStream, item: TokenStream) -> TokenStream {
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
/// use aya_bpf::{macros::raw_tracepoint, programs::RawTracePointContext}; /// use aya_ebpf::{macros::raw_tracepoint, programs::RawTracePointContext};
/// ///
/// #[raw_tracepoint(tracepoint = "sys_enter")] /// #[raw_tracepoint(tracepoint = "sys_enter")]
/// pub fn sys_enter(ctx: RawTracePointContext) -> i32 { /// pub fn sys_enter(ctx: RawTracePointContext) -> i32 {
@ -347,7 +347,7 @@ pub fn raw_tracepoint(attrs: TokenStream, item: TokenStream) -> TokenStream {
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
/// use aya_bpf::{macros::lsm, programs::LsmContext}; /// use aya_ebpf::{macros::lsm, programs::LsmContext};
/// ///
/// #[lsm(hook = "file_open")] /// #[lsm(hook = "file_open")]
/// pub fn file_open(ctx: LsmContext) -> i32 { /// pub fn file_open(ctx: LsmContext) -> i32 {
@ -387,7 +387,7 @@ pub fn lsm(attrs: TokenStream, item: TokenStream) -> TokenStream {
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
/// use aya_bpf::{macros::btf_tracepoint, programs::BtfTracePointContext}; /// use aya_ebpf::{macros::btf_tracepoint, programs::BtfTracePointContext};
/// ///
/// #[btf_tracepoint(function = "sched_process_fork")] /// #[btf_tracepoint(function = "sched_process_fork")]
/// pub fn sched_process_fork(ctx: BtfTracePointContext) -> u32 { /// pub fn sched_process_fork(ctx: BtfTracePointContext) -> u32 {
@ -425,7 +425,7 @@ pub fn btf_tracepoint(attrs: TokenStream, item: TokenStream) -> TokenStream {
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
/// use aya_bpf::{macros::stream_parser, programs::SkBuffContext}; /// use aya_ebpf::{macros::stream_parser, programs::SkBuffContext};
/// ///
/// ///
///#[stream_parser] ///#[stream_parser]
@ -456,7 +456,7 @@ pub fn stream_parser(attrs: TokenStream, item: TokenStream) -> TokenStream {
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
/// use aya_bpf::{macros::stream_verdict, programs::SkBuffContext, bindings::sk_action}; /// use aya_ebpf::{macros::stream_verdict, programs::SkBuffContext, bindings::sk_action};
/// ///
/// ///
///#[stream_verdict] ///#[stream_verdict]
@ -497,7 +497,7 @@ fn sk_skb(kind: SkSkbKind, attrs: TokenStream, item: TokenStream) -> TokenStream
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
/// use aya_bpf::{macros::socket_filter, programs::SkBuffContext}; /// use aya_ebpf::{macros::socket_filter, programs::SkBuffContext};
/// ///
/// #[socket_filter] /// #[socket_filter]
/// pub fn accept_all(_ctx: SkBuffContext) -> i64 { /// pub fn accept_all(_ctx: SkBuffContext) -> i64 {
@ -529,7 +529,7 @@ pub fn socket_filter(attrs: TokenStream, item: TokenStream) -> TokenStream {
/// ///
/// ```no_run /// ```no_run
/// # #![allow(non_camel_case_types)] /// # #![allow(non_camel_case_types)]
/// use aya_bpf::{macros::fentry, programs::FEntryContext}; /// use aya_ebpf::{macros::fentry, programs::FEntryContext};
/// # type filename = u32; /// # type filename = u32;
/// # type path = u32; /// # type path = u32;
/// ///
@ -574,7 +574,7 @@ pub fn fentry(attrs: TokenStream, item: TokenStream) -> TokenStream {
/// ///
/// ```no_run /// ```no_run
/// # #![allow(non_camel_case_types)] /// # #![allow(non_camel_case_types)]
/// use aya_bpf::{macros::fexit, programs::FExitContext}; /// use aya_ebpf::{macros::fexit, programs::FExitContext};
/// # type filename = u32; /// # type filename = u32;
/// # type path = u32; /// # type path = u32;
/// ///
@ -615,7 +615,7 @@ pub fn fexit(attrs: TokenStream, item: TokenStream) -> TokenStream {
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
/// use aya_bpf::{macros::sk_lookup, programs::SkLookupContext}; /// use aya_ebpf::{macros::sk_lookup, programs::SkLookupContext};
/// ///
/// #[sk_lookup] /// #[sk_lookup]
/// pub fn accept_all(_ctx: SkLookupContext) -> u32 { /// pub fn accept_all(_ctx: SkLookupContext) -> u32 {
@ -645,7 +645,7 @@ pub fn sk_lookup(attrs: TokenStream, item: TokenStream) -> TokenStream {
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
/// use aya_bpf::{ /// use aya_ebpf::{
/// macros::cgroup_device, /// macros::cgroup_device,
/// programs::DeviceContext, /// programs::DeviceContext,
/// }; /// };

@ -43,7 +43,7 @@ impl Lsm {
#[no_mangle] #[no_mangle]
#[link_section = #section_name] #[link_section = #section_name]
#fn_vis fn #fn_name(ctx: *mut ::core::ffi::c_void) -> i32 { #fn_vis fn #fn_name(ctx: *mut ::core::ffi::c_void) -> i32 {
return #fn_name(::aya_bpf::programs::LsmContext::new(ctx)); return #fn_name(::aya_ebpf::programs::LsmContext::new(ctx));
#item #item
} }
@ -65,7 +65,7 @@ mod tests {
hook = "bprm_committed_creds" hook = "bprm_committed_creds"
}, },
parse_quote! { parse_quote! {
fn bprm_committed_creds(ctx: &mut ::aya_bpf::programs::LsmContext) -> i32 { fn bprm_committed_creds(ctx: &mut ::aya_ebpf::programs::LsmContext) -> i32 {
0 0
} }
}, },
@ -76,9 +76,9 @@ mod tests {
#[no_mangle] #[no_mangle]
#[link_section = "lsm.s/bprm_committed_creds"] #[link_section = "lsm.s/bprm_committed_creds"]
fn bprm_committed_creds(ctx: *mut ::core::ffi::c_void) -> i32 { fn bprm_committed_creds(ctx: *mut ::core::ffi::c_void) -> i32 {
return bprm_committed_creds(::aya_bpf::programs::LsmContext::new(ctx)); return bprm_committed_creds(::aya_ebpf::programs::LsmContext::new(ctx));
fn bprm_committed_creds(ctx: &mut ::aya_bpf::programs::LsmContext) -> i32 { fn bprm_committed_creds(ctx: &mut ::aya_ebpf::programs::LsmContext) -> i32 {
0 0
} }
} }
@ -93,7 +93,7 @@ mod tests {
hook = "bprm_committed_creds" hook = "bprm_committed_creds"
}, },
parse_quote! { parse_quote! {
fn bprm_committed_creds(ctx: &mut ::aya_bpf::programs::LsmContext) -> i32 { fn bprm_committed_creds(ctx: &mut ::aya_ebpf::programs::LsmContext) -> i32 {
0 0
} }
}, },
@ -104,9 +104,9 @@ mod tests {
#[no_mangle] #[no_mangle]
#[link_section = "lsm/bprm_committed_creds"] #[link_section = "lsm/bprm_committed_creds"]
fn bprm_committed_creds(ctx: *mut ::core::ffi::c_void) -> i32 { fn bprm_committed_creds(ctx: *mut ::core::ffi::c_void) -> i32 {
return bprm_committed_creds(::aya_bpf::programs::LsmContext::new(ctx)); return bprm_committed_creds(::aya_ebpf::programs::LsmContext::new(ctx));
fn bprm_committed_creds(ctx: &mut ::aya_bpf::programs::LsmContext) -> i32 { fn bprm_committed_creds(ctx: &mut ::aya_ebpf::programs::LsmContext) -> i32 {
0 0
} }
} }

@ -24,7 +24,7 @@ impl PerfEvent {
#[no_mangle] #[no_mangle]
#[link_section = "perf_event"] #[link_section = "perf_event"]
#fn_vis fn #fn_name(ctx: *mut ::core::ffi::c_void) -> u32 { #fn_vis fn #fn_name(ctx: *mut ::core::ffi::c_void) -> u32 {
let _ = #fn_name(::aya_bpf::programs::PerfEventContext::new(ctx)); let _ = #fn_name(::aya_ebpf::programs::PerfEventContext::new(ctx));
return 0; return 0;
#item #item
@ -55,7 +55,7 @@ mod tests {
#[no_mangle] #[no_mangle]
#[link_section = "perf_event"] #[link_section = "perf_event"]
fn foo(ctx: *mut ::core::ffi::c_void) -> u32 { fn foo(ctx: *mut ::core::ffi::c_void) -> u32 {
let _ = foo(::aya_bpf::programs::PerfEventContext::new(ctx)); let _ = foo(::aya_ebpf::programs::PerfEventContext::new(ctx));
return 0; return 0;
fn foo(ctx: PerfEventContext) -> i32 { fn foo(ctx: PerfEventContext) -> i32 {

@ -33,7 +33,7 @@ impl RawTracePoint {
#[no_mangle] #[no_mangle]
#[link_section = #section_name] #[link_section = #section_name]
#fn_vis fn #fn_name(ctx: *mut ::core::ffi::c_void) -> u32 { #fn_vis fn #fn_name(ctx: *mut ::core::ffi::c_void) -> u32 {
let _ = #fn_name(::aya_bpf::programs::RawTracePointContext::new(ctx)); let _ = #fn_name(::aya_ebpf::programs::RawTracePointContext::new(ctx));
return 0; return 0;
#item #item
@ -53,7 +53,7 @@ mod tests {
let prog = RawTracePoint::parse( let prog = RawTracePoint::parse(
parse_quote! { tracepoint = "sys_enter" }, parse_quote! { tracepoint = "sys_enter" },
parse_quote! { parse_quote! {
fn prog(ctx: &mut ::aya_bpf::programs::RawTracePointContext) -> i32 { fn prog(ctx: &mut ::aya_ebpf::programs::RawTracePointContext) -> i32 {
0 0
} }
}, },
@ -64,10 +64,10 @@ mod tests {
#[no_mangle] #[no_mangle]
#[link_section = "raw_tp/sys_enter"] #[link_section = "raw_tp/sys_enter"]
fn prog(ctx: *mut ::core::ffi::c_void) -> u32 { fn prog(ctx: *mut ::core::ffi::c_void) -> u32 {
let _ = prog(::aya_bpf::programs::RawTracePointContext::new(ctx)); let _ = prog(::aya_ebpf::programs::RawTracePointContext::new(ctx));
return 0; return 0;
fn prog(ctx: &mut ::aya_bpf::programs::RawTracePointContext) -> i32 { fn prog(ctx: &mut ::aya_ebpf::programs::RawTracePointContext) -> i32 {
0 0
} }
} }

@ -23,8 +23,8 @@ impl SkLookup {
Ok(quote! { Ok(quote! {
#[no_mangle] #[no_mangle]
#[link_section = "sk_lookup"] #[link_section = "sk_lookup"]
#fn_vis fn #fn_name(ctx: *mut ::aya_bpf::bindings::bpf_sk_lookup) -> u32 { #fn_vis fn #fn_name(ctx: *mut ::aya_ebpf::bindings::bpf_sk_lookup) -> u32 {
return #fn_name(::aya_bpf::programs::SkLookupContext::new(ctx)); return #fn_name(::aya_ebpf::programs::SkLookupContext::new(ctx));
#item #item
} }
@ -43,7 +43,7 @@ mod tests {
let prog = SkLookup::parse( let prog = SkLookup::parse(
parse_quote! {}, parse_quote! {},
parse_quote! { parse_quote! {
fn prog(ctx: &mut ::aya_bpf::programs::SkLookupContext) -> u32 { fn prog(ctx: &mut ::aya_ebpf::programs::SkLookupContext) -> u32 {
0 0
} }
}, },
@ -53,10 +53,10 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "sk_lookup"] #[link_section = "sk_lookup"]
fn prog(ctx: *mut ::aya_bpf::bindings::bpf_sk_lookup) -> u32 { fn prog(ctx: *mut ::aya_ebpf::bindings::bpf_sk_lookup) -> u32 {
return prog(::aya_bpf::programs::SkLookupContext::new(ctx)); return prog(::aya_ebpf::programs::SkLookupContext::new(ctx));
fn prog(ctx: &mut ::aya_bpf::programs::SkLookupContext) -> u32 { fn prog(ctx: &mut ::aya_ebpf::programs::SkLookupContext) -> u32 {
0 0
} }
} }

@ -23,8 +23,8 @@ impl SkMsg {
Ok(quote! { Ok(quote! {
#[no_mangle] #[no_mangle]
#[link_section = "sk_msg"] #[link_section = "sk_msg"]
#fn_vis fn #fn_name(ctx: *mut ::aya_bpf::bindings::sk_msg_md) -> u32 { #fn_vis fn #fn_name(ctx: *mut ::aya_ebpf::bindings::sk_msg_md) -> u32 {
return #fn_name(::aya_bpf::programs::SkMsgContext::new(ctx)); return #fn_name(::aya_ebpf::programs::SkMsgContext::new(ctx));
#item #item
} }
@ -43,7 +43,7 @@ mod tests {
let prog = SkMsg::parse( let prog = SkMsg::parse(
parse_quote! {}, parse_quote! {},
parse_quote! { parse_quote! {
fn prog(ctx: &mut ::aya_bpf::programs::SkMsgContext) -> u32 { fn prog(ctx: &mut ::aya_ebpf::programs::SkMsgContext) -> u32 {
0 0
} }
}, },
@ -53,10 +53,10 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "sk_msg"] #[link_section = "sk_msg"]
fn prog(ctx: *mut ::aya_bpf::bindings:: sk_msg_md) -> u32 { fn prog(ctx: *mut ::aya_ebpf::bindings:: sk_msg_md) -> u32 {
return prog(::aya_bpf::programs::SkMsgContext::new(ctx)); return prog(::aya_ebpf::programs::SkMsgContext::new(ctx));
fn prog(ctx: &mut ::aya_bpf::programs::SkMsgContext) -> u32 { fn prog(ctx: &mut ::aya_ebpf::programs::SkMsgContext) -> u32 {
0 0
} }
} }

@ -45,8 +45,8 @@ impl SkSkb {
Ok(quote! { Ok(quote! {
#[no_mangle] #[no_mangle]
#[link_section = #section_name] #[link_section = #section_name]
#fn_vis fn #fn_name(ctx: *mut ::aya_bpf::bindings::__sk_buff) -> u32 { #fn_vis fn #fn_name(ctx: *mut ::aya_ebpf::bindings::__sk_buff) -> u32 {
return #fn_name(::aya_bpf::programs::SkBuffContext::new(ctx)); return #fn_name(::aya_ebpf::programs::SkBuffContext::new(ctx));
#item #item
} }
@ -66,7 +66,7 @@ mod tests {
SkSkbKind::StreamParser, SkSkbKind::StreamParser,
parse_quote! {}, parse_quote! {},
parse_quote! { parse_quote! {
fn prog(ctx: &mut ::aya_bpf::programs::SkBuffContext) -> u32 { fn prog(ctx: &mut ::aya_ebpf::programs::SkBuffContext) -> u32 {
0 0
} }
}, },
@ -76,10 +76,10 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "sk_skb/stream_parser"] #[link_section = "sk_skb/stream_parser"]
fn prog(ctx: *mut ::aya_bpf::bindings::__sk_buff) -> u32 { fn prog(ctx: *mut ::aya_ebpf::bindings::__sk_buff) -> u32 {
return prog(::aya_bpf::programs::SkBuffContext::new(ctx)); return prog(::aya_ebpf::programs::SkBuffContext::new(ctx));
fn prog(ctx: &mut ::aya_bpf::programs::SkBuffContext) -> u32 { fn prog(ctx: &mut ::aya_ebpf::programs::SkBuffContext) -> u32 {
0 0
} }
} }
@ -93,7 +93,7 @@ mod tests {
SkSkbKind::StreamVerdict, SkSkbKind::StreamVerdict,
parse_quote! {}, parse_quote! {},
parse_quote! { parse_quote! {
fn prog(ctx: &mut ::aya_bpf::programs::SkBuffContext) -> u32 { fn prog(ctx: &mut ::aya_ebpf::programs::SkBuffContext) -> u32 {
0 0
} }
}, },
@ -103,10 +103,10 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "sk_skb/stream_verdict"] #[link_section = "sk_skb/stream_verdict"]
fn prog(ctx: *mut ::aya_bpf::bindings::__sk_buff) -> u32 { fn prog(ctx: *mut ::aya_ebpf::bindings::__sk_buff) -> u32 {
return prog(::aya_bpf::programs::SkBuffContext::new(ctx)); return prog(::aya_ebpf::programs::SkBuffContext::new(ctx));
fn prog(ctx: &mut ::aya_bpf::programs::SkBuffContext) -> u32 { fn prog(ctx: &mut ::aya_ebpf::programs::SkBuffContext) -> u32 {
0 0
} }
} }

@ -23,8 +23,8 @@ impl SockOps {
Ok(quote! { Ok(quote! {
#[no_mangle] #[no_mangle]
#[link_section = "sockops"] #[link_section = "sockops"]
#fn_vis fn #fn_name(ctx: *mut ::aya_bpf::bindings::bpf_sock_ops) -> u32 { #fn_vis fn #fn_name(ctx: *mut ::aya_ebpf::bindings::bpf_sock_ops) -> u32 {
return #fn_name(::aya_bpf::programs::SockOpsContext::new(ctx)); return #fn_name(::aya_ebpf::programs::SockOpsContext::new(ctx));
#item #item
} }
@ -43,7 +43,7 @@ mod tests {
let prog = SockOps::parse( let prog = SockOps::parse(
parse_quote! {}, parse_quote! {},
parse_quote! { parse_quote! {
fn prog(ctx: &mut ::aya_bpf::programs::SockOpsContext) -> u32 { fn prog(ctx: &mut ::aya_ebpf::programs::SockOpsContext) -> u32 {
0 0
} }
}, },
@ -53,10 +53,10 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "sockops"] #[link_section = "sockops"]
fn prog(ctx: *mut ::aya_bpf::bindings::bpf_sock_ops) -> u32 { fn prog(ctx: *mut ::aya_ebpf::bindings::bpf_sock_ops) -> u32 {
return prog(::aya_bpf::programs::SockOpsContext::new(ctx)); return prog(::aya_ebpf::programs::SockOpsContext::new(ctx));
fn prog(ctx: &mut ::aya_bpf::programs::SockOpsContext) -> u32 { fn prog(ctx: &mut ::aya_ebpf::programs::SockOpsContext) -> u32 {
0 0
} }
} }

@ -23,8 +23,8 @@ impl SocketFilter {
Ok(quote! { Ok(quote! {
#[no_mangle] #[no_mangle]
#[link_section = "socket"] #[link_section = "socket"]
#fn_vis fn #fn_name(ctx: *mut ::aya_bpf::bindings::__sk_buff) -> i64 { #fn_vis fn #fn_name(ctx: *mut ::aya_ebpf::bindings::__sk_buff) -> i64 {
return #fn_name(::aya_bpf::programs::SkBuffContext::new(ctx)); return #fn_name(::aya_ebpf::programs::SkBuffContext::new(ctx));
#item #item
} }
@ -43,7 +43,7 @@ mod tests {
let prog = SocketFilter::parse( let prog = SocketFilter::parse(
parse_quote! {}, parse_quote! {},
parse_quote! { parse_quote! {
fn prog(ctx: &mut ::aya_bpf::programs::SkBuffContext) -> i64 { fn prog(ctx: &mut ::aya_ebpf::programs::SkBuffContext) -> i64 {
0 0
} }
}, },
@ -53,10 +53,10 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "socket"] #[link_section = "socket"]
fn prog(ctx: *mut ::aya_bpf::bindings::__sk_buff) -> i64 { fn prog(ctx: *mut ::aya_ebpf::bindings::__sk_buff) -> i64 {
return prog(::aya_bpf::programs::SkBuffContext::new(ctx)); return prog(::aya_ebpf::programs::SkBuffContext::new(ctx));
fn prog(ctx: &mut ::aya_bpf::programs::SkBuffContext) -> i64 { fn prog(ctx: &mut ::aya_ebpf::programs::SkBuffContext) -> i64 {
0 0
} }
} }

@ -23,8 +23,8 @@ impl SchedClassifier {
Ok(quote! { Ok(quote! {
#[no_mangle] #[no_mangle]
#[link_section = "classifier"] #[link_section = "classifier"]
#fn_vis fn #fn_name(ctx: *mut ::aya_bpf::bindings::__sk_buff) -> i32 { #fn_vis fn #fn_name(ctx: *mut ::aya_ebpf::bindings::__sk_buff) -> i32 {
return #fn_name(::aya_bpf::programs::TcContext::new(ctx)); return #fn_name(::aya_ebpf::programs::TcContext::new(ctx));
#item #item
} }
@ -43,7 +43,7 @@ mod tests {
let prog = SchedClassifier::parse( let prog = SchedClassifier::parse(
parse_quote! {}, parse_quote! {},
parse_quote! { parse_quote! {
fn prog(ctx: &mut ::aya_bpf::programs::TcContext) -> i32 { fn prog(ctx: &mut ::aya_ebpf::programs::TcContext) -> i32 {
0 0
} }
}, },
@ -53,10 +53,10 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "classifier"] #[link_section = "classifier"]
fn prog(ctx: *mut ::aya_bpf::bindings::__sk_buff) -> i32 { fn prog(ctx: *mut ::aya_ebpf::bindings::__sk_buff) -> i32 {
return prog(::aya_bpf::programs::TcContext::new(ctx)); return prog(::aya_ebpf::programs::TcContext::new(ctx));
fn prog(ctx: &mut ::aya_bpf::programs::TcContext) -> i32 { fn prog(ctx: &mut ::aya_ebpf::programs::TcContext) -> i32 {
0 0
} }
} }

@ -41,7 +41,7 @@ impl TracePoint {
#[no_mangle] #[no_mangle]
#[link_section = #section_name] #[link_section = #section_name]
#fn_vis fn #fn_name(ctx: *mut ::core::ffi::c_void) -> u32 { #fn_vis fn #fn_name(ctx: *mut ::core::ffi::c_void) -> u32 {
let _ = #fn_name(::aya_bpf::programs::TracePointContext::new(ctx)); let _ = #fn_name(::aya_ebpf::programs::TracePointContext::new(ctx));
return 0; return 0;
#item #item
@ -61,7 +61,7 @@ mod tests {
let prog = TracePoint::parse( let prog = TracePoint::parse(
parse_quote! { name = "sys_enter_bind", category = "syscalls" }, parse_quote! { name = "sys_enter_bind", category = "syscalls" },
parse_quote! { parse_quote! {
fn prog(ctx: &mut ::aya_bpf::programs::TracePointContext) -> i32 { fn prog(ctx: &mut ::aya_ebpf::programs::TracePointContext) -> i32 {
0 0
} }
}, },
@ -72,10 +72,10 @@ mod tests {
#[no_mangle] #[no_mangle]
#[link_section = "tracepoint/syscalls/sys_enter_bind"] #[link_section = "tracepoint/syscalls/sys_enter_bind"]
fn prog(ctx: *mut ::core::ffi::c_void) -> u32 { fn prog(ctx: *mut ::core::ffi::c_void) -> u32 {
let _ = prog(::aya_bpf::programs::TracePointContext::new(ctx)); let _ = prog(::aya_ebpf::programs::TracePointContext::new(ctx));
return 0; return 0;
fn prog(ctx: &mut ::aya_bpf::programs::TracePointContext) -> i32 { fn prog(ctx: &mut ::aya_ebpf::programs::TracePointContext) -> i32 {
0 0
} }
} }

@ -93,7 +93,7 @@ impl UProbe {
#[no_mangle] #[no_mangle]
#[link_section = #section_name] #[link_section = #section_name]
#fn_vis fn #fn_name(ctx: *mut ::core::ffi::c_void) -> u32 { #fn_vis fn #fn_name(ctx: *mut ::core::ffi::c_void) -> u32 {
let _ = #fn_name(::aya_bpf::programs::ProbeContext::new(ctx)); let _ = #fn_name(::aya_ebpf::programs::ProbeContext::new(ctx));
return 0; return 0;
#item #item
@ -126,7 +126,7 @@ mod tests {
#[no_mangle] #[no_mangle]
#[link_section = "uprobe"] #[link_section = "uprobe"]
fn foo(ctx: *mut ::core::ffi::c_void) -> u32 { fn foo(ctx: *mut ::core::ffi::c_void) -> u32 {
let _ = foo(::aya_bpf::programs::ProbeContext::new(ctx)); let _ = foo(::aya_ebpf::programs::ProbeContext::new(ctx));
return 0; return 0;
fn foo(ctx: ProbeContext) -> u32 { fn foo(ctx: ProbeContext) -> u32 {
@ -156,7 +156,7 @@ mod tests {
#[no_mangle] #[no_mangle]
#[link_section = "uprobe.s"] #[link_section = "uprobe.s"]
fn foo(ctx: *mut ::core::ffi::c_void) -> u32 { fn foo(ctx: *mut ::core::ffi::c_void) -> u32 {
let _ = foo(::aya_bpf::programs::ProbeContext::new(ctx)); let _ = foo(::aya_ebpf::programs::ProbeContext::new(ctx));
return 0; return 0;
fn foo(ctx: ProbeContext) -> u32 { fn foo(ctx: ProbeContext) -> u32 {
@ -189,7 +189,7 @@ mod tests {
#[no_mangle] #[no_mangle]
#[link_section = "uprobe/self/proc/exe:trigger_uprobe"] #[link_section = "uprobe/self/proc/exe:trigger_uprobe"]
fn foo(ctx: *mut ::core::ffi::c_void) -> u32 { fn foo(ctx: *mut ::core::ffi::c_void) -> u32 {
let _ = foo(::aya_bpf::programs::ProbeContext::new(ctx)); let _ = foo(::aya_ebpf::programs::ProbeContext::new(ctx));
return 0; return 0;
fn foo(ctx: ProbeContext) -> u32 { fn foo(ctx: ProbeContext) -> u32 {
@ -221,7 +221,7 @@ mod tests {
#[no_mangle] #[no_mangle]
#[link_section = "uprobe/self/proc/exe:foo+123"] #[link_section = "uprobe/self/proc/exe:foo+123"]
fn foo(ctx: *mut ::core::ffi::c_void) -> u32 { fn foo(ctx: *mut ::core::ffi::c_void) -> u32 {
let _ = foo(::aya_bpf::programs::ProbeContext::new(ctx)); let _ = foo(::aya_ebpf::programs::ProbeContext::new(ctx));
return 0; return 0;
fn foo(ctx: ProbeContext) -> u32 { fn foo(ctx: ProbeContext) -> u32 {
@ -251,7 +251,7 @@ mod tests {
#[no_mangle] #[no_mangle]
#[link_section = "uretprobe"] #[link_section = "uretprobe"]
fn foo(ctx: *mut ::core::ffi::c_void) -> u32 { fn foo(ctx: *mut ::core::ffi::c_void) -> u32 {
let _ = foo(::aya_bpf::programs::ProbeContext::new(ctx)); let _ = foo(::aya_ebpf::programs::ProbeContext::new(ctx));
return 0; return 0;
fn foo(ctx: ProbeContext) -> u32 { fn foo(ctx: ProbeContext) -> u32 {

@ -53,8 +53,8 @@ impl Xdp {
Ok(quote! { Ok(quote! {
#[no_mangle] #[no_mangle]
#[link_section = #section_name] #[link_section = #section_name]
#fn_vis fn #fn_name(ctx: *mut ::aya_bpf::bindings::xdp_md) -> u32 { #fn_vis fn #fn_name(ctx: *mut ::aya_ebpf::bindings::xdp_md) -> u32 {
return #fn_name(::aya_bpf::programs::XdpContext::new(ctx)); return #fn_name(::aya_ebpf::programs::XdpContext::new(ctx));
#item #item
} }
@ -73,7 +73,7 @@ mod tests {
let prog = Xdp::parse( let prog = Xdp::parse(
parse_quote! {}, parse_quote! {},
parse_quote! { parse_quote! {
fn prog(ctx: &mut ::aya_bpf::programs::XdpContext) -> i32 { fn prog(ctx: &mut ::aya_ebpf::programs::XdpContext) -> i32 {
0 0
} }
}, },
@ -83,10 +83,10 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "xdp"] #[link_section = "xdp"]
fn prog(ctx: *mut ::aya_bpf::bindings::xdp_md) -> u32 { fn prog(ctx: *mut ::aya_ebpf::bindings::xdp_md) -> u32 {
return prog(::aya_bpf::programs::XdpContext::new(ctx)); return prog(::aya_ebpf::programs::XdpContext::new(ctx));
fn prog(ctx: &mut ::aya_bpf::programs::XdpContext) -> i32 { fn prog(ctx: &mut ::aya_ebpf::programs::XdpContext) -> i32 {
0 0
} }
} }
@ -99,7 +99,7 @@ mod tests {
let prog = Xdp::parse( let prog = Xdp::parse(
parse_quote! { frags }, parse_quote! { frags },
parse_quote! { parse_quote! {
fn prog(ctx: &mut ::aya_bpf::programs::XdpContext) -> i32 { fn prog(ctx: &mut ::aya_ebpf::programs::XdpContext) -> i32 {
0 0
} }
}, },
@ -109,10 +109,10 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "xdp.frags"] #[link_section = "xdp.frags"]
fn prog(ctx: *mut ::aya_bpf::bindings::xdp_md) -> u32 { fn prog(ctx: *mut ::aya_ebpf::bindings::xdp_md) -> u32 {
return prog(::aya_bpf::programs::XdpContext::new(ctx)); return prog(::aya_ebpf::programs::XdpContext::new(ctx));
fn prog(ctx: &mut ::aya_bpf::programs::XdpContext) -> i32 { fn prog(ctx: &mut ::aya_ebpf::programs::XdpContext) -> i32 {
0 0
} }
} }
@ -125,7 +125,7 @@ mod tests {
let prog = Xdp::parse( let prog = Xdp::parse(
parse_quote! { map = "cpumap" }, parse_quote! { map = "cpumap" },
parse_quote! { parse_quote! {
fn prog(ctx: &mut ::aya_bpf::programs::XdpContext) -> i32 { fn prog(ctx: &mut ::aya_ebpf::programs::XdpContext) -> i32 {
0 0
} }
}, },
@ -135,10 +135,10 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "xdp/cpumap"] #[link_section = "xdp/cpumap"]
fn prog(ctx: *mut ::aya_bpf::bindings::xdp_md) -> u32 { fn prog(ctx: *mut ::aya_ebpf::bindings::xdp_md) -> u32 {
return prog(::aya_bpf::programs::XdpContext::new(ctx)); return prog(::aya_ebpf::programs::XdpContext::new(ctx));
fn prog(ctx: &mut ::aya_bpf::programs::XdpContext) -> i32 { fn prog(ctx: &mut ::aya_ebpf::programs::XdpContext) -> i32 {
0 0
} }
} }
@ -151,7 +151,7 @@ mod tests {
let prog = Xdp::parse( let prog = Xdp::parse(
parse_quote! { map = "devmap" }, parse_quote! { map = "devmap" },
parse_quote! { parse_quote! {
fn prog(ctx: &mut ::aya_bpf::programs::XdpContext) -> i32 { fn prog(ctx: &mut ::aya_ebpf::programs::XdpContext) -> i32 {
0 0
} }
}, },
@ -161,10 +161,10 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "xdp/devmap"] #[link_section = "xdp/devmap"]
fn prog(ctx: *mut ::aya_bpf::bindings::xdp_md) -> u32 { fn prog(ctx: *mut ::aya_ebpf::bindings::xdp_md) -> u32 {
return prog(::aya_bpf::programs::XdpContext::new(ctx)); return prog(::aya_ebpf::programs::XdpContext::new(ctx));
fn prog(ctx: &mut ::aya_bpf::programs::XdpContext) -> i32 { fn prog(ctx: &mut ::aya_ebpf::programs::XdpContext) -> i32 {
0 0
} }
} }
@ -178,7 +178,7 @@ mod tests {
Xdp::parse( Xdp::parse(
parse_quote! { map = "badmap" }, parse_quote! { map = "badmap" },
parse_quote! { parse_quote! {
fn prog(ctx: &mut ::aya_bpf::programs::XdpContext) -> i32 { fn prog(ctx: &mut ::aya_ebpf::programs::XdpContext) -> i32 {
0 0
} }
}, },
@ -191,7 +191,7 @@ mod tests {
let prog = Xdp::parse( let prog = Xdp::parse(
parse_quote! { frags, map = "cpumap" }, parse_quote! { frags, map = "cpumap" },
parse_quote! { parse_quote! {
fn prog(ctx: &mut ::aya_bpf::programs::XdpContext) -> i32 { fn prog(ctx: &mut ::aya_ebpf::programs::XdpContext) -> i32 {
0 0
} }
}, },
@ -201,10 +201,10 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "xdp.frags/cpumap"] #[link_section = "xdp.frags/cpumap"]
fn prog(ctx: *mut ::aya_bpf::bindings::xdp_md) -> u32 { fn prog(ctx: *mut ::aya_ebpf::bindings::xdp_md) -> u32 {
return prog(::aya_bpf::programs::XdpContext::new(ctx)); return prog(::aya_ebpf::programs::XdpContext::new(ctx));
fn prog(ctx: &mut ::aya_bpf::programs::XdpContext) -> i32 { fn prog(ctx: &mut ::aya_ebpf::programs::XdpContext) -> i32 {
0 0
} }
} }
@ -217,7 +217,7 @@ mod tests {
let prog = Xdp::parse( let prog = Xdp::parse(
parse_quote! { frags, map = "devmap" }, parse_quote! { frags, map = "devmap" },
parse_quote! { parse_quote! {
fn prog(ctx: &mut ::aya_bpf::programs::XdpContext) -> i32 { fn prog(ctx: &mut ::aya_ebpf::programs::XdpContext) -> i32 {
0 0
} }
}, },
@ -227,10 +227,10 @@ mod tests {
let expected = quote! { let expected = quote! {
#[no_mangle] #[no_mangle]
#[link_section = "xdp.frags/devmap"] #[link_section = "xdp.frags/devmap"]
fn prog(ctx: *mut ::aya_bpf::bindings::xdp_md) -> u32 { fn prog(ctx: *mut ::aya_ebpf::bindings::xdp_md) -> u32 {
return prog(::aya_bpf::programs::XdpContext::new(ctx)); return prog(::aya_ebpf::programs::XdpContext::new(ctx));
fn prog(ctx: &mut ::aya_bpf::programs::XdpContext) -> i32 { fn prog(ctx: &mut ::aya_ebpf::programs::XdpContext) -> i32 {
0 0
} }
} }

File diff suppressed because one or more lines are too long

@ -33,12 +33,12 @@ to log eBPF messages to the terminal.
### User space code ### User space code
```rust ```rust
use aya_log::BpfLogger; use aya_log::EbpfLogger;
env_logger::init(); env_logger::init();
// Will log using the default logger, which is TermLogger in this case // Will log using the default logger, which is TermLogger in this case
BpfLogger::init(&mut bpf).unwrap(); EbpfLogger::init(&mut bpf).unwrap();
``` ```
### eBPF code ### eBPF code

@ -3,7 +3,7 @@
//! This is the user space side of the [Aya] logging framework. For the eBPF //! This is the user space side of the [Aya] logging framework. For the eBPF
//! side, see the `aya-log-ebpf` crate. //! side, see the `aya-log-ebpf` crate.
//! //!
//! `aya-log` provides the [BpfLogger] type, which reads log records created by //! `aya-log` provides the [EbpfLogger] type, which reads log records created by
//! `aya-log-ebpf` and logs them using the [log] crate. Any logger that //! `aya-log-ebpf` and logs them using the [log] crate. Any logger that
//! implements the [Log] trait can be used with this crate. //! implements the [Log] trait can be used with this crate.
//! //!
@ -12,14 +12,14 @@
//! This example uses the [env_logger] crate to log messages to the terminal. //! This example uses the [env_logger] crate to log messages to the terminal.
//! //!
//! ```no_run //! ```no_run
//! # let mut bpf = aya::Bpf::load(&[]).unwrap(); //! # let mut bpf = aya::Ebpf::load(&[]).unwrap();
//! use aya_log::BpfLogger; //! use aya_log::EbpfLogger;
//! //!
//! // initialize env_logger as the default logger //! // initialize env_logger as the default logger
//! env_logger::init(); //! env_logger::init();
//! //!
//! // start reading aya-log records and log them using the default logger //! // start reading aya-log records and log them using the default logger
//! BpfLogger::init(&mut bpf).unwrap(); //! EbpfLogger::init(&mut bpf).unwrap();
//! ``` //! ```
//! //!
//! With the following eBPF code: //! With the following eBPF code:
@ -65,7 +65,7 @@ use aya::{
MapError, MapError,
}, },
util::online_cpus, util::online_cpus,
Bpf, Pod, Ebpf, Pod,
}; };
use aya_log_common::{ use aya_log_common::{
Argument, DisplayHint, Level, LogValueLength, RecordField, LOG_BUF_CAPACITY, LOG_FIELDS, Argument, DisplayHint, Level, LogValueLength, RecordField, LOG_BUF_CAPACITY, LOG_FIELDS,
@ -93,21 +93,25 @@ unsafe impl Pod for DisplayHintWrapper {}
/// Log messages generated by `aya_log_ebpf` using the [log] crate. /// Log messages generated by `aya_log_ebpf` using the [log] crate.
/// ///
/// For more details see the [module level documentation](crate). /// For more details see the [module level documentation](crate).
pub struct BpfLogger; pub struct EbpfLogger;
impl BpfLogger { /// Log messages generated by `aya_log_ebpf` using the [log] crate.
#[deprecated(since = "0.2.1", note = "Use `aya_log::EbpfLogger` instead")]
pub type BpfLogger = EbpfLogger;
impl EbpfLogger {
/// Starts reading log records created with `aya-log-ebpf` and logs them /// Starts reading log records created with `aya-log-ebpf` and logs them
/// with the default logger. See [log::logger]. /// with the default logger. See [log::logger].
pub fn init(bpf: &mut Bpf) -> Result<BpfLogger, Error> { pub fn init(bpf: &mut Ebpf) -> Result<EbpfLogger, Error> {
BpfLogger::init_with_logger(bpf, log::logger()) EbpfLogger::init_with_logger(bpf, log::logger())
} }
/// Starts reading log records created with `aya-log-ebpf` and logs them /// Starts reading log records created with `aya-log-ebpf` and logs them
/// with the given logger. /// with the given logger.
pub fn init_with_logger<T: Log + 'static>( pub fn init_with_logger<T: Log + 'static>(
bpf: &mut Bpf, bpf: &mut Ebpf,
logger: T, logger: T,
) -> Result<BpfLogger, Error> { ) -> Result<EbpfLogger, Error> {
let logger = Arc::new(logger); let logger = Arc::new(logger);
let mut logs: AsyncPerfEventArray<_> = bpf let mut logs: AsyncPerfEventArray<_> = bpf
.take_map(MAP_NAME) .take_map(MAP_NAME)
@ -131,7 +135,7 @@ impl BpfLogger {
}); });
} }
Ok(BpfLogger {}) Ok(EbpfLogger {})
} }
} }

@ -235,14 +235,14 @@ impl BtfFeatures {
} }
} }
/// Bpf Type Format metadata. /// BPF Type Format metadata.
/// ///
/// BTF is a kind of debug metadata that allows eBPF programs compiled against one kernel version /// BTF is a kind of debug metadata that allows eBPF programs compiled against one kernel version
/// to be loaded into different kernel versions. /// to be loaded into different kernel versions.
/// ///
/// Aya automatically loads BTF metadata if you use `Bpf::load_file`. You /// Aya automatically loads BTF metadata if you use `Ebpf::load_file`. You
/// only need to explicitly use this type if you want to load BTF from a non-standard /// only need to explicitly use this type if you want to load BTF from a non-standard
/// location or if you are using `Bpf::load`. /// location or if you are using `Ebpf::load`.
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub struct Btf { pub struct Btf {
header: btf_header, header: btf_header,

@ -5,7 +5,7 @@ use core::mem;
#[cfg(not(feature = "std"))] #[cfg(not(feature = "std"))]
use crate::std; use crate::std;
use crate::BpfSectionKind; use crate::EbpfSectionKind;
/// Invalid map type encontered /// Invalid map type encontered
pub struct InvalidMapTypeError { pub struct InvalidMapTypeError {
@ -240,10 +240,10 @@ impl Map {
} }
/// Returns the section kind. /// Returns the section kind.
pub fn section_kind(&self) -> BpfSectionKind { pub fn section_kind(&self) -> EbpfSectionKind {
match self { match self {
Map::Legacy(m) => m.section_kind, Map::Legacy(m) => m.section_kind,
Map::Btf(_) => BpfSectionKind::BtfMaps, Map::Btf(_) => EbpfSectionKind::BtfMaps,
} }
} }
@ -270,7 +270,7 @@ pub struct LegacyMap {
/// The section index /// The section index
pub section_index: usize, pub section_index: usize,
/// The section kind /// The section kind
pub section_kind: BpfSectionKind, pub section_kind: EbpfSectionKind,
/// The symbol index. /// The symbol index.
/// ///
/// This is None for data maps (.bss .data and .rodata). We don't need /// This is None for data maps (.bss .data and .rodata). We don't need

@ -820,15 +820,15 @@ impl Object {
self.section_infos self.section_infos
.insert(section.name.to_owned(), (section.index, section.size)); .insert(section.name.to_owned(), (section.index, section.size));
match section.kind { match section.kind {
BpfSectionKind::Data | BpfSectionKind::Rodata | BpfSectionKind::Bss => { EbpfSectionKind::Data | EbpfSectionKind::Rodata | EbpfSectionKind::Bss => {
self.maps self.maps
.insert(section.name.to_string(), parse_data_map_section(&section)?); .insert(section.name.to_string(), parse_data_map_section(&section)?);
} }
BpfSectionKind::Text => self.parse_text_section(section)?, EbpfSectionKind::Text => self.parse_text_section(section)?,
BpfSectionKind::Btf => self.parse_btf(&section)?, EbpfSectionKind::Btf => self.parse_btf(&section)?,
BpfSectionKind::BtfExt => self.parse_btf_ext(&section)?, EbpfSectionKind::BtfExt => self.parse_btf_ext(&section)?,
BpfSectionKind::BtfMaps => self.parse_btf_maps(&section)?, EbpfSectionKind::BtfMaps => self.parse_btf_maps(&section)?,
BpfSectionKind::Maps => { EbpfSectionKind::Maps => {
// take out self.maps so we can borrow the iterator below // take out self.maps so we can borrow the iterator below
// without cloning or collecting // without cloning or collecting
let mut maps = mem::take(&mut self.maps); let mut maps = mem::take(&mut self.maps);
@ -850,7 +850,7 @@ impl Object {
res? res?
} }
BpfSectionKind::Program => { EbpfSectionKind::Program => {
self.parse_programs(&section)?; self.parse_programs(&section)?;
if !section.relocations.is_empty() { if !section.relocations.is_empty() {
self.relocations.insert( self.relocations.insert(
@ -863,7 +863,7 @@ impl Object {
); );
} }
} }
BpfSectionKind::Undefined | BpfSectionKind::License | BpfSectionKind::Version => {} EbpfSectionKind::Undefined | EbpfSectionKind::License | EbpfSectionKind::Version => {}
} }
Ok(()) Ok(())
@ -989,7 +989,7 @@ pub enum ParseError {
/// The kind of an ELF section. /// The kind of an ELF section.
#[derive(Debug, Copy, Clone, Eq, PartialEq)] #[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub enum BpfSectionKind { pub enum EbpfSectionKind {
/// Undefined /// Undefined
Undefined, Undefined,
/// `maps` /// `maps`
@ -1016,30 +1016,30 @@ pub enum BpfSectionKind {
Version, Version,
} }
impl BpfSectionKind { impl EbpfSectionKind {
fn from_name(name: &str) -> BpfSectionKind { fn from_name(name: &str) -> EbpfSectionKind {
if name.starts_with("license") { if name.starts_with("license") {
BpfSectionKind::License EbpfSectionKind::License
} else if name.starts_with("version") { } else if name.starts_with("version") {
BpfSectionKind::Version EbpfSectionKind::Version
} else if name.starts_with("maps") { } else if name.starts_with("maps") {
BpfSectionKind::Maps EbpfSectionKind::Maps
} else if name.starts_with(".maps") { } else if name.starts_with(".maps") {
BpfSectionKind::BtfMaps EbpfSectionKind::BtfMaps
} else if name.starts_with(".text") { } else if name.starts_with(".text") {
BpfSectionKind::Text EbpfSectionKind::Text
} else if name.starts_with(".bss") { } else if name.starts_with(".bss") {
BpfSectionKind::Bss EbpfSectionKind::Bss
} else if name.starts_with(".data") { } else if name.starts_with(".data") {
BpfSectionKind::Data EbpfSectionKind::Data
} else if name.starts_with(".rodata") { } else if name.starts_with(".rodata") {
BpfSectionKind::Rodata EbpfSectionKind::Rodata
} else if name == ".BTF" { } else if name == ".BTF" {
BpfSectionKind::Btf EbpfSectionKind::Btf
} else if name == ".BTF.ext" { } else if name == ".BTF.ext" {
BpfSectionKind::BtfExt EbpfSectionKind::BtfExt
} else { } else {
BpfSectionKind::Undefined EbpfSectionKind::Undefined
} }
} }
} }
@ -1047,7 +1047,7 @@ impl BpfSectionKind {
#[derive(Debug)] #[derive(Debug)]
struct Section<'a> { struct Section<'a> {
index: SectionIndex, index: SectionIndex,
kind: BpfSectionKind, kind: EbpfSectionKind,
address: u64, address: u64,
name: &'a str, name: &'a str,
data: &'a [u8], data: &'a [u8],
@ -1065,12 +1065,12 @@ impl<'data, 'file, 'a> TryFrom<&'a ObjSection<'data, 'file>> for Section<'a> {
error, error,
}; };
let name = section.name().map_err(map_err)?; let name = section.name().map_err(map_err)?;
let kind = match BpfSectionKind::from_name(name) { let kind = match EbpfSectionKind::from_name(name) {
BpfSectionKind::Undefined => { EbpfSectionKind::Undefined => {
if section.kind() == SectionKind::Text && section.size() > 0 { if section.kind() == SectionKind::Text && section.size() > 0 {
BpfSectionKind::Program EbpfSectionKind::Program
} else { } else {
BpfSectionKind::Undefined EbpfSectionKind::Undefined
} }
} }
k => k, k => k,
@ -1168,7 +1168,7 @@ fn get_map_field(btf: &Btf, type_id: u32) -> Result<u32, BtfError> {
// bytes and are relocated based on their section index. // bytes and are relocated based on their section index.
fn parse_data_map_section(section: &Section) -> Result<Map, ParseError> { fn parse_data_map_section(section: &Section) -> Result<Map, ParseError> {
let (def, data) = match section.kind { let (def, data) = match section.kind {
BpfSectionKind::Bss | BpfSectionKind::Data | BpfSectionKind::Rodata => { EbpfSectionKind::Bss | EbpfSectionKind::Data | EbpfSectionKind::Rodata => {
let def = bpf_map_def { let def = bpf_map_def {
map_type: BPF_MAP_TYPE_ARRAY as u32, map_type: BPF_MAP_TYPE_ARRAY as u32,
key_size: mem::size_of::<u32>() as u32, key_size: mem::size_of::<u32>() as u32,
@ -1176,7 +1176,7 @@ fn parse_data_map_section(section: &Section) -> Result<Map, ParseError> {
// .bss will always have data.len() == 0 // .bss will always have data.len() == 0
value_size: section.size as u32, value_size: section.size as u32,
max_entries: 1, max_entries: 1,
map_flags: if section.kind == BpfSectionKind::Rodata { map_flags: if section.kind == EbpfSectionKind::Rodata {
BPF_F_RDONLY_PROG BPF_F_RDONLY_PROG
} else { } else {
0 0
@ -1327,7 +1327,7 @@ pub fn parse_map_info(info: bpf_map_info, pinned: PinningType) -> Map {
}, },
section_index: 0, section_index: 0,
symbol_index: None, symbol_index: None,
section_kind: BpfSectionKind::Undefined, section_kind: EbpfSectionKind::Undefined,
data: Vec::new(), data: Vec::new(),
}) })
} }
@ -1400,7 +1400,7 @@ mod tests {
const FAKE_INS_LEN: u64 = 8; const FAKE_INS_LEN: u64 = 8;
fn fake_section<'a>( fn fake_section<'a>(
kind: BpfSectionKind, kind: EbpfSectionKind,
name: &'a str, name: &'a str,
data: &'a [u8], data: &'a [u8],
index: Option<usize>, index: Option<usize>,
@ -1563,7 +1563,7 @@ mod tests {
assert_matches!( assert_matches!(
parse_data_map_section( parse_data_map_section(
&fake_section( &fake_section(
BpfSectionKind::Data, EbpfSectionKind::Data,
".bss", ".bss",
map_data, map_data,
None, None,
@ -1571,7 +1571,7 @@ mod tests {
), ),
Ok(Map::Legacy(LegacyMap { Ok(Map::Legacy(LegacyMap {
section_index: 0, section_index: 0,
section_kind: BpfSectionKind::Data, section_kind: EbpfSectionKind::Data,
symbol_index: None, symbol_index: None,
def: bpf_map_def { def: bpf_map_def {
map_type: _map_type, map_type: _map_type,
@ -1595,7 +1595,7 @@ mod tests {
fn sanitizes_empty_btf_files_to_none() { fn sanitizes_empty_btf_files_to_none() {
let mut obj = fake_obj(); let mut obj = fake_obj();
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Btf, EbpfSectionKind::Btf,
".BTF", ".BTF",
&[ &[
159, 235, 1, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 159, 235, 1, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
@ -1604,7 +1604,7 @@ mod tests {
)) ))
.unwrap(); .unwrap();
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::BtfExt, EbpfSectionKind::BtfExt,
".BTF.ext", ".BTF.ext",
&[ &[
159, 235, 1, 0, 24, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 8, 0, 159, 235, 1, 0, 24, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 8, 0,
@ -1624,7 +1624,7 @@ mod tests {
fake_sym(&mut obj, 0, 0, "foo", 1); fake_sym(&mut obj, 0, 0, "foo", 1);
assert_matches!( assert_matches!(
obj.parse_programs(&fake_section( obj.parse_programs(&fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"kprobe/foo", "kprobe/foo",
&42u32.to_ne_bytes(), &42u32.to_ne_bytes(),
None, None,
@ -1639,7 +1639,7 @@ mod tests {
fake_sym(&mut obj, 0, 0, "foo", FAKE_INS_LEN); fake_sym(&mut obj, 0, 0, "foo", FAKE_INS_LEN);
obj.parse_programs(&fake_section( obj.parse_programs(&fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"kprobe/foo", "kprobe/foo",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
None, None,
@ -1673,7 +1673,7 @@ mod tests {
fake_sym(&mut obj, 0, 0, "foo", mem::size_of::<bpf_map_def>() as u64); fake_sym(&mut obj, 0, 0, "foo", mem::size_of::<bpf_map_def>() as u64);
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Maps, EbpfSectionKind::Maps,
"maps/foo", "maps/foo",
bytes_of(&bpf_map_def { bytes_of(&bpf_map_def {
map_type: 1, map_type: 1,
@ -1699,7 +1699,12 @@ mod tests {
let insns = [fake_ins(), fake_ins()]; let insns = [fake_ins(), fake_ins()];
let data = bytes_of(&insns); let data = bytes_of(&insns);
obj.parse_programs(&fake_section(BpfSectionKind::Program, "kprobe", data, None)) obj.parse_programs(&fake_section(
EbpfSectionKind::Program,
"kprobe",
data,
None,
))
.unwrap(); .unwrap();
let prog_foo = obj.programs.get("foo").unwrap(); let prog_foo = obj.programs.get("foo").unwrap();
@ -1767,7 +1772,7 @@ mod tests {
buf.extend(&map_data); buf.extend(&map_data);
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Maps, EbpfSectionKind::Maps,
"maps", "maps",
buf.as_slice(), buf.as_slice(),
None None
@ -1789,7 +1794,7 @@ mod tests {
let mut obj = fake_obj(); let mut obj = fake_obj();
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Data, EbpfSectionKind::Data,
".bss", ".bss",
b"map data", b"map data",
None None
@ -1800,7 +1805,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Data, EbpfSectionKind::Data,
".rodata", ".rodata",
b"map data", b"map data",
None None
@ -1811,7 +1816,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Data, EbpfSectionKind::Data,
".rodata.boo", ".rodata.boo",
b"map data", b"map data",
None None
@ -1822,7 +1827,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Data, EbpfSectionKind::Data,
".data", ".data",
b"map data", b"map data",
None None
@ -1833,7 +1838,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Data, EbpfSectionKind::Data,
".data.boo", ".data.boo",
b"map data", b"map data",
None None
@ -1850,7 +1855,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"kprobe/foo", "kprobe/foo",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
None None
@ -1873,7 +1878,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"uprobe/foo", "uprobe/foo",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
None None
@ -1896,7 +1901,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"uprobe.s/foo", "uprobe.s/foo",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
None None
@ -1922,7 +1927,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"uretprobe/foo", "uretprobe/foo",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
None None
@ -1945,7 +1950,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"uretprobe.s/foo", "uretprobe.s/foo",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
None None
@ -1972,7 +1977,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"tracepoint/foo", "tracepoint/foo",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
None None
@ -1989,7 +1994,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"tp/foo/bar", "tp/foo/bar",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
Some(1), Some(1),
@ -2012,7 +2017,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"socket/foo", "socket/foo",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
None None
@ -2035,7 +2040,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"xdp", "xdp",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
None None
@ -2058,7 +2063,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"xdp.frags", "xdp.frags",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
None None
@ -2082,7 +2087,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"raw_tp/foo", "raw_tp/foo",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
None None
@ -2099,7 +2104,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"raw_tracepoint/bar", "raw_tracepoint/bar",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
Some(1) Some(1)
@ -2122,7 +2127,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"lsm/foo", "lsm/foo",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
None None
@ -2148,7 +2153,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"lsm.s/foo", "lsm.s/foo",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
None None
@ -2174,7 +2179,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"tp_btf/foo", "tp_btf/foo",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
None None
@ -2197,7 +2202,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"sk_skb/stream_parser", "sk_skb/stream_parser",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
None None
@ -2220,7 +2225,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"sk_skb/stream_parser/my_parser", "sk_skb/stream_parser/my_parser",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
None None
@ -2243,7 +2248,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"fentry/foo", "fentry/foo",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
None None
@ -2266,7 +2271,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"fentry.s/foo", "fentry.s/foo",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
None None
@ -2292,7 +2297,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"fexit/foo", "fexit/foo",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
None None
@ -2315,7 +2320,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"fexit.s/foo", "fexit.s/foo",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
None None
@ -2341,7 +2346,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"cgroup_skb/ingress", "cgroup_skb/ingress",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
None None
@ -2364,7 +2369,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"cgroup_skb/ingress/foo", "cgroup_skb/ingress/foo",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
None None
@ -2387,7 +2392,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"cgroup/skb", "cgroup/skb",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
None None
@ -2410,7 +2415,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"cgroup/skb/foo", "cgroup/skb/foo",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
None None
@ -2433,7 +2438,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"cgroup/connect4/foo", "cgroup/connect4/foo",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
None None
@ -2459,7 +2464,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"cgroup/connect4", "cgroup/connect4",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
None None
@ -2485,7 +2490,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"cgroup/getsockopt/foo", "cgroup/getsockopt/foo",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
None None
@ -2511,7 +2516,7 @@ mod tests {
assert_matches!( assert_matches!(
obj.parse_section(fake_section( obj.parse_section(fake_section(
BpfSectionKind::Program, EbpfSectionKind::Program,
"cgroup/getsockopt", "cgroup/getsockopt",
bytes_of(&fake_ins()), bytes_of(&fake_ins()),
None None
@ -2546,7 +2551,7 @@ mod tests {
pinning: PinningType::None, pinning: PinningType::None,
}, },
section_index: 1, section_index: 1,
section_kind: BpfSectionKind::Rodata, section_kind: EbpfSectionKind::Rodata,
symbol_index: Some(1), symbol_index: Some(1),
data: vec![0, 0, 0], data: vec![0, 0, 0],
}), }),
@ -2656,10 +2661,10 @@ mod tests {
0x2E, 0x6D, 0x61, 0x70, 0x73, 0x00, 0x6C, 0x69, 0x63, 0x65, 0x6E, 0x73, 0x65, 0x00, 0x2E, 0x6D, 0x61, 0x70, 0x73, 0x00, 0x6C, 0x69, 0x63, 0x65, 0x6E, 0x73, 0x65, 0x00,
]; ];
let btf_section = fake_section(BpfSectionKind::Btf, ".BTF", data, None); let btf_section = fake_section(EbpfSectionKind::Btf, ".BTF", data, None);
obj.parse_section(btf_section).unwrap(); obj.parse_section(btf_section).unwrap();
let map_section = fake_section(BpfSectionKind::BtfMaps, ".maps", &[], None); let map_section = fake_section(EbpfSectionKind::BtfMaps, ".maps", &[], None);
obj.parse_section(map_section).unwrap(); obj.parse_section(map_section).unwrap();
let map = obj.maps.get("map_1").unwrap(); let map = obj.maps.get("map_1").unwrap();

@ -16,7 +16,7 @@ use crate::{
maps::Map, maps::Map,
obj::{Function, Object}, obj::{Function, Object},
util::{HashMap, HashSet}, util::{HashMap, HashSet},
BpfSectionKind, EbpfSectionKind,
}; };
pub(crate) const INS_SIZE: usize = mem::size_of::<bpf_insn>(); pub(crate) const INS_SIZE: usize = mem::size_of::<bpf_insn>();
@ -24,7 +24,7 @@ pub(crate) const INS_SIZE: usize = mem::size_of::<bpf_insn>();
/// The error type returned by [`Object::relocate_maps`] and [`Object::relocate_calls`] /// The error type returned by [`Object::relocate_maps`] and [`Object::relocate_calls`]
#[derive(thiserror::Error, Debug)] #[derive(thiserror::Error, Debug)]
#[error("error relocating `{function}`")] #[error("error relocating `{function}`")]
pub struct BpfRelocationError { pub struct EbpfRelocationError {
/// The function name /// The function name
function: String, function: String,
#[source] #[source]
@ -108,7 +108,7 @@ impl Object {
&mut self, &mut self,
maps: I, maps: I,
text_sections: &HashSet<usize>, text_sections: &HashSet<usize>,
) -> Result<(), BpfRelocationError> { ) -> Result<(), EbpfRelocationError> {
let mut maps_by_section = HashMap::new(); let mut maps_by_section = HashMap::new();
let mut maps_by_symbol = HashMap::new(); let mut maps_by_symbol = HashMap::new();
for (name, fd, map) in maps { for (name, fd, map) in maps {
@ -128,7 +128,7 @@ impl Object {
&self.symbol_table, &self.symbol_table,
text_sections, text_sections,
) )
.map_err(|error| BpfRelocationError { .map_err(|error| EbpfRelocationError {
function: function.name.clone(), function: function.name.clone(),
error, error,
})?; })?;
@ -142,7 +142,7 @@ impl Object {
pub fn relocate_calls( pub fn relocate_calls(
&mut self, &mut self,
text_sections: &HashSet<usize>, text_sections: &HashSet<usize>,
) -> Result<(), BpfRelocationError> { ) -> Result<(), EbpfRelocationError> {
for (name, program) in self.programs.iter() { for (name, program) in self.programs.iter() {
let linker = FunctionLinker::new( let linker = FunctionLinker::new(
&self.functions, &self.functions,
@ -154,7 +154,7 @@ impl Object {
let func_orig = let func_orig =
self.functions self.functions
.get(&program.function_key()) .get(&program.function_key())
.ok_or_else(|| BpfRelocationError { .ok_or_else(|| EbpfRelocationError {
function: name.clone(), function: name.clone(),
error: RelocationError::UnknownProgram { error: RelocationError::UnknownProgram {
section_index: program.section_index, section_index: program.section_index,
@ -162,7 +162,9 @@ impl Object {
}, },
})?; })?;
let func = linker.link(func_orig).map_err(|error| BpfRelocationError { let func = linker
.link(func_orig)
.map_err(|error| EbpfRelocationError {
function: name.to_owned(), function: name.to_owned(),
error, error,
})?; })?;
@ -250,7 +252,7 @@ fn relocate_maps<'a, I: Iterator<Item = &'a Relocation>>(
debug_assert_eq!(map.symbol_index(), None); debug_assert_eq!(map.symbol_index(), None);
debug_assert!(matches!( debug_assert!(matches!(
map.section_kind(), map.section_kind(),
BpfSectionKind::Bss | BpfSectionKind::Data | BpfSectionKind::Rodata EbpfSectionKind::Bss | EbpfSectionKind::Data | EbpfSectionKind::Rodata
)); ));
m m
}; };
@ -520,7 +522,7 @@ mod test {
Map::Legacy(LegacyMap { Map::Legacy(LegacyMap {
def: Default::default(), def: Default::default(),
section_index: 0, section_index: 0,
section_kind: BpfSectionKind::Undefined, section_kind: EbpfSectionKind::Undefined,
symbol_index: Some(symbol_index), symbol_index: Some(symbol_index),
data: Vec::new(), data: Vec::new(),
}) })

@ -14,7 +14,7 @@ pub fn user_builder() -> Builder {
pub fn bpf_builder() -> Builder { pub fn bpf_builder() -> Builder {
bindgen::builder() bindgen::builder()
.use_core() .use_core()
.ctypes_prefix("::aya_bpf::cty") .ctypes_prefix("::aya_ebpf::cty")
.layout_tests(false) .layout_tests(false)
.generate_comments(false) .generate_comments(false)
.clang_arg("-Wno-unknown-attributes") .clang_arg("-Wno-unknown-attributes")

@ -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))

@ -73,14 +73,14 @@ use a `BPF_PROG_TYPE_CGROUP_SKB` program with aya:
```rust ```rust
use std::fs::File; use std::fs::File;
use aya::Bpf; use aya::Ebpf;
use aya::programs::{CgroupSkb, CgroupSkbAttachType}; use aya::programs::{CgroupSkb, CgroupSkbAttachType};
// load the BPF code // load the BPF code
let mut bpf = Bpf::load_file("bpf.o")?; let mut ebpf = Ebpf::load_file("bpf.o")?;
// get the `ingress_filter` program compiled into `bpf.o`. // get the `ingress_filter` program compiled into `bpf.o`.
let ingress: &mut CgroupSkb = bpf.program_mut("ingress_filter")?.try_into()?; let ingress: &mut CgroupSkb = ebpf.program_mut("ingress_filter")?.try_into()?;
// load the program into the kernel // load the program into the kernel
ingress.load()?; ingress.load()?;

@ -13,8 +13,8 @@ use std::{
use aya_obj::{ use aya_obj::{
btf::{BtfFeatures, BtfRelocationError}, btf::{BtfFeatures, BtfRelocationError},
generated::{BPF_F_SLEEPABLE, BPF_F_XDP_HAS_FRAGS}, generated::{BPF_F_SLEEPABLE, BPF_F_XDP_HAS_FRAGS},
relocation::BpfRelocationError, relocation::EbpfRelocationError,
BpfSectionKind, Features, EbpfSectionKind, Features,
}; };
use log::{debug, warn}; use log::{debug, warn};
use thiserror::Error; use thiserror::Error;
@ -110,26 +110,26 @@ pub fn features() -> &'static Features {
/// Builder style API for advanced loading of eBPF programs. /// Builder style API for advanced loading of eBPF programs.
/// ///
/// Loading eBPF code involves a few steps, including loading maps and applying /// Loading eBPF code involves a few steps, including loading maps and applying
/// relocations. You can use `BpfLoader` to customize some of the loading /// relocations. You can use `EbpfLoader` to customize some of the loading
/// options. /// options.
/// ///
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
/// use aya::{BpfLoader, Btf}; /// use aya::{EbpfLoader, Btf};
/// use std::fs; /// use std::fs;
/// ///
/// let bpf = BpfLoader::new() /// let bpf = EbpfLoader::new()
/// // load the BTF data from /sys/kernel/btf/vmlinux /// // load the BTF data from /sys/kernel/btf/vmlinux
/// .btf(Btf::from_sys_fs().ok().as_ref()) /// .btf(Btf::from_sys_fs().ok().as_ref())
/// // load pinned maps from /sys/fs/bpf/my-program /// // load pinned maps from /sys/fs/bpf/my-program
/// .map_pin_path("/sys/fs/bpf/my-program") /// .map_pin_path("/sys/fs/bpf/my-program")
/// // finally load the code /// // finally load the code
/// .load_file("file.o")?; /// .load_file("file.o")?;
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
#[derive(Debug)] #[derive(Debug)]
pub struct BpfLoader<'a> { pub struct EbpfLoader<'a> {
btf: Option<Cow<'a, Btf>>, btf: Option<Cow<'a, Btf>>,
map_pin_path: Option<PathBuf>, map_pin_path: Option<PathBuf>,
globals: HashMap<&'a str, (&'a [u8], bool)>, globals: HashMap<&'a str, (&'a [u8], bool)>,
@ -139,8 +139,12 @@ pub struct BpfLoader<'a> {
allow_unsupported_maps: bool, allow_unsupported_maps: bool,
} }
/// Builder style API for advanced loading of eBPF programs.
#[deprecated(since = "0.13.0", note = "use `EbpfLoader` instead")]
pub type BpfLoader<'a> = EbpfLoader<'a>;
bitflags::bitflags! { bitflags::bitflags! {
/// Used to set the verifier log level flags in [BpfLoader](BpfLoader::verifier_log_level()). /// Used to set the verifier log level flags in [EbpfLoader](EbpfLoader::verifier_log_level()).
#[derive(Clone, Copy, Debug)] #[derive(Clone, Copy, Debug)]
pub struct VerifierLogLevel: u32 { pub struct VerifierLogLevel: u32 {
/// Sets no verifier logging. /// Sets no verifier logging.
@ -160,7 +164,7 @@ impl Default for VerifierLogLevel {
} }
} }
impl<'a> BpfLoader<'a> { impl<'a> EbpfLoader<'a> {
/// Creates a new loader instance. /// Creates a new loader instance.
pub fn new() -> Self { pub fn new() -> Self {
Self { Self {
@ -182,16 +186,16 @@ impl<'a> BpfLoader<'a> {
/// # Example /// # Example
/// ///
/// ```no_run /// ```no_run
/// use aya::{BpfLoader, Btf, Endianness}; /// use aya::{EbpfLoader, Btf, Endianness};
/// ///
/// let bpf = BpfLoader::new() /// let bpf = EbpfLoader::new()
/// // load the BTF data from a custom location /// // load the BTF data from a custom location
/// .btf(Btf::parse_file("/custom_btf_file", Endianness::default()).ok().as_ref()) /// .btf(Btf::parse_file("/custom_btf_file", Endianness::default()).ok().as_ref())
/// .load_file("file.o")?; /// .load_file("file.o")?;
/// ///
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
pub fn btf(&mut self, btf: Option<&'a Btf>) -> &mut BpfLoader<'a> { pub fn btf(&mut self, btf: Option<&'a Btf>) -> &mut EbpfLoader<'a> {
self.btf = btf.map(Cow::Borrowed); self.btf = btf.map(Cow::Borrowed);
self self
} }
@ -207,15 +211,15 @@ impl<'a> BpfLoader<'a> {
/// # Example /// # Example
/// ///
/// ```no_run /// ```no_run
/// use aya::BpfLoader; /// use aya::EbpfLoader;
/// ///
/// let bpf = BpfLoader::new() /// let bpf = EbpfLoader::new()
/// .allow_unsupported_maps() /// .allow_unsupported_maps()
/// .load_file("file.o")?; /// .load_file("file.o")?;
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
/// ///
pub fn allow_unsupported_maps(&mut self) -> &mut BpfLoader<'a> { pub fn allow_unsupported_maps(&mut self) -> &mut EbpfLoader<'a> {
self.allow_unsupported_maps = true; self.allow_unsupported_maps = true;
self self
} }
@ -228,22 +232,22 @@ impl<'a> BpfLoader<'a> {
/// # Example /// # Example
/// ///
/// ```no_run /// ```no_run
/// use aya::BpfLoader; /// use aya::EbpfLoader;
/// ///
/// let bpf = BpfLoader::new() /// let bpf = EbpfLoader::new()
/// .map_pin_path("/sys/fs/bpf/my-program") /// .map_pin_path("/sys/fs/bpf/my-program")
/// .load_file("file.o")?; /// .load_file("file.o")?;
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
/// ///
pub fn map_pin_path<P: AsRef<Path>>(&mut self, path: P) -> &mut BpfLoader<'a> { pub fn map_pin_path<P: AsRef<Path>>(&mut self, path: P) -> &mut EbpfLoader<'a> {
self.map_pin_path = Some(path.as_ref().to_owned()); self.map_pin_path = Some(path.as_ref().to_owned());
self self
} }
/// Sets the value of a global variable. /// Sets the value of a global variable.
/// ///
/// If the `must_exist` argument is `true`, [`BpfLoader::load`] will fail with [`ParseError::SymbolNotFound`] if the loaded object code does not contain the variable. /// If the `must_exist` argument is `true`, [`EbpfLoader::load`] will fail with [`ParseError::SymbolNotFound`] if the loaded object code does not contain the variable.
/// ///
/// From Rust eBPF, a global variable can be defined as follows: /// From Rust eBPF, a global variable can be defined as follows:
/// ///
@ -271,13 +275,13 @@ impl<'a> BpfLoader<'a> {
/// # Example /// # Example
/// ///
/// ```no_run /// ```no_run
/// use aya::BpfLoader; /// use aya::EbpfLoader;
/// ///
/// let bpf = BpfLoader::new() /// let bpf = EbpfLoader::new()
/// .set_global("VERSION", &2, true) /// .set_global("VERSION", &2, true)
/// .set_global("PIDS", &[1234u16, 5678], true) /// .set_global("PIDS", &[1234u16, 5678], true)
/// .load_file("file.o")?; /// .load_file("file.o")?;
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
/// ///
pub fn set_global<T: Into<GlobalData<'a>>>( pub fn set_global<T: Into<GlobalData<'a>>>(
@ -285,7 +289,7 @@ impl<'a> BpfLoader<'a> {
name: &'a str, name: &'a str,
value: T, value: T,
must_exist: bool, must_exist: bool,
) -> &mut BpfLoader<'a> { ) -> &mut EbpfLoader<'a> {
self.globals.insert(name, (value.into().bytes, must_exist)); self.globals.insert(name, (value.into().bytes, must_exist));
self self
} }
@ -298,15 +302,15 @@ impl<'a> BpfLoader<'a> {
/// # Example /// # Example
/// ///
/// ```no_run /// ```no_run
/// use aya::BpfLoader; /// use aya::EbpfLoader;
/// ///
/// let bpf = BpfLoader::new() /// let bpf = EbpfLoader::new()
/// .set_max_entries("map", 64) /// .set_max_entries("map", 64)
/// .load_file("file.o")?; /// .load_file("file.o")?;
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
/// ///
pub fn set_max_entries(&mut self, name: &'a str, size: u32) -> &mut BpfLoader<'a> { pub fn set_max_entries(&mut self, name: &'a str, size: u32) -> &mut EbpfLoader<'a> {
self.max_entries.insert(name, size); self.max_entries.insert(name, size);
self self
} }
@ -320,15 +324,15 @@ impl<'a> BpfLoader<'a> {
/// # Example /// # Example
/// ///
/// ```no_run /// ```no_run
/// use aya::BpfLoader; /// use aya::EbpfLoader;
/// ///
/// let bpf = BpfLoader::new() /// let bpf = EbpfLoader::new()
/// .extension("myfunc") /// .extension("myfunc")
/// .load_file("file.o")?; /// .load_file("file.o")?;
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
/// ///
pub fn extension(&mut self, name: &'a str) -> &mut BpfLoader<'a> { pub fn extension(&mut self, name: &'a str) -> &mut EbpfLoader<'a> {
self.extensions.insert(name); self.extensions.insert(name);
self self
} }
@ -338,15 +342,15 @@ impl<'a> BpfLoader<'a> {
/// # Example /// # Example
/// ///
/// ```no_run /// ```no_run
/// use aya::{BpfLoader, VerifierLogLevel}; /// use aya::{EbpfLoader, VerifierLogLevel};
/// ///
/// let bpf = BpfLoader::new() /// let bpf = EbpfLoader::new()
/// .verifier_log_level(VerifierLogLevel::VERBOSE | VerifierLogLevel::STATS) /// .verifier_log_level(VerifierLogLevel::VERBOSE | VerifierLogLevel::STATS)
/// .load_file("file.o")?; /// .load_file("file.o")?;
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
/// ///
pub fn verifier_log_level(&mut self, level: VerifierLogLevel) -> &mut BpfLoader<'a> { pub fn verifier_log_level(&mut self, level: VerifierLogLevel) -> &mut EbpfLoader<'a> {
self.verifier_log_level = level; self.verifier_log_level = level;
self self
} }
@ -356,14 +360,14 @@ impl<'a> BpfLoader<'a> {
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
/// use aya::BpfLoader; /// use aya::EbpfLoader;
/// ///
/// let bpf = BpfLoader::new().load_file("file.o")?; /// let bpf = EbpfLoader::new().load_file("file.o")?;
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
pub fn load_file<P: AsRef<Path>>(&mut self, path: P) -> Result<Bpf, BpfError> { pub fn load_file<P: AsRef<Path>>(&mut self, path: P) -> Result<Ebpf, EbpfError> {
let path = path.as_ref(); let path = path.as_ref();
self.load(&fs::read(path).map_err(|error| BpfError::FileError { self.load(&fs::read(path).map_err(|error| EbpfError::FileError {
path: path.to_owned(), path: path.to_owned(),
error, error,
})?) })?)
@ -374,14 +378,14 @@ impl<'a> BpfLoader<'a> {
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
/// use aya::BpfLoader; /// use aya::EbpfLoader;
/// use std::fs; /// use std::fs;
/// ///
/// let data = fs::read("file.o").unwrap(); /// let data = fs::read("file.o").unwrap();
/// let bpf = BpfLoader::new().load(&data)?; /// let bpf = EbpfLoader::new().load(&data)?;
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
pub fn load(&mut self, data: &[u8]) -> Result<Bpf, BpfError> { pub fn load(&mut self, data: &[u8]) -> Result<Ebpf, EbpfError> {
let Self { let Self {
btf, btf,
map_pin_path, map_pin_path,
@ -407,7 +411,7 @@ impl<'a> BpfLoader<'a> {
| ProgramSection::FExit { sleepable: _ } | ProgramSection::FExit { sleepable: _ }
| ProgramSection::Lsm { sleepable: _ } | ProgramSection::Lsm { sleepable: _ }
| ProgramSection::BtfTracePoint => { | ProgramSection::BtfTracePoint => {
return Err(BpfError::BtfError(err)) return Err(EbpfError::BtfError(err))
} }
ProgramSection::KRetProbe ProgramSection::KRetProbe
| ProgramSection::KProbe | ProgramSection::KProbe
@ -456,14 +460,14 @@ impl<'a> BpfLoader<'a> {
} }
let mut maps = HashMap::new(); let mut maps = HashMap::new();
for (name, mut obj) in obj.maps.drain() { for (name, mut obj) in obj.maps.drain() {
if let (false, BpfSectionKind::Bss | BpfSectionKind::Data | BpfSectionKind::Rodata) = if let (false, EbpfSectionKind::Bss | EbpfSectionKind::Data | EbpfSectionKind::Rodata) =
(FEATURES.bpf_global_data(), obj.section_kind()) (FEATURES.bpf_global_data(), obj.section_kind())
{ {
continue; continue;
} }
let num_cpus = || -> Result<u32, BpfError> { let num_cpus = || -> Result<u32, EbpfError> {
Ok(possible_cpus() Ok(possible_cpus()
.map_err(|error| BpfError::FileError { .map_err(|error| EbpfError::FileError {
path: PathBuf::from(POSSIBLE_CPUS), path: PathBuf::from(POSSIBLE_CPUS),
error, error,
})? })?
@ -694,22 +698,22 @@ impl<'a> BpfLoader<'a> {
let maps = maps let maps = maps
.drain() .drain()
.map(parse_map) .map(parse_map)
.collect::<Result<HashMap<String, Map>, BpfError>>()?; .collect::<Result<HashMap<String, Map>, EbpfError>>()?;
if !*allow_unsupported_maps { if !*allow_unsupported_maps {
maps.iter().try_for_each(|(_, x)| match x { maps.iter().try_for_each(|(_, x)| match x {
Map::Unsupported(map) => Err(BpfError::MapError(MapError::Unsupported { Map::Unsupported(map) => Err(EbpfError::MapError(MapError::Unsupported {
map_type: map.obj().map_type(), map_type: map.obj().map_type(),
})), })),
_ => Ok(()), _ => Ok(()),
})?; })?;
}; };
Ok(Bpf { maps, programs }) Ok(Ebpf { maps, programs })
} }
} }
fn parse_map(data: (String, MapData)) -> Result<(String, Map), BpfError> { fn parse_map(data: (String, MapData)) -> Result<(String, Map), EbpfError> {
let (name, map) = data; let (name, map) = data;
let map_type = bpf_map_type::try_from(map.obj().map_type()).map_err(MapError::from)?; let map_type = bpf_map_type::try_from(map.obj().map_type()).map_err(MapError::from)?;
let map = match map_type { let map = match map_type {
@ -748,9 +752,9 @@ fn max_entries_override(
map_type: bpf_map_type, map_type: bpf_map_type,
user_override: Option<u32>, user_override: Option<u32>,
current_value: impl Fn() -> u32, current_value: impl Fn() -> u32,
num_cpus: impl Fn() -> Result<u32, BpfError>, num_cpus: impl Fn() -> Result<u32, EbpfError>,
page_size: impl Fn() -> u32, page_size: impl Fn() -> u32,
) -> Result<Option<u32>, BpfError> { ) -> Result<Option<u32>, EbpfError> {
let max_entries = || user_override.unwrap_or_else(&current_value); let max_entries = || user_override.unwrap_or_else(&current_value);
Ok(match map_type { Ok(match map_type {
BPF_MAP_TYPE_PERF_EVENT_ARRAY if max_entries() == 0 => Some(num_cpus()?), BPF_MAP_TYPE_PERF_EVENT_ARRAY if max_entries() == 0 => Some(num_cpus()?),
@ -841,38 +845,42 @@ mod tests {
} }
} }
impl Default for BpfLoader<'_> { impl Default for EbpfLoader<'_> {
fn default() -> Self { fn default() -> Self {
BpfLoader::new() EbpfLoader::new()
} }
} }
/// The main entry point into the library, used to work with eBPF programs and maps. /// The main entry point into the library, used to work with eBPF programs and maps.
#[derive(Debug)] #[derive(Debug)]
pub struct Bpf { pub struct Ebpf {
maps: HashMap<String, Map>, maps: HashMap<String, Map>,
programs: HashMap<String, Program>, programs: HashMap<String, Program>,
} }
impl Bpf { /// The main entry point into the library, used to work with eBPF programs and maps.
#[deprecated(since = "0.13.0", note = "use `Ebpf` instead")]
pub type Bpf = Ebpf;
impl Ebpf {
/// Loads eBPF bytecode from a file. /// Loads eBPF bytecode from a file.
/// ///
/// Parses the given object code file and initializes the [maps](crate::maps) defined in it. If /// Parses the given object code file and initializes the [maps](crate::maps) defined in it. If
/// the kernel supports [BTF](Btf) debug info, it is automatically loaded from /// the kernel supports [BTF](Btf) debug info, it is automatically loaded from
/// `/sys/kernel/btf/vmlinux`. /// `/sys/kernel/btf/vmlinux`.
/// ///
/// For more loading options, see [BpfLoader]. /// For more loading options, see [EbpfLoader].
/// ///
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
/// use aya::Bpf; /// use aya::Ebpf;
/// ///
/// let bpf = Bpf::load_file("file.o")?; /// let bpf = Ebpf::load_file("file.o")?;
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
pub fn load_file<P: AsRef<Path>>(path: P) -> Result<Self, BpfError> { pub fn load_file<P: AsRef<Path>>(path: P) -> Result<Self, EbpfError> {
BpfLoader::new() EbpfLoader::new()
.btf(Btf::from_sys_fs().ok().as_ref()) .btf(Btf::from_sys_fs().ok().as_ref())
.load_file(path) .load_file(path)
} }
@ -883,21 +891,21 @@ impl Bpf {
/// [maps](crate::maps) defined in it. If the kernel supports [BTF](Btf) /// [maps](crate::maps) defined in it. If the kernel supports [BTF](Btf)
/// debug info, it is automatically loaded from `/sys/kernel/btf/vmlinux`. /// debug info, it is automatically loaded from `/sys/kernel/btf/vmlinux`.
/// ///
/// For more loading options, see [BpfLoader]. /// For more loading options, see [EbpfLoader].
/// ///
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
/// use aya::{Bpf, Btf}; /// use aya::{Ebpf, Btf};
/// use std::fs; /// use std::fs;
/// ///
/// let data = fs::read("file.o").unwrap(); /// let data = fs::read("file.o").unwrap();
/// // load the BTF data from /sys/kernel/btf/vmlinux /// // load the BTF data from /sys/kernel/btf/vmlinux
/// let bpf = Bpf::load(&data)?; /// let bpf = Ebpf::load(&data)?;
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
pub fn load(data: &[u8]) -> Result<Self, BpfError> { pub fn load(data: &[u8]) -> Result<Self, EbpfError> {
BpfLoader::new() EbpfLoader::new()
.btf(Btf::from_sys_fs().ok().as_ref()) .btf(Btf::from_sys_fs().ok().as_ref())
.load(data) .load(data)
} }
@ -926,7 +934,7 @@ impl Bpf {
/// Takes ownership of a map with the given name. /// Takes ownership of a map with the given name.
/// ///
/// Use this when borrowing with [`map`](crate::Bpf::map) or [`map_mut`](crate::Bpf::map_mut) /// Use this when borrowing with [`map`](crate::Ebpf::map) or [`map_mut`](crate::Ebpf::map_mut)
/// is not possible (eg when using the map from an async task). The returned /// is not possible (eg when using the map from an async task). The returned
/// map will be closed on `Drop`, therefore the caller is responsible for /// map will be closed on `Drop`, therefore the caller is responsible for
/// managing its lifetime. /// managing its lifetime.
@ -944,14 +952,14 @@ impl Bpf {
/// ///
/// # Examples /// # Examples
/// ```no_run /// ```no_run
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// for (name, map) in bpf.maps() { /// for (name, map) in bpf.maps() {
/// println!( /// println!(
/// "found map `{}`", /// "found map `{}`",
/// name, /// name,
/// ); /// );
/// } /// }
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
pub fn maps(&self) -> impl Iterator<Item = (&str, &Map)> { pub fn maps(&self) -> impl Iterator<Item = (&str, &Map)> {
self.maps.iter().map(|(name, map)| (name.as_str(), map)) self.maps.iter().map(|(name, map)| (name.as_str(), map))
@ -965,11 +973,11 @@ impl Bpf {
/// # #[derive(thiserror::Error, Debug)] /// # #[derive(thiserror::Error, Debug)]
/// # enum Error { /// # enum Error {
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError), /// # Ebpf(#[from] aya::EbpfError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Pin(#[from] aya::pin::PinError) /// # Pin(#[from] aya::pin::PinError)
/// # } /// # }
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// # let pin_path = Path::new("/tmp/pin_path"); /// # let pin_path = Path::new("/tmp/pin_path");
/// for (_, map) in bpf.maps_mut() { /// for (_, map) in bpf.maps_mut() {
/// map.pin(pin_path)?; /// map.pin(pin_path)?;
@ -991,10 +999,10 @@ impl Bpf {
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
/// # let bpf = aya::Bpf::load(&[])?; /// # let bpf = aya::Ebpf::load(&[])?;
/// let program = bpf.program("SSL_read").unwrap(); /// let program = bpf.program("SSL_read").unwrap();
/// println!("program SSL_read is of type {:?}", program.prog_type()); /// println!("program SSL_read is of type {:?}", program.prog_type());
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
pub fn program(&self, name: &str) -> Option<&Program> { pub fn program(&self, name: &str) -> Option<&Program> {
self.programs.get(name) self.programs.get(name)
@ -1008,13 +1016,13 @@ impl Bpf {
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use aya::programs::UProbe; /// use aya::programs::UProbe;
/// ///
/// let program: &mut UProbe = bpf.program_mut("SSL_read").unwrap().try_into()?; /// let program: &mut UProbe = bpf.program_mut("SSL_read").unwrap().try_into()?;
/// program.load()?; /// program.load()?;
/// program.attach(Some("SSL_read"), 0, "libssl", None)?; /// program.attach(Some("SSL_read"), 0, "libssl", None)?;
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
pub fn program_mut(&mut self, name: &str) -> Option<&mut Program> { pub fn program_mut(&mut self, name: &str) -> Option<&mut Program> {
self.programs.get_mut(name) self.programs.get_mut(name)
@ -1024,7 +1032,7 @@ impl Bpf {
/// ///
/// # Examples /// # Examples
/// ```no_run /// ```no_run
/// # let bpf = aya::Bpf::load(&[])?; /// # let bpf = aya::Ebpf::load(&[])?;
/// for (name, program) in bpf.programs() { /// for (name, program) in bpf.programs() {
/// println!( /// println!(
/// "found program `{}` of type `{:?}`", /// "found program `{}` of type `{:?}`",
@ -1032,7 +1040,7 @@ impl Bpf {
/// program.prog_type() /// program.prog_type()
/// ); /// );
/// } /// }
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
pub fn programs(&self) -> impl Iterator<Item = (&str, &Program)> { pub fn programs(&self) -> impl Iterator<Item = (&str, &Program)> {
self.programs.iter().map(|(s, p)| (s.as_str(), p)) self.programs.iter().map(|(s, p)| (s.as_str(), p))
@ -1046,11 +1054,11 @@ impl Bpf {
/// # #[derive(thiserror::Error, Debug)] /// # #[derive(thiserror::Error, Debug)]
/// # enum Error { /// # enum Error {
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError), /// # Ebpf(#[from] aya::EbpfError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Pin(#[from] aya::pin::PinError) /// # Pin(#[from] aya::pin::PinError)
/// # } /// # }
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// # let pin_path = Path::new("/tmp/pin_path"); /// # let pin_path = Path::new("/tmp/pin_path");
/// for (_, program) in bpf.programs_mut() { /// for (_, program) in bpf.programs_mut() {
/// program.pin(pin_path)?; /// program.pin(pin_path)?;
@ -1062,9 +1070,9 @@ impl Bpf {
} }
} }
/// The error type returned by [`Bpf::load_file`] and [`Bpf::load`]. /// The error type returned by [`Ebpf::load_file`] and [`Ebpf::load`].
#[derive(Debug, Error)] #[derive(Debug, Error)]
pub enum BpfError { pub enum EbpfError {
/// Error loading file /// Error loading file
#[error("error loading {path}")] #[error("error loading {path}")]
FileError { FileError {
@ -1092,7 +1100,7 @@ pub enum BpfError {
/// Error performing relocations /// Error performing relocations
#[error("error relocating function")] #[error("error relocating function")]
RelocationError(#[from] BpfRelocationError), RelocationError(#[from] EbpfRelocationError),
/// Error performing relocations /// Error performing relocations
#[error("error relocating section")] #[error("error relocating section")]
@ -1111,6 +1119,10 @@ pub enum BpfError {
ProgramError(#[from] ProgramError), ProgramError(#[from] ProgramError),
} }
/// The error type returned by [`Bpf::load_file`] and [`Bpf::load`].
#[deprecated(since = "0.13.0", note = "use `EbpfError` instead")]
pub type BpfError = EbpfError;
fn load_btf(raw_btf: Vec<u8>, verifier_log_level: VerifierLogLevel) -> Result<OwnedFd, BtfError> { fn load_btf(raw_btf: Vec<u8>, verifier_log_level: VerifierLogLevel) -> Result<OwnedFd, BtfError> {
let (ret, verifier_log) = retry_with_verifier_logs(10, |logger| { let (ret, verifier_log) = retry_with_verifier_logs(10, |logger| {
bpf_load_btf(raw_btf.as_slice(), logger, verifier_log_level) bpf_load_btf(raw_btf.as_slice(), logger, verifier_log_level)
@ -1124,7 +1136,7 @@ fn load_btf(raw_btf: Vec<u8>, verifier_log_level: VerifierLogLevel) -> Result<Ow
/// Global data that can be exported to eBPF programs before they are loaded. /// Global data that can be exported to eBPF programs before they are loaded.
/// ///
/// Valid global data includes `Pod` types and slices of `Pod` types. See also /// Valid global data includes `Pod` types and slices of `Pod` types. See also
/// [BpfLoader::set_global]. /// [EbpfLoader::set_global].
pub struct GlobalData<'a> { pub struct GlobalData<'a> {
bytes: &'a [u8], bytes: &'a [u8],
} }

@ -21,13 +21,13 @@ use crate::{
/// ///
/// # Examples /// # Examples
/// ```no_run /// ```no_run
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use aya::maps::Array; /// use aya::maps::Array;
/// ///
/// let mut array = Array::try_from(bpf.map_mut("ARRAY").unwrap())?; /// let mut array = Array::try_from(bpf.map_mut("ARRAY").unwrap())?;
/// array.set(1, 42, 0)?; /// array.set(1, 42, 0)?;
/// assert_eq!(array.get(&1, 0)?, 42); /// assert_eq!(array.get(&1, 0)?, 42);
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
#[doc(alias = "BPF_MAP_TYPE_ARRAY")] #[doc(alias = "BPF_MAP_TYPE_ARRAY")]
pub struct Array<T, V: Pod> { pub struct Array<T, V: Pod> {

@ -28,9 +28,9 @@ use crate::{
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Map(#[from] aya::maps::MapError), /// # Map(#[from] aya::maps::MapError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError) /// # Ebpf(#[from] aya::EbpfError)
/// # } /// # }
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use aya::maps::{PerCpuArray, PerCpuValues}; /// use aya::maps::{PerCpuArray, PerCpuValues};
/// use aya::util::nr_cpus; /// use aya::util::nr_cpus;
/// ///

@ -23,7 +23,7 @@ use crate::{
/// ///
/// # Examples /// # Examples
/// ```no_run /// ```no_run
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use aya::maps::ProgramArray; /// use aya::maps::ProgramArray;
/// use aya::programs::CgroupSkb; /// use aya::programs::CgroupSkb;
/// ///
@ -44,7 +44,7 @@ use crate::{
/// ///
/// // bpf_tail_call(ctx, JUMP_TABLE, 2) will jump to prog_2 /// // bpf_tail_call(ctx, JUMP_TABLE, 2) will jump to prog_2
/// prog_array.set(2, &prog_2_fd, flags); /// prog_array.set(2, &prog_2_fd, flags);
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
#[doc(alias = "BPF_MAP_TYPE_PROG_ARRAY")] #[doc(alias = "BPF_MAP_TYPE_PROG_ARRAY")]
pub struct ProgramArray<T> { pub struct ProgramArray<T> {

@ -20,7 +20,7 @@ use crate::{
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use aya::maps::bloom_filter::BloomFilter; /// use aya::maps::bloom_filter::BloomFilter;
/// ///
/// let mut bloom_filter = BloomFilter::try_from(bpf.map_mut("BLOOM_FILTER").unwrap())?; /// let mut bloom_filter = BloomFilter::try_from(bpf.map_mut("BLOOM_FILTER").unwrap())?;
@ -30,7 +30,7 @@ use crate::{
/// assert!(bloom_filter.contains(&1, 0).is_ok()); /// assert!(bloom_filter.contains(&1, 0).is_ok());
/// assert!(bloom_filter.contains(&2, 0).is_err()); /// assert!(bloom_filter.contains(&2, 0).is_err());
/// ///
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
#[doc(alias = "BPF_MAP_TYPE_BLOOM_FILTER")] #[doc(alias = "BPF_MAP_TYPE_BLOOM_FILTER")]
@ -92,7 +92,7 @@ mod tests {
bpf_map_type::{BPF_MAP_TYPE_BLOOM_FILTER, BPF_MAP_TYPE_PERF_EVENT_ARRAY}, bpf_map_type::{BPF_MAP_TYPE_BLOOM_FILTER, BPF_MAP_TYPE_PERF_EVENT_ARRAY},
}, },
maps::Map, maps::Map,
obj::{self, maps::LegacyMap, BpfSectionKind}, obj::{self, maps::LegacyMap, EbpfSectionKind},
sys::{override_syscall, SysResult, Syscall}, sys::{override_syscall, SysResult, Syscall},
}; };
@ -106,7 +106,7 @@ mod tests {
..Default::default() ..Default::default()
}, },
section_index: 0, section_index: 0,
section_kind: BpfSectionKind::Maps, section_kind: EbpfSectionKind::Maps,
symbol_index: None, symbol_index: None,
data: Vec::new(), data: Vec::new(),
}) })
@ -114,7 +114,7 @@ mod tests {
fn new_map(obj: obj::Map) -> MapData { fn new_map(obj: obj::Map) -> MapData {
override_syscall(|call| match call { override_syscall(|call| match call {
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_MAP_CREATE, cmd: bpf_cmd::BPF_MAP_CREATE,
.. ..
} => Ok(1337), } => Ok(1337),
@ -150,7 +150,7 @@ mod tests {
..Default::default() ..Default::default()
}, },
section_index: 0, section_index: 0,
section_kind: BpfSectionKind::Maps, section_kind: EbpfSectionKind::Maps,
symbol_index: None, symbol_index: None,
data: Vec::new(), data: Vec::new(),
})); }));
@ -197,7 +197,7 @@ mod tests {
let mut bloom_filter = BloomFilter::<_, u32>::new(&mut map).unwrap(); let mut bloom_filter = BloomFilter::<_, u32>::new(&mut map).unwrap();
override_syscall(|call| match call { override_syscall(|call| match call {
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_MAP_UPDATE_ELEM, cmd: bpf_cmd::BPF_MAP_UPDATE_ELEM,
.. ..
} => Ok(1), } => Ok(1),
@ -226,7 +226,7 @@ mod tests {
let bloom_filter = BloomFilter::<_, u32>::new(&map).unwrap(); let bloom_filter = BloomFilter::<_, u32>::new(&map).unwrap();
override_syscall(|call| match call { override_syscall(|call| match call {
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_MAP_LOOKUP_ELEM, cmd: bpf_cmd::BPF_MAP_LOOKUP_ELEM,
.. ..
} => sys_error(ENOENT), } => sys_error(ENOENT),

@ -19,7 +19,7 @@ use crate::{
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use aya::maps::HashMap; /// use aya::maps::HashMap;
/// ///
/// let mut redirect_ports = HashMap::try_from(bpf.map_mut("REDIRECT_PORTS").unwrap())?; /// let mut redirect_ports = HashMap::try_from(bpf.map_mut("REDIRECT_PORTS").unwrap())?;
@ -28,7 +28,7 @@ use crate::{
/// redirect_ports.insert(80, 8080, 0); /// redirect_ports.insert(80, 8080, 0);
/// // redirect port 443 to 8443 /// // redirect port 443 to 8443
/// redirect_ports.insert(443, 8443, 0); /// redirect_ports.insert(443, 8443, 0);
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
#[doc(alias = "BPF_MAP_TYPE_HASH")] #[doc(alias = "BPF_MAP_TYPE_HASH")]
#[doc(alias = "BPF_MAP_TYPE_LRU_HASH")] #[doc(alias = "BPF_MAP_TYPE_LRU_HASH")]
@ -218,7 +218,7 @@ mod tests {
let mut hm = HashMap::<_, u32, u32>::new(&mut map).unwrap(); let mut hm = HashMap::<_, u32, u32>::new(&mut map).unwrap();
override_syscall(|call| match call { override_syscall(|call| match call {
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_MAP_UPDATE_ELEM, cmd: bpf_cmd::BPF_MAP_UPDATE_ELEM,
.. ..
} => Ok(1), } => Ok(1),
@ -234,7 +234,7 @@ mod tests {
let mut hm = HashMap::<_, u32, u32>::new(&mut map).unwrap(); let mut hm = HashMap::<_, u32, u32>::new(&mut map).unwrap();
override_syscall(|call| match call { override_syscall(|call| match call {
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_MAP_UPDATE_ELEM, cmd: bpf_cmd::BPF_MAP_UPDATE_ELEM,
.. ..
} => Ok(1), } => Ok(1),
@ -263,7 +263,7 @@ mod tests {
let mut hm = HashMap::<_, u32, u32>::new(&mut map).unwrap(); let mut hm = HashMap::<_, u32, u32>::new(&mut map).unwrap();
override_syscall(|call| match call { override_syscall(|call| match call {
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_MAP_DELETE_ELEM, cmd: bpf_cmd::BPF_MAP_DELETE_ELEM,
.. ..
} => Ok(1), } => Ok(1),
@ -289,7 +289,7 @@ mod tests {
fn test_get_not_found() { fn test_get_not_found() {
let map = new_map(new_obj_map()); let map = new_map(new_obj_map());
override_syscall(|call| match call { override_syscall(|call| match call {
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_MAP_LOOKUP_ELEM, cmd: bpf_cmd::BPF_MAP_LOOKUP_ELEM,
.. ..
} => sys_error(ENOENT), } => sys_error(ENOENT),
@ -321,7 +321,7 @@ mod tests {
fn test_keys_empty() { fn test_keys_empty() {
let map = new_map(new_obj_map()); let map = new_map(new_obj_map());
override_syscall(|call| match call { override_syscall(|call| match call {
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_MAP_GET_NEXT_KEY, cmd: bpf_cmd::BPF_MAP_GET_NEXT_KEY,
.. ..
} => sys_error(ENOENT), } => sys_error(ENOENT),
@ -365,7 +365,7 @@ mod tests {
let map = new_map(new_obj_map()); let map = new_map(new_obj_map());
override_syscall(|call| match call { override_syscall(|call| match call {
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_MAP_GET_NEXT_KEY, cmd: bpf_cmd::BPF_MAP_GET_NEXT_KEY,
attr, attr,
} => get_next_key(attr), } => get_next_key(attr),
@ -386,7 +386,7 @@ mod tests {
fn test_keys_error() { fn test_keys_error() {
let map = new_map(new_obj_map()); let map = new_map(new_obj_map());
override_syscall(|call| match call { override_syscall(|call| match call {
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_MAP_GET_NEXT_KEY, cmd: bpf_cmd::BPF_MAP_GET_NEXT_KEY,
attr, attr,
} => { } => {
@ -423,11 +423,11 @@ mod tests {
fn test_iter() { fn test_iter() {
let map = new_map(new_obj_map()); let map = new_map(new_obj_map());
override_syscall(|call| match call { override_syscall(|call| match call {
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_MAP_GET_NEXT_KEY, cmd: bpf_cmd::BPF_MAP_GET_NEXT_KEY,
attr, attr,
} => get_next_key(attr), } => get_next_key(attr),
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_MAP_LOOKUP_ELEM, cmd: bpf_cmd::BPF_MAP_LOOKUP_ELEM,
attr, attr,
} => lookup_elem(attr), } => lookup_elem(attr),
@ -446,11 +446,11 @@ mod tests {
fn test_iter_key_deleted() { fn test_iter_key_deleted() {
let map = new_map(new_obj_map()); let map = new_map(new_obj_map());
override_syscall(|call| match call { override_syscall(|call| match call {
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_MAP_GET_NEXT_KEY, cmd: bpf_cmd::BPF_MAP_GET_NEXT_KEY,
attr, attr,
} => get_next_key(attr), } => get_next_key(attr),
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_MAP_LOOKUP_ELEM, cmd: bpf_cmd::BPF_MAP_LOOKUP_ELEM,
attr, attr,
} => { } => {
@ -480,7 +480,7 @@ mod tests {
fn test_iter_key_error() { fn test_iter_key_error() {
let map = new_map(new_obj_map()); let map = new_map(new_obj_map());
override_syscall(|call| match call { override_syscall(|call| match call {
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_MAP_GET_NEXT_KEY, cmd: bpf_cmd::BPF_MAP_GET_NEXT_KEY,
attr, attr,
} => { } => {
@ -494,7 +494,7 @@ mod tests {
Ok(1) Ok(1)
} }
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_MAP_LOOKUP_ELEM, cmd: bpf_cmd::BPF_MAP_LOOKUP_ELEM,
attr, attr,
} => lookup_elem(attr), } => lookup_elem(attr),
@ -523,11 +523,11 @@ mod tests {
fn test_iter_value_error() { fn test_iter_value_error() {
let map = new_map(new_obj_map()); let map = new_map(new_obj_map());
override_syscall(|call| match call { override_syscall(|call| match call {
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_MAP_GET_NEXT_KEY, cmd: bpf_cmd::BPF_MAP_GET_NEXT_KEY,
attr, attr,
} => get_next_key(attr), } => get_next_key(attr),
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_MAP_LOOKUP_ELEM, cmd: bpf_cmd::BPF_MAP_LOOKUP_ELEM,
attr, attr,
} => { } => {

@ -50,13 +50,13 @@ mod test_utils {
bpf_map_def, bpf_map_def,
generated::{bpf_cmd, bpf_map_type}, generated::{bpf_cmd, bpf_map_type},
maps::MapData, maps::MapData,
obj::{self, maps::LegacyMap, BpfSectionKind}, obj::{self, maps::LegacyMap, EbpfSectionKind},
sys::{override_syscall, Syscall}, sys::{override_syscall, Syscall},
}; };
pub(super) fn new_map(obj: obj::Map) -> MapData { pub(super) fn new_map(obj: obj::Map) -> MapData {
override_syscall(|call| match call { override_syscall(|call| match call {
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_MAP_CREATE, cmd: bpf_cmd::BPF_MAP_CREATE,
.. ..
} => Ok(1337), } => Ok(1337),
@ -75,7 +75,7 @@ mod test_utils {
..Default::default() ..Default::default()
}, },
section_index: 0, section_index: 0,
section_kind: BpfSectionKind::Maps, section_kind: EbpfSectionKind::Maps,
data: Vec::new(), data: Vec::new(),
symbol_index: None, symbol_index: None,
}) })

@ -26,7 +26,7 @@ use crate::{
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use aya::maps::PerCpuHashMap; /// use aya::maps::PerCpuHashMap;
/// ///
/// const CPU_IDS: u8 = 1; /// const CPU_IDS: u8 = 1;
@ -38,7 +38,7 @@ use crate::{
/// for (cpu_id, wakeups) in cpu_ids.iter().zip(wakeups.iter()) { /// for (cpu_id, wakeups) in cpu_ids.iter().zip(wakeups.iter()) {
/// println!("cpu {} woke up {} times", cpu_id, wakeups); /// println!("cpu {} woke up {} times", cpu_id, wakeups);
/// } /// }
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
#[doc(alias = "BPF_MAP_TYPE_LRU_PERCPU_HASH")] #[doc(alias = "BPF_MAP_TYPE_LRU_PERCPU_HASH")]
#[doc(alias = "BPF_MAP_TYPE_PERCPU_HASH")] #[doc(alias = "BPF_MAP_TYPE_PERCPU_HASH")]
@ -97,9 +97,9 @@ impl<T: BorrowMut<MapData>, K: Pod, V: Pod> PerCpuHashMap<T, K, V> {
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Map(#[from] aya::maps::MapError), /// # Map(#[from] aya::maps::MapError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError) /// # Ebpf(#[from] aya::EbpfError)
/// # } /// # }
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use aya::maps::{PerCpuHashMap, PerCpuValues}; /// use aya::maps::{PerCpuHashMap, PerCpuValues};
/// use aya::util::nr_cpus; /// use aya::util::nr_cpus;
/// ///

@ -20,7 +20,7 @@ use crate::{
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use aya::maps::lpm_trie::{LpmTrie, Key}; /// use aya::maps::lpm_trie::{LpmTrie, Key};
/// use std::net::Ipv4Addr; /// use std::net::Ipv4Addr;
/// ///
@ -42,7 +42,7 @@ use crate::{
/// trie.insert(&longer_key, 2, 0)?; /// trie.insert(&longer_key, 2, 0)?;
/// let value = trie.get(&lookup, 0)?; /// let value = trie.get(&lookup, 0)?;
/// assert_eq!(value, 2); /// assert_eq!(value, 2);
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
#[doc(alias = "BPF_MAP_TYPE_LPM_TRIE")] #[doc(alias = "BPF_MAP_TYPE_LPM_TRIE")]
@ -209,7 +209,7 @@ mod tests {
bpf_map_type::{BPF_MAP_TYPE_LPM_TRIE, BPF_MAP_TYPE_PERF_EVENT_ARRAY}, bpf_map_type::{BPF_MAP_TYPE_LPM_TRIE, BPF_MAP_TYPE_PERF_EVENT_ARRAY},
}, },
maps::Map, maps::Map,
obj::{self, maps::LegacyMap, BpfSectionKind}, obj::{self, maps::LegacyMap, EbpfSectionKind},
sys::{override_syscall, SysResult, Syscall}, sys::{override_syscall, SysResult, Syscall},
}; };
@ -223,7 +223,7 @@ mod tests {
..Default::default() ..Default::default()
}, },
section_index: 0, section_index: 0,
section_kind: BpfSectionKind::Maps, section_kind: EbpfSectionKind::Maps,
symbol_index: None, symbol_index: None,
data: Vec::new(), data: Vec::new(),
}) })
@ -231,7 +231,7 @@ mod tests {
fn new_map(obj: obj::Map) -> MapData { fn new_map(obj: obj::Map) -> MapData {
override_syscall(|call| match call { override_syscall(|call| match call {
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_MAP_CREATE, cmd: bpf_cmd::BPF_MAP_CREATE,
.. ..
} => Ok(1337), } => Ok(1337),
@ -279,7 +279,7 @@ mod tests {
..Default::default() ..Default::default()
}, },
section_index: 0, section_index: 0,
section_kind: BpfSectionKind::Maps, section_kind: EbpfSectionKind::Maps,
symbol_index: None, symbol_index: None,
data: Vec::new(), data: Vec::new(),
})); }));
@ -330,7 +330,7 @@ mod tests {
let key = Key::new(16, u32::from(ipaddr).to_be()); let key = Key::new(16, u32::from(ipaddr).to_be());
override_syscall(|call| match call { override_syscall(|call| match call {
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_MAP_UPDATE_ELEM, cmd: bpf_cmd::BPF_MAP_UPDATE_ELEM,
.. ..
} => Ok(1), } => Ok(1),
@ -363,7 +363,7 @@ mod tests {
let key = Key::new(16, u32::from(ipaddr).to_be()); let key = Key::new(16, u32::from(ipaddr).to_be());
override_syscall(|call| match call { override_syscall(|call| match call {
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_MAP_DELETE_ELEM, cmd: bpf_cmd::BPF_MAP_DELETE_ELEM,
.. ..
} => Ok(1), } => Ok(1),
@ -396,7 +396,7 @@ mod tests {
let key = Key::new(16, u32::from(ipaddr).to_be()); let key = Key::new(16, u32::from(ipaddr).to_be());
override_syscall(|call| match call { override_syscall(|call| match call {
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_MAP_LOOKUP_ELEM, cmd: bpf_cmd::BPF_MAP_LOOKUP_ELEM,
.. ..
} => sys_error(ENOENT), } => sys_error(ENOENT),

@ -2,17 +2,17 @@
//! //!
//! The eBPF platform provides data structures - maps in eBPF speak - that are //! The eBPF platform provides data structures - maps in eBPF speak - that are
//! used to setup and share data with eBPF programs. When you call //! used to setup and share data with eBPF programs. When you call
//! [`Bpf::load_file`](crate::Bpf::load_file) or //! [`Ebpf::load_file`](crate::Ebpf::load_file) or
//! [`Bpf::load`](crate::Bpf::load), all the maps defined in the eBPF code get //! [`Ebpf::load`](crate::Ebpf::load), all the maps defined in the eBPF code get
//! initialized and can then be accessed using [`Bpf::map`](crate::Bpf::map), //! initialized and can then be accessed using [`Ebpf::map`](crate::Ebpf::map),
//! [`Bpf::map_mut`](crate::Bpf::map_mut), or //! [`Ebpf::map_mut`](crate::Ebpf::map_mut), or
//! [`Bpf::take_map`](crate::Bpf::take_map). //! [`Ebpf::take_map`](crate::Ebpf::take_map).
//! //!
//! # Typed maps //! # Typed maps
//! //!
//! The eBPF API includes many map types each supporting different operations. //! The eBPF API includes many map types each supporting different operations.
//! [`Bpf::map`](crate::Bpf::map), [`Bpf::map_mut`](crate::Bpf::map_mut), and //! [`Ebpf::map`](crate::Ebpf::map), [`Ebpf::map_mut`](crate::Ebpf::map_mut), and
//! [`Bpf::take_map`](crate::Bpf::take_map) always return the opaque //! [`Ebpf::take_map`](crate::Ebpf::take_map) always return the opaque
//! [`&Map`](crate::maps::Map), [`&mut Map`](crate::maps::Map), and [`Map`] //! [`&Map`](crate::maps::Map), [`&mut Map`](crate::maps::Map), and [`Map`]
//! types respectively. Those three types can be converted to *typed maps* using //! types respectively. Those three types can be converted to *typed maps* using
//! the [`TryFrom`] or [`TryInto`] trait. For example: //! the [`TryFrom`] or [`TryInto`] trait. For example:
@ -27,9 +27,9 @@
//! # #[error(transparent)] //! # #[error(transparent)]
//! # Program(#[from] aya::programs::ProgramError), //! # Program(#[from] aya::programs::ProgramError),
//! # #[error(transparent)] //! # #[error(transparent)]
//! # Bpf(#[from] aya::BpfError) //! # Ebpf(#[from] aya::EbpfError)
//! # } //! # }
//! # let mut bpf = aya::Bpf::load(&[])?; //! # let mut bpf = aya::Ebpf::load(&[])?;
//! use aya::maps::SockMap; //! use aya::maps::SockMap;
//! use aya::programs::SkMsg; //! use aya::programs::SkMsg;
//! //!
@ -66,7 +66,7 @@ use thiserror::Error;
use crate::{ use crate::{
generated::bpf_map_info, generated::bpf_map_info,
obj::{self, parse_map_info, BpfSectionKind}, obj::{self, parse_map_info, EbpfSectionKind},
pin::PinError, pin::PinError,
sys::{ sys::{
bpf_create_map, bpf_get_object, bpf_map_freeze, bpf_map_get_fd_by_id, bpf_create_map, bpf_get_object, bpf_map_freeze, bpf_map_get_fd_by_id,
@ -602,7 +602,7 @@ impl MapData {
pub(crate) fn finalize(&mut self) -> Result<(), MapError> { pub(crate) fn finalize(&mut self) -> Result<(), MapError> {
let Self { obj, fd } = self; let Self { obj, fd } = self;
if !obj.data().is_empty() && obj.section_kind() != BpfSectionKind::Bss { if !obj.data().is_empty() && obj.section_kind() != EbpfSectionKind::Bss {
bpf_map_update_elem_ptr(fd.as_fd(), &0 as *const _, obj.data_mut().as_mut_ptr(), 0) bpf_map_update_elem_ptr(fd.as_fd(), &0 as *const _, obj.data_mut().as_mut_ptr(), 0)
.map_err(|(_, io_error)| SyscallError { .map_err(|(_, io_error)| SyscallError {
call: "bpf_map_update_elem", call: "bpf_map_update_elem",
@ -610,7 +610,7 @@ impl MapData {
}) })
.map_err(MapError::from)?; .map_err(MapError::from)?;
} }
if obj.section_kind() == BpfSectionKind::Rodata { if obj.section_kind() == EbpfSectionKind::Rodata {
bpf_map_freeze(fd.as_fd()) bpf_map_freeze(fd.as_fd())
.map_err(|(_, io_error)| SyscallError { .map_err(|(_, io_error)| SyscallError {
call: "bpf_map_freeze", call: "bpf_map_freeze",
@ -678,7 +678,7 @@ impl MapData {
/// # Example /// # Example
/// ///
/// ```no_run /// ```no_run
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// # use aya::maps::MapData; /// # use aya::maps::MapData;
/// ///
/// let mut map = MapData::from_pin("/sys/fs/bpf/my_map")?; /// let mut map = MapData::from_pin("/sys/fs/bpf/my_map")?;
@ -833,9 +833,9 @@ impl PerCpuKernelMem {
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Map(#[from] aya::maps::MapError), /// # Map(#[from] aya::maps::MapError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError) /// # Ebpf(#[from] aya::EbpfError)
/// # } /// # }
/// # let bpf = aya::Bpf::load(&[])?; /// # let bpf = aya::Ebpf::load(&[])?;
/// use aya::maps::PerCpuValues; /// use aya::maps::PerCpuValues;
/// use aya::util::nr_cpus; /// use aya::util::nr_cpus;
/// ///
@ -992,8 +992,8 @@ impl MapInfo {
/// Returns an iterator over all loaded bpf maps. /// Returns an iterator over all loaded bpf maps.
/// ///
/// This differs from [`crate::Bpf::maps`] since it will return all maps /// This differs from [`crate::Ebpf::maps`] since it will return all maps
/// listed on the host system and not only maps for a specific [`crate::Bpf`] instance. /// listed on the host system and not only maps for a specific [`crate::Ebpf`] instance.
/// ///
/// # Example /// # Example
/// ``` /// ```
@ -1045,7 +1045,7 @@ mod tests {
..Default::default() ..Default::default()
}, },
section_index: 0, section_index: 0,
section_kind: BpfSectionKind::Maps, section_kind: EbpfSectionKind::Maps,
symbol_index: Some(0), symbol_index: Some(0),
data: Vec::new(), data: Vec::new(),
}) })
@ -1054,7 +1054,7 @@ mod tests {
#[test] #[test]
fn test_from_map_id() { fn test_from_map_id() {
override_syscall(|call| match call { override_syscall(|call| match call {
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_MAP_GET_FD_BY_ID, cmd: bpf_cmd::BPF_MAP_GET_FD_BY_ID,
attr, attr,
} => { } => {
@ -1064,7 +1064,7 @@ mod tests {
); );
Ok(42) Ok(42)
} }
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_OBJ_GET_INFO_BY_FD, cmd: bpf_cmd::BPF_OBJ_GET_INFO_BY_FD,
attr, attr,
} => { } => {
@ -1086,7 +1086,7 @@ mod tests {
#[test] #[test]
fn test_create() { fn test_create() {
override_syscall(|call| match call { override_syscall(|call| match call {
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_MAP_CREATE, cmd: bpf_cmd::BPF_MAP_CREATE,
.. ..
} => Ok(42), } => Ok(42),
@ -1113,11 +1113,11 @@ mod tests {
const TEST_NAME: &str = "foo"; const TEST_NAME: &str = "foo";
override_syscall(|call| match call { override_syscall(|call| match call {
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_MAP_CREATE, cmd: bpf_cmd::BPF_MAP_CREATE,
.. ..
} => Ok(42), } => Ok(42),
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_OBJ_GET_INFO_BY_FD, cmd: bpf_cmd::BPF_OBJ_GET_INFO_BY_FD,
attr, attr,
} => { } => {
@ -1146,7 +1146,7 @@ mod tests {
use crate::generated::bpf_map_info; use crate::generated::bpf_map_info;
override_syscall(|call| match call { override_syscall(|call| match call {
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_MAP_GET_NEXT_ID, cmd: bpf_cmd::BPF_MAP_GET_NEXT_ID,
attr, attr,
} => unsafe { } => unsafe {
@ -1158,11 +1158,11 @@ mod tests {
Err((-1, io::Error::from_raw_os_error(libc::ENOENT))) Err((-1, io::Error::from_raw_os_error(libc::ENOENT)))
} }
}, },
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_MAP_GET_FD_BY_ID, cmd: bpf_cmd::BPF_MAP_GET_FD_BY_ID,
attr, attr,
} => Ok((1000 + unsafe { attr.__bindgen_anon_6.__bindgen_anon_1.map_id }) as c_long), } => Ok((1000 + unsafe { attr.__bindgen_anon_6.__bindgen_anon_1.map_id }) as c_long),
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_OBJ_GET_INFO_BY_FD, cmd: bpf_cmd::BPF_OBJ_GET_INFO_BY_FD,
attr, attr,
} => { } => {

@ -42,13 +42,13 @@ use crate::maps::{
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Map(#[from] aya::maps::MapError), /// # Map(#[from] aya::maps::MapError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError), /// # Ebpf(#[from] aya::EbpfError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # PerfBuf(#[from] aya::maps::perf::PerfBufferError), /// # PerfBuf(#[from] aya::maps::perf::PerfBufferError),
/// # } /// # }
/// # #[cfg(feature = "async_tokio")] /// # #[cfg(feature = "async_tokio")]
/// # async fn try_main() -> Result<(), Error> { /// # async fn try_main() -> Result<(), Error> {
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use aya::maps::perf::{AsyncPerfEventArray, PerfBufferError}; /// use aya::maps::perf::{AsyncPerfEventArray, PerfBufferError};
/// use aya::util::online_cpus; /// use aya::util::online_cpus;
/// use bytes::BytesMut; /// use bytes::BytesMut;

@ -108,11 +108,11 @@ impl<T: BorrowMut<MapData>> AsRawFd for PerfEventArrayBuffer<T> {
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Map(#[from] aya::maps::MapError), /// # Map(#[from] aya::maps::MapError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError), /// # Ebpf(#[from] aya::EbpfError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # PerfBuf(#[from] aya::maps::perf::PerfBufferError), /// # PerfBuf(#[from] aya::maps::perf::PerfBufferError),
/// # } /// # }
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use aya::maps::PerfEventArray; /// use aya::maps::PerfEventArray;
/// use aya::util::online_cpus; /// use aya::util::online_cpus;
/// use bytes::BytesMut; /// use bytes::BytesMut;

@ -19,14 +19,14 @@ use crate::{
/// ///
/// # Examples /// # Examples
/// ```no_run /// ```no_run
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use aya::maps::Queue; /// use aya::maps::Queue;
/// ///
/// let mut queue = Queue::try_from(bpf.map_mut("ARRAY").unwrap())?; /// let mut queue = Queue::try_from(bpf.map_mut("ARRAY").unwrap())?;
/// queue.push(42, 0)?; /// queue.push(42, 0)?;
/// queue.push(43, 0)?; /// queue.push(43, 0)?;
/// assert_eq!(queue.pop(0)?, 42); /// assert_eq!(queue.pop(0)?, 42);
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
#[doc(alias = "BPF_MAP_TYPE_QUEUE")] #[doc(alias = "BPF_MAP_TYPE_QUEUE")]
pub struct Queue<T, V: Pod> { pub struct Queue<T, V: Pod> {

@ -68,7 +68,7 @@ use crate::{
/// # } /// # }
/// # fn clear_ready(&mut self) {} /// # fn clear_ready(&mut self) {}
/// # } /// # }
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use aya::maps::RingBuf; /// use aya::maps::RingBuf;
/// use std::convert::TryFrom; /// use std::convert::TryFrom;
/// ///
@ -82,7 +82,7 @@ use crate::{
/// } /// }
/// guard.clear_ready(); /// guard.clear_ready();
/// } /// }
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
/// ///
/// # Polling /// # Polling

@ -38,9 +38,9 @@ use crate::{
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Program(#[from] aya::programs::ProgramError), /// # Program(#[from] aya::programs::ProgramError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError) /// # Ebpf(#[from] aya::EbpfError)
/// # } /// # }
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use std::io::Write; /// use std::io::Write;
/// use std::net::TcpStream; /// use std::net::TcpStream;
/// use std::os::fd::AsRawFd; /// use std::os::fd::AsRawFd;

@ -35,9 +35,9 @@ use crate::{
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Program(#[from] aya::programs::ProgramError), /// # Program(#[from] aya::programs::ProgramError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError) /// # Ebpf(#[from] aya::EbpfError)
/// # } /// # }
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use aya::maps::SockMap; /// use aya::maps::SockMap;
/// use aya::programs::SkSkb; /// use aya::programs::SkSkb;
/// ///

@ -19,14 +19,14 @@ use crate::{
/// ///
/// # Examples /// # Examples
/// ```no_run /// ```no_run
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use aya::maps::Stack; /// use aya::maps::Stack;
/// ///
/// let mut stack = Stack::try_from(bpf.map_mut("STACK").unwrap())?; /// let mut stack = Stack::try_from(bpf.map_mut("STACK").unwrap())?;
/// stack.push(42, 0)?; /// stack.push(42, 0)?;
/// stack.push(43, 0)?; /// stack.push(43, 0)?;
/// assert_eq!(stack.pop(0)?, 43); /// assert_eq!(stack.pop(0)?, 43);
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
#[doc(alias = "BPF_MAP_TYPE_STACK")] #[doc(alias = "BPF_MAP_TYPE_STACK")]
pub struct Stack<T, V: Pod> { pub struct Stack<T, V: Pod> {

@ -35,9 +35,9 @@ use crate::{
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Map(#[from] aya::maps::MapError), /// # Map(#[from] aya::maps::MapError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError) /// # Ebpf(#[from] aya::EbpfError)
/// # } /// # }
/// # let bpf = aya::Bpf::load(&[])?; /// # let bpf = aya::Ebpf::load(&[])?;
/// use aya::maps::StackTraceMap; /// use aya::maps::StackTraceMap;
/// use aya::util::kernel_symbols; /// use aya::util::kernel_symbols;
/// ///

@ -31,7 +31,7 @@ use crate::{
/// use aya::maps::xdp::CpuMap; /// use aya::maps::xdp::CpuMap;
/// ///
/// let ncpus = aya::util::nr_cpus().unwrap() as u32; /// let ncpus = aya::util::nr_cpus().unwrap() as u32;
/// let mut bpf = aya::BpfLoader::new() /// let mut bpf = aya::EbpfLoader::new()
/// .set_max_entries("CPUS", ncpus) /// .set_max_entries("CPUS", ncpus)
/// .load(elf_bytes) /// .load(elf_bytes)
/// .unwrap(); /// .unwrap();
@ -42,7 +42,7 @@ use crate::{
/// cpumap.set(i, queue_size, None, flags); /// cpumap.set(i, queue_size, None, flags);
/// } /// }
/// ///
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
/// ///
/// # See also /// # See also

@ -27,14 +27,14 @@ use crate::{
/// ///
/// # Examples /// # Examples
/// ```no_run /// ```no_run
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use aya::maps::xdp::DevMap; /// use aya::maps::xdp::DevMap;
/// ///
/// let mut devmap = DevMap::try_from(bpf.map_mut("IFACES").unwrap())?; /// let mut devmap = DevMap::try_from(bpf.map_mut("IFACES").unwrap())?;
/// // Lookups at index 2 will redirect packets to interface with index 3 (e.g. eth1) /// // Lookups at index 2 will redirect packets to interface with index 3 (e.g. eth1)
/// devmap.set(2, 3, None, 0); /// devmap.set(2, 3, None, 0);
/// ///
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
/// ///
/// # See also /// # See also

@ -27,14 +27,14 @@ use crate::{
/// ///
/// # Examples /// # Examples
/// ```no_run /// ```no_run
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use aya::maps::xdp::DevMapHash; /// use aya::maps::xdp::DevMapHash;
/// ///
/// let mut devmap = DevMapHash::try_from(bpf.map_mut("IFACES").unwrap())?; /// let mut devmap = DevMapHash::try_from(bpf.map_mut("IFACES").unwrap())?;
/// // Lookups with key 2 will redirect packets to interface with index 3 (e.g. eth1) /// // Lookups with key 2 will redirect packets to interface with index 3 (e.g. eth1)
/// devmap.insert(2, 3, None, 0); /// devmap.insert(2, 3, None, 0);
/// ///
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
/// ///
/// # See also /// # See also

@ -21,14 +21,14 @@ use crate::{
/// ///
/// # Examples /// # Examples
/// ```no_run /// ```no_run
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// # let socket_fd = 1; /// # let socket_fd = 1;
/// use aya::maps::XskMap; /// use aya::maps::XskMap;
/// ///
/// let mut xskmap = XskMap::try_from(bpf.map_mut("SOCKETS").unwrap())?; /// let mut xskmap = XskMap::try_from(bpf.map_mut("SOCKETS").unwrap())?;
/// // socket_fd is the RawFd of an AF_XDP socket /// // socket_fd is the RawFd of an AF_XDP socket
/// xskmap.set(0, socket_fd, 0); /// xskmap.set(0, socket_fd, 0);
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
/// ///
/// # See also /// # See also

@ -35,9 +35,9 @@ use crate::{
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Program(#[from] aya::programs::ProgramError), /// # Program(#[from] aya::programs::ProgramError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError) /// # Ebpf(#[from] aya::EbpfError)
/// # } /// # }
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use aya::programs::CgroupDevice; /// use aya::programs::CgroupDevice;
/// ///
/// let cgroup = std::fs::File::open("/sys/fs/cgroup/unified")?; /// let cgroup = std::fs::File::open("/sys/fs/cgroup/unified")?;

@ -39,9 +39,9 @@ use crate::{
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Program(#[from] aya::programs::ProgramError), /// # Program(#[from] aya::programs::ProgramError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError) /// # Ebpf(#[from] aya::EbpfError)
/// # } /// # }
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use std::fs::File; /// use std::fs::File;
/// use aya::programs::{CgroupSkb, CgroupSkbAttachType}; /// use aya::programs::{CgroupSkb, CgroupSkbAttachType};
/// ///

@ -37,9 +37,9 @@ use crate::{
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Program(#[from] aya::programs::ProgramError), /// # Program(#[from] aya::programs::ProgramError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError) /// # Ebpf(#[from] aya::EbpfError)
/// # } /// # }
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use std::fs::File; /// use std::fs::File;
/// use aya::programs::{CgroupSock, CgroupSockAttachType}; /// use aya::programs::{CgroupSock, CgroupSockAttachType};
/// ///

@ -38,9 +38,9 @@ use crate::{
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Program(#[from] aya::programs::ProgramError), /// # Program(#[from] aya::programs::ProgramError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError) /// # Ebpf(#[from] aya::EbpfError)
/// # } /// # }
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use std::fs::File; /// use std::fs::File;
/// use aya::programs::{CgroupSockAddr, CgroupSockAddrAttachType}; /// use aya::programs::{CgroupSockAddr, CgroupSockAddrAttachType};
/// ///

@ -35,9 +35,9 @@ use crate::{
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Program(#[from] aya::programs::ProgramError), /// # Program(#[from] aya::programs::ProgramError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError) /// # Ebpf(#[from] aya::EbpfError)
/// # } /// # }
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use std::fs::File; /// use std::fs::File;
/// use aya::programs::CgroupSockopt; /// use aya::programs::CgroupSockopt;
/// ///

@ -32,9 +32,9 @@ use crate::{
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Program(#[from] aya::programs::ProgramError), /// # Program(#[from] aya::programs::ProgramError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError) /// # Ebpf(#[from] aya::EbpfError)
/// # } /// # }
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use std::fs::File; /// use std::fs::File;
/// use aya::programs::CgroupSysctl; /// use aya::programs::CgroupSysctl;
/// ///

@ -35,9 +35,9 @@ pub enum ExtensionError {
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
/// use aya::{BpfLoader, programs::{Xdp, XdpFlags, Extension}}; /// use aya::{EbpfLoader, programs::{Xdp, XdpFlags, Extension}};
/// ///
/// let mut bpf = BpfLoader::new().extension("extension").load_file("app.o")?; /// let mut bpf = EbpfLoader::new().extension("extension").load_file("app.o")?;
/// let prog: &mut Xdp = bpf.program_mut("main").unwrap().try_into()?; /// let prog: &mut Xdp = bpf.program_mut("main").unwrap().try_into()?;
/// prog.load()?; /// prog.load()?;
/// prog.attach("eth0", XdpFlags::default())?; /// prog.attach("eth0", XdpFlags::default())?;
@ -47,7 +47,7 @@ pub enum ExtensionError {
/// let ext: &mut Extension = bpf.program_mut("extension").unwrap().try_into()?; /// let ext: &mut Extension = bpf.program_mut("extension").unwrap().try_into()?;
/// ext.load(prog_fd, "function_to_replace")?; /// ext.load(prog_fd, "function_to_replace")?;
/// ext.attach()?; /// ext.attach()?;
/// Ok::<(), aya::BpfError>(()) /// Ok::<(), aya::EbpfError>(())
/// ``` /// ```
#[derive(Debug)] #[derive(Debug)]
#[doc(alias = "BPF_PROG_TYPE_EXT")] #[doc(alias = "BPF_PROG_TYPE_EXT")]

@ -31,10 +31,10 @@ use crate::{
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Program(#[from] aya::programs::ProgramError), /// # Program(#[from] aya::programs::ProgramError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError), /// # Ebpf(#[from] aya::EbpfError),
/// # } /// # }
/// # let mut bpf = Bpf::load_file("ebpf_programs.o")?; /// # let mut bpf = Ebpf::load_file("ebpf_programs.o")?;
/// use aya::{Bpf, programs::FEntry, BtfError, Btf}; /// use aya::{Ebpf, programs::FEntry, BtfError, Btf};
/// ///
/// let btf = Btf::from_sys_fs()?; /// let btf = Btf::from_sys_fs()?;
/// let program: &mut FEntry = bpf.program_mut("filename_lookup").unwrap().try_into()?; /// let program: &mut FEntry = bpf.program_mut("filename_lookup").unwrap().try_into()?;

@ -31,10 +31,10 @@ use crate::{
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Program(#[from] aya::programs::ProgramError), /// # Program(#[from] aya::programs::ProgramError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError), /// # Ebpf(#[from] aya::EbpfError),
/// # } /// # }
/// # let mut bpf = Bpf::load_file("ebpf_programs.o")?; /// # let mut bpf = Ebpf::load_file("ebpf_programs.o")?;
/// use aya::{Bpf, programs::FExit, BtfError, Btf}; /// use aya::{Ebpf, programs::FExit, BtfError, Btf};
/// ///
/// let btf = Btf::from_sys_fs()?; /// let btf = Btf::from_sys_fs()?;
/// let program: &mut FExit = bpf.program_mut("filename_lookup").unwrap().try_into()?; /// let program: &mut FExit = bpf.program_mut("filename_lookup").unwrap().try_into()?;

@ -35,13 +35,13 @@ use crate::{
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
/// # let mut bpf = Bpf::load_file("ebpf_programs.o")?; /// # let mut bpf = Ebpf::load_file("ebpf_programs.o")?;
/// use aya::{Bpf, programs::KProbe}; /// use aya::{Ebpf, programs::KProbe};
/// ///
/// let program: &mut KProbe = bpf.program_mut("intercept_wakeups").unwrap().try_into()?; /// let program: &mut KProbe = bpf.program_mut("intercept_wakeups").unwrap().try_into()?;
/// program.load()?; /// program.load()?;
/// program.attach("try_to_wake_up", 0)?; /// program.attach("try_to_wake_up", 0)?;
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
#[derive(Debug)] #[derive(Debug)]
#[doc(alias = "BPF_PROG_TYPE_KPROBE")] #[doc(alias = "BPF_PROG_TYPE_KPROBE")]

@ -93,8 +93,8 @@ pub struct FdLinkId(pub(crate) RawFd);
/// # Example /// # Example
/// ///
///```no_run ///```no_run
/// # let mut bpf = Bpf::load_file("ebpf_programs.o")?; /// # let mut bpf = Ebpf::load_file("ebpf_programs.o")?;
/// use aya::{Bpf, programs::{links::FdLink, KProbe}}; /// use aya::{Ebpf, programs::{links::FdLink, KProbe}};
/// ///
/// let program: &mut KProbe = bpf.program_mut("intercept_wakeups").unwrap().try_into()?; /// let program: &mut KProbe = bpf.program_mut("intercept_wakeups").unwrap().try_into()?;
/// program.load()?; /// program.load()?;
@ -103,7 +103,7 @@ pub struct FdLinkId(pub(crate) RawFd);
/// let fd_link: FdLink = link.try_into().unwrap(); /// let fd_link: FdLink = link.try_into().unwrap();
/// fd_link.pin("/sys/fs/bpf/intercept_wakeups_link").unwrap(); /// fd_link.pin("/sys/fs/bpf/intercept_wakeups_link").unwrap();
/// ///
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
#[derive(Debug)] #[derive(Debug)]
pub struct FdLink { pub struct FdLink {
@ -130,13 +130,13 @@ impl FdLink {
/// # #[derive(thiserror::Error, Debug)] /// # #[derive(thiserror::Error, Debug)]
/// # enum Error { /// # enum Error {
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError), /// # Ebpf(#[from] aya::EbpfError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Pin(#[from] aya::pin::PinError), /// # Pin(#[from] aya::pin::PinError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Program(#[from] aya::programs::ProgramError) /// # Program(#[from] aya::programs::ProgramError)
/// # } /// # }
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// # let prog: &mut Extension = bpf.program_mut("example").unwrap().try_into()?; /// # let prog: &mut Extension = bpf.program_mut("example").unwrap().try_into()?;
/// let link_id = prog.attach()?; /// let link_id = prog.attach()?;
/// let owned_link = prog.take_link(link_id)?; /// let owned_link = prog.take_link(link_id)?;

@ -30,14 +30,14 @@ use crate::{
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Program(#[from] aya::programs::ProgramError), /// # Program(#[from] aya::programs::ProgramError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError) /// # Ebpf(#[from] aya::EbpfError)
/// # } /// # }
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use std::fs::File; /// use std::fs::File;
/// use aya::programs::LircMode2; /// use aya::programs::LircMode2;
/// ///
/// let file = File::open("/dev/lirc0")?; /// let file = File::open("/dev/lirc0")?;
/// let mut bpf = aya::Bpf::load_file("imon_rsc.o")?; /// let mut bpf = aya::Ebpf::load_file("imon_rsc.o")?;
/// let decoder: &mut LircMode2 = bpf.program_mut("imon_rsc").unwrap().try_into().unwrap(); /// let decoder: &mut LircMode2 = bpf.program_mut("imon_rsc").unwrap().try_into().unwrap();
/// decoder.load()?; /// decoder.load()?;
/// decoder.attach(file)?; /// decoder.attach(file)?;

@ -33,10 +33,10 @@ use crate::{
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Program(#[from] aya::programs::ProgramError), /// # Program(#[from] aya::programs::ProgramError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError), /// # Ebpf(#[from] aya::EbpfError),
/// # } /// # }
/// # let mut bpf = Bpf::load_file("ebpf_programs.o")?; /// # let mut bpf = Ebpf::load_file("ebpf_programs.o")?;
/// use aya::{Bpf, programs::Lsm, BtfError, Btf}; /// use aya::{Ebpf, programs::Lsm, BtfError, Btf};
/// ///
/// let btf = Btf::from_sys_fs()?; /// let btf = Btf::from_sys_fs()?;
/// let program: &mut Lsm = bpf.program_mut("lsm_prog").unwrap().try_into()?; /// let program: &mut Lsm = bpf.program_mut("lsm_prog").unwrap().try_into()?;

@ -5,35 +5,35 @@
//! //!
//! # Loading and attaching programs //! # Loading and attaching programs
//! //!
//! When you call [`Bpf::load_file`] or [`Bpf::load`], all the programs included //! When you call [`Ebpf::load_file`] or [`Ebpf::load`], all the programs included
//! in the object code are parsed and relocated. Programs are not loaded //! in the object code are parsed and relocated. Programs are not loaded
//! automatically though, since often you will need to do some application //! automatically though, since often you will need to do some application
//! specific setup before you can actually load them. //! specific setup before you can actually load them.
//! //!
//! In order to load and attach a program, you need to retrieve it using [`Bpf::program_mut`], //! In order to load and attach a program, you need to retrieve it using [`Ebpf::program_mut`],
//! then call the `load()` and `attach()` methods, for example: //! then call the `load()` and `attach()` methods, for example:
//! //!
//! ```no_run //! ```no_run
//! use aya::{Bpf, programs::KProbe}; //! use aya::{Ebpf, programs::KProbe};
//! //!
//! let mut bpf = Bpf::load_file("ebpf_programs.o")?; //! let mut bpf = Ebpf::load_file("ebpf_programs.o")?;
//! // intercept_wakeups is the name of the program we want to load //! // intercept_wakeups is the name of the program we want to load
//! let program: &mut KProbe = bpf.program_mut("intercept_wakeups").unwrap().try_into()?; //! let program: &mut KProbe = bpf.program_mut("intercept_wakeups").unwrap().try_into()?;
//! program.load()?; //! program.load()?;
//! // intercept_wakeups will be called every time try_to_wake_up() is called //! // intercept_wakeups will be called every time try_to_wake_up() is called
//! // inside the kernel //! // inside the kernel
//! program.attach("try_to_wake_up", 0)?; //! program.attach("try_to_wake_up", 0)?;
//! # Ok::<(), aya::BpfError>(()) //! # Ok::<(), aya::EbpfError>(())
//! ``` //! ```
//! //!
//! The signature of the `attach()` method varies depending on what kind of //! The signature of the `attach()` method varies depending on what kind of
//! program you're trying to attach. //! program you're trying to attach.
//! //!
//! [`Bpf::load_file`]: crate::Bpf::load_file //! [`Ebpf::load_file`]: crate::Ebpf::load_file
//! [`Bpf::load`]: crate::Bpf::load //! [`Ebpf::load`]: crate::Ebpf::load
//! [`Bpf::programs`]: crate::Bpf::programs //! [`Ebpf::programs`]: crate::Ebpf::programs
//! [`Bpf::program`]: crate::Bpf::program //! [`Ebpf::program`]: crate::Ebpf::program
//! [`Bpf::program_mut`]: crate::Bpf::program_mut //! [`Ebpf::program_mut`]: crate::Ebpf::program_mut
//! [`maps`]: crate::maps //! [`maps`]: crate::maps
// modules we don't export // modules we don't export
@ -124,7 +124,7 @@ use crate::{
bpf_btf_get_fd_by_id, bpf_get_object, bpf_link_get_fd_by_id, bpf_link_get_info_by_fd, bpf_btf_get_fd_by_id, bpf_get_object, bpf_link_get_fd_by_id, bpf_link_get_info_by_fd,
bpf_load_program, bpf_pin_object, bpf_prog_get_fd_by_id, bpf_prog_get_info_by_fd, bpf_load_program, bpf_pin_object, bpf_prog_get_fd_by_id, bpf_prog_get_info_by_fd,
bpf_prog_query, iter_link_ids, iter_prog_ids, retry_with_verifier_logs, bpf_prog_query, iter_link_ids, iter_prog_ids, retry_with_verifier_logs,
BpfLoadProgramAttrs, SyscallError, EbpfLoadProgramAttrs, SyscallError,
}, },
util::{bytes_of_bpf_name, KernelVersion}, util::{bytes_of_bpf_name, KernelVersion},
VerifierLogLevel, VerifierLogLevel,
@ -641,7 +641,7 @@ fn load_program<T: Link>(
None None
}; };
let attr = BpfLoadProgramAttrs { let attr = EbpfLoadProgramAttrs {
name: prog_name, name: prog_name,
ty: prog_type, ty: prog_type,
insns: instructions, insns: instructions,
@ -1117,8 +1117,8 @@ impl ProgramInfo {
/// Returns an iterator over all loaded bpf programs. /// Returns an iterator over all loaded bpf programs.
/// ///
/// This differs from [`crate::Bpf::programs`] since it will return all programs /// This differs from [`crate::Ebpf::programs`] since it will return all programs
/// listed on the host system and not only programs a specific [`crate::Bpf`] instance. /// listed on the host system and not only programs a specific [`crate::Ebpf`] instance.
/// ///
/// # Example /// # Example
/// ``` /// ```

@ -98,9 +98,9 @@ pub enum PerfEventScope {
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Program(#[from] aya::programs::ProgramError), /// # Program(#[from] aya::programs::ProgramError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError) /// # Ebpf(#[from] aya::EbpfError)
/// # } /// # }
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use aya::util::online_cpus; /// use aya::util::online_cpus;
/// use aya::programs::perf_event::{ /// use aya::programs::perf_event::{
/// perf_sw_ids::PERF_COUNT_SW_CPU_CLOCK, PerfEvent, PerfEventScope, PerfTypeId, SamplePolicy, /// perf_sw_ids::PERF_COUNT_SW_CPU_CLOCK, PerfEvent, PerfEventScope, PerfTypeId, SamplePolicy,

@ -24,13 +24,13 @@ use crate::{
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
/// # let mut bpf = Bpf::load_file("ebpf_programs.o")?; /// # let mut bpf = Ebpf::load_file("ebpf_programs.o")?;
/// use aya::{Bpf, programs::RawTracePoint}; /// use aya::{Ebpf, programs::RawTracePoint};
/// ///
/// let program: &mut RawTracePoint = bpf.program_mut("sys_enter").unwrap().try_into()?; /// let program: &mut RawTracePoint = bpf.program_mut("sys_enter").unwrap().try_into()?;
/// program.load()?; /// program.load()?;
/// program.attach("sys_enter")?; /// program.attach("sys_enter")?;
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
#[derive(Debug)] #[derive(Debug)]
#[doc(alias = "BPF_PROG_TYPE_RAW_TRACEPOINT")] #[doc(alias = "BPF_PROG_TYPE_RAW_TRACEPOINT")]

@ -32,9 +32,9 @@ use crate::{
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Program(#[from] aya::programs::ProgramError), /// # Program(#[from] aya::programs::ProgramError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError) /// # Ebpf(#[from] aya::EbpfError)
/// # } /// # }
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use std::fs::File; /// use std::fs::File;
/// use aya::programs::SkLookup; /// use aya::programs::SkLookup;
/// ///

@ -33,9 +33,9 @@ use crate::{
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Program(#[from] aya::programs::ProgramError), /// # Program(#[from] aya::programs::ProgramError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError) /// # Ebpf(#[from] aya::EbpfError)
/// # } /// # }
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use std::io::Write; /// use std::io::Write;
/// use std::net::TcpStream; /// use std::net::TcpStream;
/// use std::os::fd::AsRawFd; /// use std::os::fd::AsRawFd;

@ -46,9 +46,9 @@ pub enum SkSkbKind {
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Program(#[from] aya::programs::ProgramError), /// # Program(#[from] aya::programs::ProgramError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError) /// # Ebpf(#[from] aya::EbpfError)
/// # } /// # }
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use aya::maps::SockMap; /// use aya::maps::SockMap;
/// use aya::programs::SkSkb; /// use aya::programs::SkSkb;
/// ///

@ -31,9 +31,9 @@ use crate::{
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Program(#[from] aya::programs::ProgramError), /// # Program(#[from] aya::programs::ProgramError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError) /// # Ebpf(#[from] aya::EbpfError)
/// # } /// # }
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use std::fs::File; /// use std::fs::File;
/// use aya::programs::SockOps; /// use aya::programs::SockOps;
/// ///

@ -17,7 +17,7 @@ use crate::{
pub enum SocketFilterError { pub enum SocketFilterError {
/// Setting the `SO_ATTACH_BPF` socket option failed. /// Setting the `SO_ATTACH_BPF` socket option failed.
#[error("setsockopt SO_ATTACH_BPF failed")] #[error("setsockopt SO_ATTACH_BPF failed")]
SoAttachBpfError { SoAttachEbpfError {
/// original [`io::Error`] /// original [`io::Error`]
#[source] #[source]
io_error: io::Error, io_error: io::Error,
@ -45,9 +45,9 @@ pub enum SocketFilterError {
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Program(#[from] aya::programs::ProgramError), /// # Program(#[from] aya::programs::ProgramError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError) /// # Ebpf(#[from] aya::EbpfError)
/// # } /// # }
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use std::net::TcpStream; /// use std::net::TcpStream;
/// use aya::programs::SocketFilter; /// use aya::programs::SocketFilter;
/// ///
@ -89,7 +89,7 @@ impl SocketFilter {
) )
}; };
if ret < 0 { if ret < 0 {
return Err(SocketFilterError::SoAttachBpfError { return Err(SocketFilterError::SoAttachEbpfError {
io_error: io::Error::last_os_error(), io_error: io::Error::last_os_error(),
} }
.into()); .into());

@ -55,9 +55,9 @@ pub enum TcAttachType {
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Program(#[from] aya::programs::ProgramError), /// # Program(#[from] aya::programs::ProgramError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError) /// # Ebpf(#[from] aya::EbpfError)
/// # } /// # }
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use aya::programs::{tc, SchedClassifier, TcAttachType}; /// use aya::programs::{tc, SchedClassifier, TcAttachType};
/// ///
/// // the clsact qdisc needs to be added before SchedClassifier programs can be /// // the clsact qdisc needs to be added before SchedClassifier programs can be

@ -30,10 +30,10 @@ use crate::{
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Program(#[from] aya::programs::ProgramError), /// # Program(#[from] aya::programs::ProgramError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError), /// # Ebpf(#[from] aya::EbpfError),
/// # } /// # }
/// # let mut bpf = Bpf::load_file("ebpf_programs.o")?; /// # let mut bpf = Ebpf::load_file("ebpf_programs.o")?;
/// use aya::{Bpf, programs::BtfTracePoint, BtfError, Btf}; /// use aya::{Ebpf, programs::BtfTracePoint, BtfError, Btf};
/// ///
/// let btf = Btf::from_sys_fs()?; /// let btf = Btf::from_sys_fs()?;
/// let program: &mut BtfTracePoint = bpf.program_mut("sched_process_fork").unwrap().try_into()?; /// let program: &mut BtfTracePoint = bpf.program_mut("sched_process_fork").unwrap().try_into()?;

@ -50,9 +50,9 @@ pub enum TracePointError {
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Program(#[from] aya::programs::ProgramError), /// # Program(#[from] aya::programs::ProgramError),
/// # #[error(transparent)] /// # #[error(transparent)]
/// # Bpf(#[from] aya::BpfError) /// # Ebpf(#[from] aya::EbpfError)
/// # } /// # }
/// # let mut bpf = aya::Bpf::load(&[])?; /// # let mut bpf = aya::Ebpf::load(&[])?;
/// use aya::programs::TracePoint; /// use aya::programs::TracePoint;
/// ///
/// let prog: &mut TracePoint = bpf.program_mut("trace_context_switch").unwrap().try_into()?; /// let prog: &mut TracePoint = bpf.program_mut("trace_context_switch").unwrap().try_into()?;

@ -71,12 +71,12 @@ bitflags::bitflags! {
/// # Examples /// # Examples
/// ///
/// ```no_run /// ```no_run
/// # let mut bpf = Bpf::load_file("ebpf_programs.o")?; /// # let mut bpf = Ebpf::load_file("ebpf_programs.o")?;
/// use aya::{Bpf, programs::{Xdp, XdpFlags}}; /// use aya::{Ebpf, programs::{Xdp, XdpFlags}};
/// ///
/// let program: &mut Xdp = bpf.program_mut("intercept_packets").unwrap().try_into()?; /// let program: &mut Xdp = bpf.program_mut("intercept_packets").unwrap().try_into()?;
/// program.attach("eth0", XdpFlags::default())?; /// program.attach("eth0", XdpFlags::default())?;
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
#[derive(Debug)] #[derive(Debug)]
#[doc(alias = "BPF_PROG_TYPE_XDP")] #[doc(alias = "BPF_PROG_TYPE_XDP")]

@ -12,7 +12,7 @@ use libc::{ENOENT, ENOSPC};
use obj::{ use obj::{
btf::{BtfEnum64, Enum64}, btf::{BtfEnum64, Enum64},
maps::{bpf_map_def, LegacyMap}, maps::{bpf_map_def, LegacyMap},
BpfSectionKind, VerifierLog, EbpfSectionKind, VerifierLog,
}; };
use crate::{ use crate::{
@ -112,7 +112,7 @@ pub(crate) fn bpf_get_object(path: &CStr) -> SysResult<OwnedFd> {
unsafe { fd_sys_bpf(bpf_cmd::BPF_OBJ_GET, &mut attr) } unsafe { fd_sys_bpf(bpf_cmd::BPF_OBJ_GET, &mut attr) }
} }
pub(crate) struct BpfLoadProgramAttrs<'a> { pub(crate) struct EbpfLoadProgramAttrs<'a> {
pub(crate) name: Option<CString>, pub(crate) name: Option<CString>,
pub(crate) ty: bpf_prog_type, pub(crate) ty: bpf_prog_type,
pub(crate) insns: &'a [bpf_insn], pub(crate) insns: &'a [bpf_insn],
@ -131,7 +131,7 @@ pub(crate) struct BpfLoadProgramAttrs<'a> {
} }
pub(crate) fn bpf_load_program( pub(crate) fn bpf_load_program(
aya_attr: &BpfLoadProgramAttrs<'_>, aya_attr: &EbpfLoadProgramAttrs<'_>,
log_buf: &mut [u8], log_buf: &mut [u8],
verifier_log_level: VerifierLogLevel, verifier_log_level: VerifierLogLevel,
) -> SysResult<OwnedFd> { ) -> SysResult<OwnedFd> {
@ -766,7 +766,7 @@ pub(crate) fn is_bpf_global_data_supported() -> bool {
..Default::default() ..Default::default()
}, },
section_index: 0, section_index: 0,
section_kind: BpfSectionKind::Maps, section_kind: EbpfSectionKind::Maps,
symbol_index: None, symbol_index: None,
data: Vec::new(), data: Vec::new(),
}), }),
@ -993,7 +993,7 @@ fn bpf_prog_load(attr: &mut bpf_attr) -> SysResult<OwnedFd> {
} }
fn sys_bpf(cmd: bpf_cmd, attr: &mut bpf_attr) -> SysResult<c_long> { fn sys_bpf(cmd: bpf_cmd, attr: &mut bpf_attr) -> SysResult<c_long> {
syscall(Syscall::Bpf { cmd, attr }) syscall(Syscall::Ebpf { cmd, attr })
} }
fn bpf_obj_get_next_id( fn bpf_obj_get_next_id(
@ -1096,7 +1096,7 @@ mod tests {
#[test] #[test]
fn test_perf_link_supported() { fn test_perf_link_supported() {
override_syscall(|call| match call { override_syscall(|call| match call {
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_LINK_CREATE, cmd: bpf_cmd::BPF_LINK_CREATE,
.. ..
} => Err((-1, io::Error::from_raw_os_error(EBADF))), } => Err((-1, io::Error::from_raw_os_error(EBADF))),
@ -1106,7 +1106,7 @@ mod tests {
assert!(supported); assert!(supported);
override_syscall(|call| match call { override_syscall(|call| match call {
Syscall::Bpf { Syscall::Ebpf {
cmd: bpf_cmd::BPF_LINK_CREATE, cmd: bpf_cmd::BPF_LINK_CREATE,
.. ..
} => Err((-1, io::Error::from_raw_os_error(EINVAL))), } => Err((-1, io::Error::from_raw_os_error(EINVAL))),

@ -26,7 +26,7 @@ use crate::generated::{bpf_attr, bpf_cmd, perf_event_attr};
pub(crate) type SysResult<T> = Result<T, (c_long, io::Error)>; pub(crate) type SysResult<T> = Result<T, (c_long, io::Error)>;
pub(crate) enum Syscall<'a> { pub(crate) enum Syscall<'a> {
Bpf { Ebpf {
cmd: bpf_cmd, cmd: bpf_cmd,
attr: &'a mut bpf_attr, attr: &'a mut bpf_attr,
}, },
@ -57,8 +57,8 @@ pub struct SyscallError {
impl std::fmt::Debug for Syscall<'_> { impl std::fmt::Debug for Syscall<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self { match self {
Self::Bpf { cmd, attr: _ } => f Self::Ebpf { cmd, attr: _ } => f
.debug_struct("Syscall::Bpf") .debug_struct("Syscall::Ebpf")
.field("cmd", cmd) .field("cmd", cmd)
.field("attr", &format_args!("_")) .field("attr", &format_args!("_"))
.finish(), .finish(),
@ -93,7 +93,7 @@ fn syscall(call: Syscall<'_>) -> SysResult<c_long> {
#[cfg_attr(test, allow(unreachable_code))] #[cfg_attr(test, allow(unreachable_code))]
match unsafe { match unsafe {
match call { match call {
Syscall::Bpf { cmd, attr } => { Syscall::Ebpf { cmd, attr } => {
libc::syscall(SYS_bpf, cmd, attr, mem::size_of::<bpf_attr>()) libc::syscall(SYS_bpf, cmd, attr, mem::size_of::<bpf_attr>())
} }
Syscall::PerfEventOpen { Syscall::PerfEventOpen {

@ -307,7 +307,7 @@ pub(crate) fn tc_handler_make(major: u32, minor: u32) -> u32 {
(major & TC_H_MAJ_MASK) | (minor & TC_H_MIN_MASK) (major & TC_H_MAJ_MASK) | (minor & TC_H_MIN_MASK)
} }
/// Include bytes from a file for use in a subsequent [`crate::Bpf::load`]. /// Include bytes from a file for use in a subsequent [`crate::Ebpf::load`].
/// ///
/// This macro differs from the standard `include_bytes!` macro since it also ensures that /// This macro differs from the standard `include_bytes!` macro since it also ensures that
/// the bytes are correctly aligned to be parsed as an ELF binary. This avoid some nasty /// the bytes are correctly aligned to be parsed as an ELF binary. This avoid some nasty
@ -315,13 +315,13 @@ pub(crate) fn tc_handler_make(major: u32, minor: u32) -> u32 {
/// ///
/// # Examples /// # Examples
/// ```ignore /// ```ignore
/// use aya::{Bpf, include_bytes_aligned}; /// use aya::{Ebpf, include_bytes_aligned};
/// ///
/// let mut bpf = Bpf::load(include_bytes_aligned!( /// let mut bpf = Ebpf::load(include_bytes_aligned!(
/// "/path/to/bpf.o" /// "/path/to/bpf.o"
/// ))?; /// ))?;
/// ///
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::EbpfError>(())
/// ``` /// ```
#[macro_export] #[macro_export]
macro_rules! include_bytes_aligned { macro_rules! include_bytes_aligned {

@ -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
@ -9,4 +9,4 @@ homepage.workspace = true
edition.workspace = true edition.workspace = true
[dependencies] [dependencies]
aya-bpf-cty = { path = "../aya-bpf-cty" } aya-ebpf-cty = { path = "../aya-ebpf-cty" }

@ -279,13 +279,13 @@ pub const TC_ACT_REDIRECT: u32 = 7;
pub const TC_ACT_TRAP: u32 = 8; pub const TC_ACT_TRAP: u32 = 8;
pub const TC_ACT_VALUE_MAX: u32 = 8; pub const TC_ACT_VALUE_MAX: u32 = 8;
pub const TC_ACT_EXT_VAL_MASK: u32 = 268435455; pub const TC_ACT_EXT_VAL_MASK: u32 = 268435455;
pub type __u8 = ::aya_bpf_cty::c_uchar; pub type __u8 = ::aya_ebpf_cty::c_uchar;
pub type __s16 = ::aya_bpf_cty::c_short; pub type __s16 = ::aya_ebpf_cty::c_short;
pub type __u16 = ::aya_bpf_cty::c_ushort; pub type __u16 = ::aya_ebpf_cty::c_ushort;
pub type __s32 = ::aya_bpf_cty::c_int; pub type __s32 = ::aya_ebpf_cty::c_int;
pub type __u32 = ::aya_bpf_cty::c_uint; pub type __u32 = ::aya_ebpf_cty::c_uint;
pub type __s64 = ::aya_bpf_cty::c_longlong; pub type __s64 = ::aya_ebpf_cty::c_longlong;
pub type __u64 = ::aya_bpf_cty::c_ulonglong; pub type __u64 = ::aya_ebpf_cty::c_ulonglong;
pub type __be16 = __u16; pub type __be16 = __u16;
pub type __be32 = __u32; pub type __be32 = __u32;
pub type __wsum = __u32; pub type __wsum = __u32;
@ -301,7 +301,7 @@ pub const BPF_REG_8: _bindgen_ty_1 = 8;
pub const BPF_REG_9: _bindgen_ty_1 = 9; pub const BPF_REG_9: _bindgen_ty_1 = 9;
pub const BPF_REG_10: _bindgen_ty_1 = 10; pub const BPF_REG_10: _bindgen_ty_1 = 10;
pub const __MAX_BPF_REG: _bindgen_ty_1 = 11; pub const __MAX_BPF_REG: _bindgen_ty_1 = 11;
pub type _bindgen_ty_1 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_1 = ::aya_ebpf_cty::c_uint;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
pub struct bpf_insn { pub struct bpf_insn {
@ -361,7 +361,7 @@ pub struct bpf_cgroup_storage_key {
pub attach_type: __u32, pub attach_type: __u32,
} }
pub mod bpf_cgroup_iter_order { pub mod bpf_cgroup_iter_order {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_CGROUP_ITER_ORDER_UNSPEC: Type = 0; pub const BPF_CGROUP_ITER_ORDER_UNSPEC: Type = 0;
pub const BPF_CGROUP_ITER_SELF_ONLY: Type = 1; pub const BPF_CGROUP_ITER_SELF_ONLY: Type = 1;
pub const BPF_CGROUP_ITER_DESCENDANTS_PRE: Type = 2; pub const BPF_CGROUP_ITER_DESCENDANTS_PRE: Type = 2;
@ -395,7 +395,7 @@ pub struct bpf_iter_link_info__bindgen_ty_3 {
pub pid_fd: __u32, pub pid_fd: __u32,
} }
pub mod bpf_cmd { pub mod bpf_cmd {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_MAP_CREATE: Type = 0; pub const BPF_MAP_CREATE: Type = 0;
pub const BPF_MAP_LOOKUP_ELEM: Type = 1; pub const BPF_MAP_LOOKUP_ELEM: Type = 1;
pub const BPF_MAP_UPDATE_ELEM: Type = 2; pub const BPF_MAP_UPDATE_ELEM: Type = 2;
@ -435,7 +435,7 @@ pub mod bpf_cmd {
pub const BPF_PROG_BIND_MAP: Type = 35; pub const BPF_PROG_BIND_MAP: Type = 35;
} }
pub mod bpf_map_type { pub mod bpf_map_type {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_MAP_TYPE_UNSPEC: Type = 0; pub const BPF_MAP_TYPE_UNSPEC: Type = 0;
pub const BPF_MAP_TYPE_HASH: Type = 1; pub const BPF_MAP_TYPE_HASH: Type = 1;
pub const BPF_MAP_TYPE_ARRAY: Type = 2; pub const BPF_MAP_TYPE_ARRAY: Type = 2;
@ -472,7 +472,7 @@ pub mod bpf_map_type {
pub const BPF_MAP_TYPE_CGRP_STORAGE: Type = 32; pub const BPF_MAP_TYPE_CGRP_STORAGE: Type = 32;
} }
pub mod bpf_prog_type { pub mod bpf_prog_type {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_PROG_TYPE_UNSPEC: Type = 0; pub const BPF_PROG_TYPE_UNSPEC: Type = 0;
pub const BPF_PROG_TYPE_SOCKET_FILTER: Type = 1; pub const BPF_PROG_TYPE_SOCKET_FILTER: Type = 1;
pub const BPF_PROG_TYPE_KPROBE: Type = 2; pub const BPF_PROG_TYPE_KPROBE: Type = 2;
@ -508,7 +508,7 @@ pub mod bpf_prog_type {
pub const BPF_PROG_TYPE_NETFILTER: Type = 32; pub const BPF_PROG_TYPE_NETFILTER: Type = 32;
} }
pub mod bpf_attach_type { pub mod bpf_attach_type {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_CGROUP_INET_INGRESS: Type = 0; pub const BPF_CGROUP_INET_INGRESS: Type = 0;
pub const BPF_CGROUP_INET_EGRESS: Type = 1; pub const BPF_CGROUP_INET_EGRESS: Type = 1;
pub const BPF_CGROUP_INET_SOCK_CREATE: Type = 2; pub const BPF_CGROUP_INET_SOCK_CREATE: Type = 2;
@ -557,7 +557,7 @@ pub mod bpf_attach_type {
pub const __MAX_BPF_ATTACH_TYPE: Type = 45; pub const __MAX_BPF_ATTACH_TYPE: Type = 45;
} }
pub mod bpf_link_type { pub mod bpf_link_type {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_LINK_TYPE_UNSPEC: Type = 0; pub const BPF_LINK_TYPE_UNSPEC: Type = 0;
pub const BPF_LINK_TYPE_RAW_TRACEPOINT: Type = 1; pub const BPF_LINK_TYPE_RAW_TRACEPOINT: Type = 1;
pub const BPF_LINK_TYPE_TRACING: Type = 2; pub const BPF_LINK_TYPE_TRACING: Type = 2;
@ -575,7 +575,7 @@ pub const BPF_ANY: _bindgen_ty_2 = 0;
pub const BPF_NOEXIST: _bindgen_ty_2 = 1; pub const BPF_NOEXIST: _bindgen_ty_2 = 1;
pub const BPF_EXIST: _bindgen_ty_2 = 2; pub const BPF_EXIST: _bindgen_ty_2 = 2;
pub const BPF_F_LOCK: _bindgen_ty_2 = 4; pub const BPF_F_LOCK: _bindgen_ty_2 = 4;
pub type _bindgen_ty_2 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_2 = ::aya_ebpf_cty::c_uint;
pub const BPF_F_NO_PREALLOC: _bindgen_ty_3 = 1; pub const BPF_F_NO_PREALLOC: _bindgen_ty_3 = 1;
pub const BPF_F_NO_COMMON_LRU: _bindgen_ty_3 = 2; pub const BPF_F_NO_COMMON_LRU: _bindgen_ty_3 = 2;
pub const BPF_F_NUMA_NODE: _bindgen_ty_3 = 4; pub const BPF_F_NUMA_NODE: _bindgen_ty_3 = 4;
@ -591,13 +591,13 @@ pub const BPF_F_PRESERVE_ELEMS: _bindgen_ty_3 = 2048;
pub const BPF_F_INNER_MAP: _bindgen_ty_3 = 4096; pub const BPF_F_INNER_MAP: _bindgen_ty_3 = 4096;
pub const BPF_F_LINK: _bindgen_ty_3 = 8192; pub const BPF_F_LINK: _bindgen_ty_3 = 8192;
pub const BPF_F_PATH_FD: _bindgen_ty_3 = 16384; pub const BPF_F_PATH_FD: _bindgen_ty_3 = 16384;
pub type _bindgen_ty_3 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_3 = ::aya_ebpf_cty::c_uint;
pub mod bpf_stats_type { pub mod bpf_stats_type {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_STATS_RUN_TIME: Type = 0; pub const BPF_STATS_RUN_TIME: Type = 0;
} }
pub mod bpf_stack_build_id_status { pub mod bpf_stack_build_id_status {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_STACK_BUILD_ID_EMPTY: Type = 0; pub const BPF_STACK_BUILD_ID_EMPTY: Type = 0;
pub const BPF_STACK_BUILD_ID_VALID: Type = 1; pub const BPF_STACK_BUILD_ID_VALID: Type = 1;
pub const BPF_STACK_BUILD_ID_IP: Type = 2; pub const BPF_STACK_BUILD_ID_IP: Type = 2;
@ -606,7 +606,7 @@ pub mod bpf_stack_build_id_status {
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub struct bpf_stack_build_id { pub struct bpf_stack_build_id {
pub status: __s32, pub status: __s32,
pub build_id: [::aya_bpf_cty::c_uchar; 20usize], pub build_id: [::aya_ebpf_cty::c_uchar; 20usize],
pub __bindgen_anon_1: bpf_stack_build_id__bindgen_ty_1, pub __bindgen_anon_1: bpf_stack_build_id__bindgen_ty_1,
} }
#[repr(C)] #[repr(C)]
@ -648,7 +648,7 @@ pub struct bpf_attr__bindgen_ty_1 {
pub map_flags: __u32, pub map_flags: __u32,
pub inner_map_fd: __u32, pub inner_map_fd: __u32,
pub numa_node: __u32, pub numa_node: __u32,
pub map_name: [::aya_bpf_cty::c_char; 16usize], pub map_name: [::aya_ebpf_cty::c_char; 16usize],
pub map_ifindex: __u32, pub map_ifindex: __u32,
pub btf_fd: __u32, pub btf_fd: __u32,
pub btf_key_type_id: __u32, pub btf_key_type_id: __u32,
@ -694,7 +694,7 @@ pub struct bpf_attr__bindgen_ty_4 {
pub log_buf: __u64, pub log_buf: __u64,
pub kern_version: __u32, pub kern_version: __u32,
pub prog_flags: __u32, pub prog_flags: __u32,
pub prog_name: [::aya_bpf_cty::c_char; 16usize], pub prog_name: [::aya_ebpf_cty::c_char; 16usize],
pub prog_ifindex: __u32, pub prog_ifindex: __u32,
pub expected_attach_type: __u32, pub expected_attach_type: __u32,
pub prog_btf_fd: __u32, pub prog_btf_fd: __u32,
@ -926,7 +926,7 @@ pub struct bpf_attr__bindgen_ty_19 {
pub flags: __u32, pub flags: __u32,
} }
pub mod bpf_func_id { pub mod bpf_func_id {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_FUNC_unspec: Type = 0; pub const BPF_FUNC_unspec: Type = 0;
pub const BPF_FUNC_map_lookup_elem: Type = 1; pub const BPF_FUNC_map_lookup_elem: Type = 1;
pub const BPF_FUNC_map_update_elem: Type = 2; pub const BPF_FUNC_map_update_elem: Type = 2;
@ -1143,41 +1143,41 @@ pub mod bpf_func_id {
} }
pub const BPF_F_RECOMPUTE_CSUM: _bindgen_ty_4 = 1; pub const BPF_F_RECOMPUTE_CSUM: _bindgen_ty_4 = 1;
pub const BPF_F_INVALIDATE_HASH: _bindgen_ty_4 = 2; pub const BPF_F_INVALIDATE_HASH: _bindgen_ty_4 = 2;
pub type _bindgen_ty_4 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_4 = ::aya_ebpf_cty::c_uint;
pub const BPF_F_HDR_FIELD_MASK: _bindgen_ty_5 = 15; pub const BPF_F_HDR_FIELD_MASK: _bindgen_ty_5 = 15;
pub type _bindgen_ty_5 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_5 = ::aya_ebpf_cty::c_uint;
pub const BPF_F_PSEUDO_HDR: _bindgen_ty_6 = 16; pub const BPF_F_PSEUDO_HDR: _bindgen_ty_6 = 16;
pub const BPF_F_MARK_MANGLED_0: _bindgen_ty_6 = 32; pub const BPF_F_MARK_MANGLED_0: _bindgen_ty_6 = 32;
pub const BPF_F_MARK_ENFORCE: _bindgen_ty_6 = 64; pub const BPF_F_MARK_ENFORCE: _bindgen_ty_6 = 64;
pub type _bindgen_ty_6 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_6 = ::aya_ebpf_cty::c_uint;
pub const BPF_F_INGRESS: _bindgen_ty_7 = 1; pub const BPF_F_INGRESS: _bindgen_ty_7 = 1;
pub type _bindgen_ty_7 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_7 = ::aya_ebpf_cty::c_uint;
pub const BPF_F_TUNINFO_IPV6: _bindgen_ty_8 = 1; pub const BPF_F_TUNINFO_IPV6: _bindgen_ty_8 = 1;
pub type _bindgen_ty_8 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_8 = ::aya_ebpf_cty::c_uint;
pub const BPF_F_SKIP_FIELD_MASK: _bindgen_ty_9 = 255; pub const BPF_F_SKIP_FIELD_MASK: _bindgen_ty_9 = 255;
pub const BPF_F_USER_STACK: _bindgen_ty_9 = 256; pub const BPF_F_USER_STACK: _bindgen_ty_9 = 256;
pub const BPF_F_FAST_STACK_CMP: _bindgen_ty_9 = 512; pub const BPF_F_FAST_STACK_CMP: _bindgen_ty_9 = 512;
pub const BPF_F_REUSE_STACKID: _bindgen_ty_9 = 1024; pub const BPF_F_REUSE_STACKID: _bindgen_ty_9 = 1024;
pub const BPF_F_USER_BUILD_ID: _bindgen_ty_9 = 2048; pub const BPF_F_USER_BUILD_ID: _bindgen_ty_9 = 2048;
pub type _bindgen_ty_9 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_9 = ::aya_ebpf_cty::c_uint;
pub const BPF_F_ZERO_CSUM_TX: _bindgen_ty_10 = 2; pub const BPF_F_ZERO_CSUM_TX: _bindgen_ty_10 = 2;
pub const BPF_F_DONT_FRAGMENT: _bindgen_ty_10 = 4; pub const BPF_F_DONT_FRAGMENT: _bindgen_ty_10 = 4;
pub const BPF_F_SEQ_NUMBER: _bindgen_ty_10 = 8; pub const BPF_F_SEQ_NUMBER: _bindgen_ty_10 = 8;
pub const BPF_F_NO_TUNNEL_KEY: _bindgen_ty_10 = 16; pub const BPF_F_NO_TUNNEL_KEY: _bindgen_ty_10 = 16;
pub type _bindgen_ty_10 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_10 = ::aya_ebpf_cty::c_uint;
pub const BPF_F_TUNINFO_FLAGS: _bindgen_ty_11 = 16; pub const BPF_F_TUNINFO_FLAGS: _bindgen_ty_11 = 16;
pub type _bindgen_ty_11 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_11 = ::aya_ebpf_cty::c_uint;
pub const BPF_F_INDEX_MASK: _bindgen_ty_12 = 4294967295; pub const BPF_F_INDEX_MASK: _bindgen_ty_12 = 4294967295;
pub const BPF_F_CURRENT_CPU: _bindgen_ty_12 = 4294967295; pub const BPF_F_CURRENT_CPU: _bindgen_ty_12 = 4294967295;
pub const BPF_F_CTXLEN_MASK: _bindgen_ty_12 = 4503595332403200; pub const BPF_F_CTXLEN_MASK: _bindgen_ty_12 = 4503595332403200;
pub type _bindgen_ty_12 = ::aya_bpf_cty::c_ulong; pub type _bindgen_ty_12 = ::aya_ebpf_cty::c_ulong;
pub const BPF_F_CURRENT_NETNS: _bindgen_ty_13 = -1; pub const BPF_F_CURRENT_NETNS: _bindgen_ty_13 = -1;
pub type _bindgen_ty_13 = ::aya_bpf_cty::c_int; pub type _bindgen_ty_13 = ::aya_ebpf_cty::c_int;
pub const BPF_CSUM_LEVEL_QUERY: _bindgen_ty_14 = 0; pub const BPF_CSUM_LEVEL_QUERY: _bindgen_ty_14 = 0;
pub const BPF_CSUM_LEVEL_INC: _bindgen_ty_14 = 1; pub const BPF_CSUM_LEVEL_INC: _bindgen_ty_14 = 1;
pub const BPF_CSUM_LEVEL_DEC: _bindgen_ty_14 = 2; pub const BPF_CSUM_LEVEL_DEC: _bindgen_ty_14 = 2;
pub const BPF_CSUM_LEVEL_RESET: _bindgen_ty_14 = 3; pub const BPF_CSUM_LEVEL_RESET: _bindgen_ty_14 = 3;
pub type _bindgen_ty_14 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_14 = ::aya_ebpf_cty::c_uint;
pub const BPF_F_ADJ_ROOM_FIXED_GSO: _bindgen_ty_15 = 1; pub const BPF_F_ADJ_ROOM_FIXED_GSO: _bindgen_ty_15 = 1;
pub const BPF_F_ADJ_ROOM_ENCAP_L3_IPV4: _bindgen_ty_15 = 2; pub const BPF_F_ADJ_ROOM_ENCAP_L3_IPV4: _bindgen_ty_15 = 2;
pub const BPF_F_ADJ_ROOM_ENCAP_L3_IPV6: _bindgen_ty_15 = 4; pub const BPF_F_ADJ_ROOM_ENCAP_L3_IPV6: _bindgen_ty_15 = 4;
@ -1187,55 +1187,55 @@ pub const BPF_F_ADJ_ROOM_NO_CSUM_RESET: _bindgen_ty_15 = 32;
pub const BPF_F_ADJ_ROOM_ENCAP_L2_ETH: _bindgen_ty_15 = 64; pub const BPF_F_ADJ_ROOM_ENCAP_L2_ETH: _bindgen_ty_15 = 64;
pub const BPF_F_ADJ_ROOM_DECAP_L3_IPV4: _bindgen_ty_15 = 128; pub const BPF_F_ADJ_ROOM_DECAP_L3_IPV4: _bindgen_ty_15 = 128;
pub const BPF_F_ADJ_ROOM_DECAP_L3_IPV6: _bindgen_ty_15 = 256; pub const BPF_F_ADJ_ROOM_DECAP_L3_IPV6: _bindgen_ty_15 = 256;
pub type _bindgen_ty_15 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_15 = ::aya_ebpf_cty::c_uint;
pub const BPF_ADJ_ROOM_ENCAP_L2_MASK: _bindgen_ty_16 = 255; pub const BPF_ADJ_ROOM_ENCAP_L2_MASK: _bindgen_ty_16 = 255;
pub const BPF_ADJ_ROOM_ENCAP_L2_SHIFT: _bindgen_ty_16 = 56; pub const BPF_ADJ_ROOM_ENCAP_L2_SHIFT: _bindgen_ty_16 = 56;
pub type _bindgen_ty_16 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_16 = ::aya_ebpf_cty::c_uint;
pub const BPF_F_SYSCTL_BASE_NAME: _bindgen_ty_17 = 1; pub const BPF_F_SYSCTL_BASE_NAME: _bindgen_ty_17 = 1;
pub type _bindgen_ty_17 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_17 = ::aya_ebpf_cty::c_uint;
pub const BPF_LOCAL_STORAGE_GET_F_CREATE: _bindgen_ty_18 = 1; pub const BPF_LOCAL_STORAGE_GET_F_CREATE: _bindgen_ty_18 = 1;
pub const BPF_SK_STORAGE_GET_F_CREATE: _bindgen_ty_18 = 1; pub const BPF_SK_STORAGE_GET_F_CREATE: _bindgen_ty_18 = 1;
pub type _bindgen_ty_18 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_18 = ::aya_ebpf_cty::c_uint;
pub const BPF_F_GET_BRANCH_RECORDS_SIZE: _bindgen_ty_19 = 1; pub const BPF_F_GET_BRANCH_RECORDS_SIZE: _bindgen_ty_19 = 1;
pub type _bindgen_ty_19 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_19 = ::aya_ebpf_cty::c_uint;
pub const BPF_RB_NO_WAKEUP: _bindgen_ty_20 = 1; pub const BPF_RB_NO_WAKEUP: _bindgen_ty_20 = 1;
pub const BPF_RB_FORCE_WAKEUP: _bindgen_ty_20 = 2; pub const BPF_RB_FORCE_WAKEUP: _bindgen_ty_20 = 2;
pub type _bindgen_ty_20 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_20 = ::aya_ebpf_cty::c_uint;
pub const BPF_RB_AVAIL_DATA: _bindgen_ty_21 = 0; pub const BPF_RB_AVAIL_DATA: _bindgen_ty_21 = 0;
pub const BPF_RB_RING_SIZE: _bindgen_ty_21 = 1; pub const BPF_RB_RING_SIZE: _bindgen_ty_21 = 1;
pub const BPF_RB_CONS_POS: _bindgen_ty_21 = 2; pub const BPF_RB_CONS_POS: _bindgen_ty_21 = 2;
pub const BPF_RB_PROD_POS: _bindgen_ty_21 = 3; pub const BPF_RB_PROD_POS: _bindgen_ty_21 = 3;
pub type _bindgen_ty_21 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_21 = ::aya_ebpf_cty::c_uint;
pub const BPF_RINGBUF_BUSY_BIT: _bindgen_ty_22 = 2147483648; pub const BPF_RINGBUF_BUSY_BIT: _bindgen_ty_22 = 2147483648;
pub const BPF_RINGBUF_DISCARD_BIT: _bindgen_ty_22 = 1073741824; pub const BPF_RINGBUF_DISCARD_BIT: _bindgen_ty_22 = 1073741824;
pub const BPF_RINGBUF_HDR_SZ: _bindgen_ty_22 = 8; pub const BPF_RINGBUF_HDR_SZ: _bindgen_ty_22 = 8;
pub type _bindgen_ty_22 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_22 = ::aya_ebpf_cty::c_uint;
pub const BPF_SK_LOOKUP_F_REPLACE: _bindgen_ty_23 = 1; pub const BPF_SK_LOOKUP_F_REPLACE: _bindgen_ty_23 = 1;
pub const BPF_SK_LOOKUP_F_NO_REUSEPORT: _bindgen_ty_23 = 2; pub const BPF_SK_LOOKUP_F_NO_REUSEPORT: _bindgen_ty_23 = 2;
pub type _bindgen_ty_23 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_23 = ::aya_ebpf_cty::c_uint;
pub mod bpf_adj_room_mode { pub mod bpf_adj_room_mode {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_ADJ_ROOM_NET: Type = 0; pub const BPF_ADJ_ROOM_NET: Type = 0;
pub const BPF_ADJ_ROOM_MAC: Type = 1; pub const BPF_ADJ_ROOM_MAC: Type = 1;
} }
pub mod bpf_hdr_start_off { pub mod bpf_hdr_start_off {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_HDR_START_MAC: Type = 0; pub const BPF_HDR_START_MAC: Type = 0;
pub const BPF_HDR_START_NET: Type = 1; pub const BPF_HDR_START_NET: Type = 1;
} }
pub mod bpf_lwt_encap_mode { pub mod bpf_lwt_encap_mode {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_LWT_ENCAP_SEG6: Type = 0; pub const BPF_LWT_ENCAP_SEG6: Type = 0;
pub const BPF_LWT_ENCAP_SEG6_INLINE: Type = 1; pub const BPF_LWT_ENCAP_SEG6_INLINE: Type = 1;
pub const BPF_LWT_ENCAP_IP: Type = 2; pub const BPF_LWT_ENCAP_IP: Type = 2;
} }
pub const BPF_F_BPRM_SECUREEXEC: _bindgen_ty_24 = 1; pub const BPF_F_BPRM_SECUREEXEC: _bindgen_ty_24 = 1;
pub type _bindgen_ty_24 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_24 = ::aya_ebpf_cty::c_uint;
pub const BPF_F_BROADCAST: _bindgen_ty_25 = 8; pub const BPF_F_BROADCAST: _bindgen_ty_25 = 8;
pub const BPF_F_EXCLUDE_INGRESS: _bindgen_ty_25 = 16; pub const BPF_F_EXCLUDE_INGRESS: _bindgen_ty_25 = 16;
pub type _bindgen_ty_25 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_25 = ::aya_ebpf_cty::c_uint;
pub mod _bindgen_ty_26 { pub mod _bindgen_ty_26 {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_SKB_TSTAMP_UNSPEC: Type = 0; pub const BPF_SKB_TSTAMP_UNSPEC: Type = 0;
pub const BPF_SKB_TSTAMP_DELIVERY_MONO: Type = 1; pub const BPF_SKB_TSTAMP_DELIVERY_MONO: Type = 1;
} }
@ -1359,7 +1359,7 @@ pub union bpf_xfrm_state__bindgen_ty_1 {
pub remote_ipv6: [__u32; 4usize], pub remote_ipv6: [__u32; 4usize],
} }
pub mod bpf_ret_code { pub mod bpf_ret_code {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_OK: Type = 0; pub const BPF_OK: Type = 0;
pub const BPF_DROP: Type = 2; pub const BPF_DROP: Type = 2;
pub const BPF_REDIRECT: Type = 7; pub const BPF_REDIRECT: Type = 7;
@ -1456,7 +1456,7 @@ pub struct bpf_xdp_sock {
pub queue_id: __u32, pub queue_id: __u32,
} }
pub mod xdp_action { pub mod xdp_action {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const XDP_ABORTED: Type = 0; pub const XDP_ABORTED: Type = 0;
pub const XDP_DROP: Type = 1; pub const XDP_DROP: Type = 1;
pub const XDP_PASS: Type = 2; pub const XDP_PASS: Type = 2;
@ -1482,7 +1482,7 @@ pub struct bpf_devmap_val {
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub union bpf_devmap_val__bindgen_ty_1 { pub union bpf_devmap_val__bindgen_ty_1 {
pub fd: ::aya_bpf_cty::c_int, pub fd: ::aya_ebpf_cty::c_int,
pub id: __u32, pub id: __u32,
} }
#[repr(C)] #[repr(C)]
@ -1494,11 +1494,11 @@ pub struct bpf_cpumap_val {
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub union bpf_cpumap_val__bindgen_ty_1 { pub union bpf_cpumap_val__bindgen_ty_1 {
pub fd: ::aya_bpf_cty::c_int, pub fd: ::aya_ebpf_cty::c_int,
pub id: __u32, pub id: __u32,
} }
pub mod sk_action { pub mod sk_action {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const SK_DROP: Type = 0; pub const SK_DROP: Type = 0;
pub const SK_PASS: Type = 1; pub const SK_PASS: Type = 1;
} }
@ -1520,7 +1520,7 @@ pub struct sk_msg_md {
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub union sk_msg_md__bindgen_ty_1 { pub union sk_msg_md__bindgen_ty_1 {
pub data: *mut ::aya_bpf_cty::c_void, pub data: *mut ::aya_ebpf_cty::c_void,
pub _bitfield_align_1: [u8; 0], pub _bitfield_align_1: [u8; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>,
} }
@ -1534,7 +1534,7 @@ impl sk_msg_md__bindgen_ty_1 {
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub union sk_msg_md__bindgen_ty_2 { pub union sk_msg_md__bindgen_ty_2 {
pub data_end: *mut ::aya_bpf_cty::c_void, pub data_end: *mut ::aya_ebpf_cty::c_void,
pub _bitfield_align_1: [u8; 0], pub _bitfield_align_1: [u8; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>,
} }
@ -1575,7 +1575,7 @@ pub struct sk_reuseport_md {
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub union sk_reuseport_md__bindgen_ty_1 { pub union sk_reuseport_md__bindgen_ty_1 {
pub data: *mut ::aya_bpf_cty::c_void, pub data: *mut ::aya_ebpf_cty::c_void,
pub _bitfield_align_1: [u8; 0], pub _bitfield_align_1: [u8; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>,
} }
@ -1589,7 +1589,7 @@ impl sk_reuseport_md__bindgen_ty_1 {
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub union sk_reuseport_md__bindgen_ty_2 { pub union sk_reuseport_md__bindgen_ty_2 {
pub data_end: *mut ::aya_bpf_cty::c_void, pub data_end: *mut ::aya_ebpf_cty::c_void,
pub _bitfield_align_1: [u8; 0], pub _bitfield_align_1: [u8; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>,
} }
@ -1642,7 +1642,7 @@ pub struct bpf_prog_info {
pub created_by_uid: __u32, pub created_by_uid: __u32,
pub nr_map_ids: __u32, pub nr_map_ids: __u32,
pub map_ids: __u64, pub map_ids: __u64,
pub name: [::aya_bpf_cty::c_char; 16usize], pub name: [::aya_ebpf_cty::c_char; 16usize],
pub ifindex: __u32, pub ifindex: __u32,
pub _bitfield_align_1: [u8; 0], pub _bitfield_align_1: [u8; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>,
@ -1702,7 +1702,7 @@ pub struct bpf_map_info {
pub value_size: __u32, pub value_size: __u32,
pub max_entries: __u32, pub max_entries: __u32,
pub map_flags: __u32, pub map_flags: __u32,
pub name: [::aya_bpf_cty::c_char; 16usize], pub name: [::aya_ebpf_cty::c_char; 16usize],
pub ifindex: __u32, pub ifindex: __u32,
pub btf_vmlinux_value_type_id: __u32, pub btf_vmlinux_value_type_id: __u32,
pub netns_dev: __u64, pub netns_dev: __u64,
@ -1927,7 +1927,7 @@ impl bpf_sock_ops__bindgen_ty_2 {
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub union bpf_sock_ops__bindgen_ty_3 { pub union bpf_sock_ops__bindgen_ty_3 {
pub skb_data: *mut ::aya_bpf_cty::c_void, pub skb_data: *mut ::aya_ebpf_cty::c_void,
pub _bitfield_align_1: [u8; 0], pub _bitfield_align_1: [u8; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>,
} }
@ -1941,7 +1941,7 @@ impl bpf_sock_ops__bindgen_ty_3 {
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub union bpf_sock_ops__bindgen_ty_4 { pub union bpf_sock_ops__bindgen_ty_4 {
pub skb_data_end: *mut ::aya_bpf_cty::c_void, pub skb_data_end: *mut ::aya_ebpf_cty::c_void,
pub _bitfield_align_1: [u8; 0], pub _bitfield_align_1: [u8; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>,
} }
@ -1960,7 +1960,7 @@ pub const BPF_SOCK_OPS_PARSE_ALL_HDR_OPT_CB_FLAG: _bindgen_ty_27 = 16;
pub const BPF_SOCK_OPS_PARSE_UNKNOWN_HDR_OPT_CB_FLAG: _bindgen_ty_27 = 32; pub const BPF_SOCK_OPS_PARSE_UNKNOWN_HDR_OPT_CB_FLAG: _bindgen_ty_27 = 32;
pub const BPF_SOCK_OPS_WRITE_HDR_OPT_CB_FLAG: _bindgen_ty_27 = 64; pub const BPF_SOCK_OPS_WRITE_HDR_OPT_CB_FLAG: _bindgen_ty_27 = 64;
pub const BPF_SOCK_OPS_ALL_CB_FLAGS: _bindgen_ty_27 = 127; pub const BPF_SOCK_OPS_ALL_CB_FLAGS: _bindgen_ty_27 = 127;
pub type _bindgen_ty_27 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_27 = ::aya_ebpf_cty::c_uint;
pub const BPF_SOCK_OPS_VOID: _bindgen_ty_28 = 0; pub const BPF_SOCK_OPS_VOID: _bindgen_ty_28 = 0;
pub const BPF_SOCK_OPS_TIMEOUT_INIT: _bindgen_ty_28 = 1; pub const BPF_SOCK_OPS_TIMEOUT_INIT: _bindgen_ty_28 = 1;
pub const BPF_SOCK_OPS_RWND_INIT: _bindgen_ty_28 = 2; pub const BPF_SOCK_OPS_RWND_INIT: _bindgen_ty_28 = 2;
@ -1977,7 +1977,7 @@ pub const BPF_SOCK_OPS_RTT_CB: _bindgen_ty_28 = 12;
pub const BPF_SOCK_OPS_PARSE_HDR_OPT_CB: _bindgen_ty_28 = 13; pub const BPF_SOCK_OPS_PARSE_HDR_OPT_CB: _bindgen_ty_28 = 13;
pub const BPF_SOCK_OPS_HDR_OPT_LEN_CB: _bindgen_ty_28 = 14; pub const BPF_SOCK_OPS_HDR_OPT_LEN_CB: _bindgen_ty_28 = 14;
pub const BPF_SOCK_OPS_WRITE_HDR_OPT_CB: _bindgen_ty_28 = 15; pub const BPF_SOCK_OPS_WRITE_HDR_OPT_CB: _bindgen_ty_28 = 15;
pub type _bindgen_ty_28 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_28 = ::aya_ebpf_cty::c_uint;
pub const BPF_TCP_ESTABLISHED: _bindgen_ty_29 = 1; pub const BPF_TCP_ESTABLISHED: _bindgen_ty_29 = 1;
pub const BPF_TCP_SYN_SENT: _bindgen_ty_29 = 2; pub const BPF_TCP_SYN_SENT: _bindgen_ty_29 = 2;
pub const BPF_TCP_SYN_RECV: _bindgen_ty_29 = 3; pub const BPF_TCP_SYN_RECV: _bindgen_ty_29 = 3;
@ -1991,13 +1991,13 @@ pub const BPF_TCP_LISTEN: _bindgen_ty_29 = 10;
pub const BPF_TCP_CLOSING: _bindgen_ty_29 = 11; pub const BPF_TCP_CLOSING: _bindgen_ty_29 = 11;
pub const BPF_TCP_NEW_SYN_RECV: _bindgen_ty_29 = 12; pub const BPF_TCP_NEW_SYN_RECV: _bindgen_ty_29 = 12;
pub const BPF_TCP_MAX_STATES: _bindgen_ty_29 = 13; pub const BPF_TCP_MAX_STATES: _bindgen_ty_29 = 13;
pub type _bindgen_ty_29 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_29 = ::aya_ebpf_cty::c_uint;
pub mod _bindgen_ty_31 { pub mod _bindgen_ty_31 {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_LOAD_HDR_OPT_TCP_SYN: Type = 1; pub const BPF_LOAD_HDR_OPT_TCP_SYN: Type = 1;
} }
pub mod _bindgen_ty_32 { pub mod _bindgen_ty_32 {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_WRITE_HDR_TCP_CURRENT_MSS: Type = 1; pub const BPF_WRITE_HDR_TCP_CURRENT_MSS: Type = 1;
pub const BPF_WRITE_HDR_TCP_SYNACK_COOKIE: Type = 2; pub const BPF_WRITE_HDR_TCP_SYNACK_COOKIE: Type = 2;
} }
@ -2011,10 +2011,10 @@ pub struct bpf_perf_event_value {
pub const BPF_DEVCG_ACC_MKNOD: _bindgen_ty_33 = 1; pub const BPF_DEVCG_ACC_MKNOD: _bindgen_ty_33 = 1;
pub const BPF_DEVCG_ACC_READ: _bindgen_ty_33 = 2; pub const BPF_DEVCG_ACC_READ: _bindgen_ty_33 = 2;
pub const BPF_DEVCG_ACC_WRITE: _bindgen_ty_33 = 4; pub const BPF_DEVCG_ACC_WRITE: _bindgen_ty_33 = 4;
pub type _bindgen_ty_33 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_33 = ::aya_ebpf_cty::c_uint;
pub const BPF_DEVCG_DEV_BLOCK: _bindgen_ty_34 = 1; pub const BPF_DEVCG_DEV_BLOCK: _bindgen_ty_34 = 1;
pub const BPF_DEVCG_DEV_CHAR: _bindgen_ty_34 = 2; pub const BPF_DEVCG_DEV_CHAR: _bindgen_ty_34 = 2;
pub type _bindgen_ty_34 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_34 = ::aya_ebpf_cty::c_uint;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
pub struct bpf_cgroup_dev_ctx { pub struct bpf_cgroup_dev_ctx {
@ -2030,7 +2030,7 @@ pub struct bpf_raw_tracepoint_args {
pub const BPF_FIB_LOOKUP_DIRECT: _bindgen_ty_35 = 1; pub const BPF_FIB_LOOKUP_DIRECT: _bindgen_ty_35 = 1;
pub const BPF_FIB_LOOKUP_OUTPUT: _bindgen_ty_35 = 2; pub const BPF_FIB_LOOKUP_OUTPUT: _bindgen_ty_35 = 2;
pub const BPF_FIB_LOOKUP_SKIP_NEIGH: _bindgen_ty_35 = 4; pub const BPF_FIB_LOOKUP_SKIP_NEIGH: _bindgen_ty_35 = 4;
pub type _bindgen_ty_35 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_35 = ::aya_ebpf_cty::c_uint;
pub const BPF_FIB_LKUP_RET_SUCCESS: _bindgen_ty_36 = 0; pub const BPF_FIB_LKUP_RET_SUCCESS: _bindgen_ty_36 = 0;
pub const BPF_FIB_LKUP_RET_BLACKHOLE: _bindgen_ty_36 = 1; pub const BPF_FIB_LKUP_RET_BLACKHOLE: _bindgen_ty_36 = 1;
pub const BPF_FIB_LKUP_RET_UNREACHABLE: _bindgen_ty_36 = 2; pub const BPF_FIB_LKUP_RET_UNREACHABLE: _bindgen_ty_36 = 2;
@ -2040,7 +2040,7 @@ pub const BPF_FIB_LKUP_RET_FWD_DISABLED: _bindgen_ty_36 = 5;
pub const BPF_FIB_LKUP_RET_UNSUPP_LWT: _bindgen_ty_36 = 6; pub const BPF_FIB_LKUP_RET_UNSUPP_LWT: _bindgen_ty_36 = 6;
pub const BPF_FIB_LKUP_RET_NO_NEIGH: _bindgen_ty_36 = 7; pub const BPF_FIB_LKUP_RET_NO_NEIGH: _bindgen_ty_36 = 7;
pub const BPF_FIB_LKUP_RET_FRAG_NEEDED: _bindgen_ty_36 = 8; pub const BPF_FIB_LKUP_RET_FRAG_NEEDED: _bindgen_ty_36 = 8;
pub type _bindgen_ty_36 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_36 = ::aya_ebpf_cty::c_uint;
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub struct bpf_fib_lookup { pub struct bpf_fib_lookup {
@ -2096,17 +2096,17 @@ pub union bpf_redir_neigh__bindgen_ty_1 {
pub ipv6_nh: [__u32; 4usize], pub ipv6_nh: [__u32; 4usize],
} }
pub mod bpf_check_mtu_flags { pub mod bpf_check_mtu_flags {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_MTU_CHK_SEGS: Type = 1; pub const BPF_MTU_CHK_SEGS: Type = 1;
} }
pub mod bpf_check_mtu_ret { pub mod bpf_check_mtu_ret {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_MTU_CHK_RET_SUCCESS: Type = 0; pub const BPF_MTU_CHK_RET_SUCCESS: Type = 0;
pub const BPF_MTU_CHK_RET_FRAG_NEEDED: Type = 1; pub const BPF_MTU_CHK_RET_FRAG_NEEDED: Type = 1;
pub const BPF_MTU_CHK_RET_SEGS_TOOBIG: Type = 2; pub const BPF_MTU_CHK_RET_SEGS_TOOBIG: Type = 2;
} }
pub mod bpf_task_fd_type { pub mod bpf_task_fd_type {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_FD_TYPE_RAW_TRACEPOINT: Type = 0; pub const BPF_FD_TYPE_RAW_TRACEPOINT: Type = 0;
pub const BPF_FD_TYPE_TRACEPOINT: Type = 1; pub const BPF_FD_TYPE_TRACEPOINT: Type = 1;
pub const BPF_FD_TYPE_KPROBE: Type = 2; pub const BPF_FD_TYPE_KPROBE: Type = 2;
@ -2117,7 +2117,7 @@ pub mod bpf_task_fd_type {
pub const BPF_FLOW_DISSECTOR_F_PARSE_1ST_FRAG: _bindgen_ty_37 = 1; pub const BPF_FLOW_DISSECTOR_F_PARSE_1ST_FRAG: _bindgen_ty_37 = 1;
pub const BPF_FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL: _bindgen_ty_37 = 2; pub const BPF_FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL: _bindgen_ty_37 = 2;
pub const BPF_FLOW_DISSECTOR_F_STOP_AT_ENCAP: _bindgen_ty_37 = 4; pub const BPF_FLOW_DISSECTOR_F_STOP_AT_ENCAP: _bindgen_ty_37 = 4;
pub type _bindgen_ty_37 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_37 = ::aya_ebpf_cty::c_uint;
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub struct bpf_flow_keys { pub struct bpf_flow_keys {
@ -2304,7 +2304,7 @@ impl bpf_sockopt__bindgen_ty_1 {
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub union bpf_sockopt__bindgen_ty_2 { pub union bpf_sockopt__bindgen_ty_2 {
pub optval: *mut ::aya_bpf_cty::c_void, pub optval: *mut ::aya_ebpf_cty::c_void,
pub _bitfield_align_1: [u8; 0], pub _bitfield_align_1: [u8; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>,
} }
@ -2318,7 +2318,7 @@ impl bpf_sockopt__bindgen_ty_2 {
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub union bpf_sockopt__bindgen_ty_3 { pub union bpf_sockopt__bindgen_ty_3 {
pub optval_end: *mut ::aya_bpf_cty::c_void, pub optval_end: *mut ::aya_ebpf_cty::c_void,
pub _bitfield_align_1: [u8; 0], pub _bitfield_align_1: [u8; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>,
} }
@ -2381,12 +2381,12 @@ impl bpf_sk_lookup {
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
pub struct btf_ptr { pub struct btf_ptr {
pub ptr: *mut ::aya_bpf_cty::c_void, pub ptr: *mut ::aya_ebpf_cty::c_void,
pub type_id: __u32, pub type_id: __u32,
pub flags: __u32, pub flags: __u32,
} }
pub mod bpf_core_relo_kind { pub mod bpf_core_relo_kind {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_CORE_FIELD_BYTE_OFFSET: Type = 0; pub const BPF_CORE_FIELD_BYTE_OFFSET: Type = 0;
pub const BPF_CORE_FIELD_BYTE_SIZE: Type = 1; pub const BPF_CORE_FIELD_BYTE_SIZE: Type = 1;
pub const BPF_CORE_FIELD_EXISTS: Type = 2; pub const BPF_CORE_FIELD_EXISTS: Type = 2;
@ -2410,7 +2410,7 @@ pub struct bpf_core_relo {
pub kind: bpf_core_relo_kind::Type, pub kind: bpf_core_relo_kind::Type,
} }
pub const BPF_F_TIMER_ABS: _bindgen_ty_39 = 1; pub const BPF_F_TIMER_ABS: _bindgen_ty_39 = 1;
pub type _bindgen_ty_39 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_39 = ::aya_ebpf_cty::c_uint;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
pub struct bpf_iter_num { pub struct bpf_iter_num {
@ -2424,12 +2424,12 @@ pub struct user_pt_regs {
pub pc: __u64, pub pc: __u64,
pub pstate: __u64, pub pstate: __u64,
} }
pub type sa_family_t = ::aya_bpf_cty::c_ushort; pub type sa_family_t = ::aya_ebpf_cty::c_ushort;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
pub struct sockaddr { pub struct sockaddr {
pub sa_family: sa_family_t, pub sa_family: sa_family_t,
pub sa_data: [::aya_bpf_cty::c_char; 14usize], pub sa_data: [::aya_ebpf_cty::c_char; 14usize],
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]

@ -274,13 +274,13 @@ pub const TC_ACT_REDIRECT: u32 = 7;
pub const TC_ACT_TRAP: u32 = 8; pub const TC_ACT_TRAP: u32 = 8;
pub const TC_ACT_VALUE_MAX: u32 = 8; pub const TC_ACT_VALUE_MAX: u32 = 8;
pub const TC_ACT_EXT_VAL_MASK: u32 = 268435455; pub const TC_ACT_EXT_VAL_MASK: u32 = 268435455;
pub type __u8 = ::aya_bpf_cty::c_uchar; pub type __u8 = ::aya_ebpf_cty::c_uchar;
pub type __s16 = ::aya_bpf_cty::c_short; pub type __s16 = ::aya_ebpf_cty::c_short;
pub type __u16 = ::aya_bpf_cty::c_ushort; pub type __u16 = ::aya_ebpf_cty::c_ushort;
pub type __s32 = ::aya_bpf_cty::c_int; pub type __s32 = ::aya_ebpf_cty::c_int;
pub type __u32 = ::aya_bpf_cty::c_uint; pub type __u32 = ::aya_ebpf_cty::c_uint;
pub type __s64 = ::aya_bpf_cty::c_longlong; pub type __s64 = ::aya_ebpf_cty::c_longlong;
pub type __u64 = ::aya_bpf_cty::c_ulonglong; pub type __u64 = ::aya_ebpf_cty::c_ulonglong;
pub type __be16 = __u16; pub type __be16 = __u16;
pub type __be32 = __u32; pub type __be32 = __u32;
pub type __wsum = __u32; pub type __wsum = __u32;
@ -296,7 +296,7 @@ pub const BPF_REG_8: _bindgen_ty_1 = 8;
pub const BPF_REG_9: _bindgen_ty_1 = 9; pub const BPF_REG_9: _bindgen_ty_1 = 9;
pub const BPF_REG_10: _bindgen_ty_1 = 10; pub const BPF_REG_10: _bindgen_ty_1 = 10;
pub const __MAX_BPF_REG: _bindgen_ty_1 = 11; pub const __MAX_BPF_REG: _bindgen_ty_1 = 11;
pub type _bindgen_ty_1 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_1 = ::aya_ebpf_cty::c_uint;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
pub struct bpf_insn { pub struct bpf_insn {
@ -356,7 +356,7 @@ pub struct bpf_cgroup_storage_key {
pub attach_type: __u32, pub attach_type: __u32,
} }
pub mod bpf_cgroup_iter_order { pub mod bpf_cgroup_iter_order {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_CGROUP_ITER_ORDER_UNSPEC: Type = 0; pub const BPF_CGROUP_ITER_ORDER_UNSPEC: Type = 0;
pub const BPF_CGROUP_ITER_SELF_ONLY: Type = 1; pub const BPF_CGROUP_ITER_SELF_ONLY: Type = 1;
pub const BPF_CGROUP_ITER_DESCENDANTS_PRE: Type = 2; pub const BPF_CGROUP_ITER_DESCENDANTS_PRE: Type = 2;
@ -390,7 +390,7 @@ pub struct bpf_iter_link_info__bindgen_ty_3 {
pub pid_fd: __u32, pub pid_fd: __u32,
} }
pub mod bpf_cmd { pub mod bpf_cmd {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_MAP_CREATE: Type = 0; pub const BPF_MAP_CREATE: Type = 0;
pub const BPF_MAP_LOOKUP_ELEM: Type = 1; pub const BPF_MAP_LOOKUP_ELEM: Type = 1;
pub const BPF_MAP_UPDATE_ELEM: Type = 2; pub const BPF_MAP_UPDATE_ELEM: Type = 2;
@ -430,7 +430,7 @@ pub mod bpf_cmd {
pub const BPF_PROG_BIND_MAP: Type = 35; pub const BPF_PROG_BIND_MAP: Type = 35;
} }
pub mod bpf_map_type { pub mod bpf_map_type {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_MAP_TYPE_UNSPEC: Type = 0; pub const BPF_MAP_TYPE_UNSPEC: Type = 0;
pub const BPF_MAP_TYPE_HASH: Type = 1; pub const BPF_MAP_TYPE_HASH: Type = 1;
pub const BPF_MAP_TYPE_ARRAY: Type = 2; pub const BPF_MAP_TYPE_ARRAY: Type = 2;
@ -467,7 +467,7 @@ pub mod bpf_map_type {
pub const BPF_MAP_TYPE_CGRP_STORAGE: Type = 32; pub const BPF_MAP_TYPE_CGRP_STORAGE: Type = 32;
} }
pub mod bpf_prog_type { pub mod bpf_prog_type {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_PROG_TYPE_UNSPEC: Type = 0; pub const BPF_PROG_TYPE_UNSPEC: Type = 0;
pub const BPF_PROG_TYPE_SOCKET_FILTER: Type = 1; pub const BPF_PROG_TYPE_SOCKET_FILTER: Type = 1;
pub const BPF_PROG_TYPE_KPROBE: Type = 2; pub const BPF_PROG_TYPE_KPROBE: Type = 2;
@ -503,7 +503,7 @@ pub mod bpf_prog_type {
pub const BPF_PROG_TYPE_NETFILTER: Type = 32; pub const BPF_PROG_TYPE_NETFILTER: Type = 32;
} }
pub mod bpf_attach_type { pub mod bpf_attach_type {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_CGROUP_INET_INGRESS: Type = 0; pub const BPF_CGROUP_INET_INGRESS: Type = 0;
pub const BPF_CGROUP_INET_EGRESS: Type = 1; pub const BPF_CGROUP_INET_EGRESS: Type = 1;
pub const BPF_CGROUP_INET_SOCK_CREATE: Type = 2; pub const BPF_CGROUP_INET_SOCK_CREATE: Type = 2;
@ -552,7 +552,7 @@ pub mod bpf_attach_type {
pub const __MAX_BPF_ATTACH_TYPE: Type = 45; pub const __MAX_BPF_ATTACH_TYPE: Type = 45;
} }
pub mod bpf_link_type { pub mod bpf_link_type {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_LINK_TYPE_UNSPEC: Type = 0; pub const BPF_LINK_TYPE_UNSPEC: Type = 0;
pub const BPF_LINK_TYPE_RAW_TRACEPOINT: Type = 1; pub const BPF_LINK_TYPE_RAW_TRACEPOINT: Type = 1;
pub const BPF_LINK_TYPE_TRACING: Type = 2; pub const BPF_LINK_TYPE_TRACING: Type = 2;
@ -570,7 +570,7 @@ pub const BPF_ANY: _bindgen_ty_2 = 0;
pub const BPF_NOEXIST: _bindgen_ty_2 = 1; pub const BPF_NOEXIST: _bindgen_ty_2 = 1;
pub const BPF_EXIST: _bindgen_ty_2 = 2; pub const BPF_EXIST: _bindgen_ty_2 = 2;
pub const BPF_F_LOCK: _bindgen_ty_2 = 4; pub const BPF_F_LOCK: _bindgen_ty_2 = 4;
pub type _bindgen_ty_2 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_2 = ::aya_ebpf_cty::c_uint;
pub const BPF_F_NO_PREALLOC: _bindgen_ty_3 = 1; pub const BPF_F_NO_PREALLOC: _bindgen_ty_3 = 1;
pub const BPF_F_NO_COMMON_LRU: _bindgen_ty_3 = 2; pub const BPF_F_NO_COMMON_LRU: _bindgen_ty_3 = 2;
pub const BPF_F_NUMA_NODE: _bindgen_ty_3 = 4; pub const BPF_F_NUMA_NODE: _bindgen_ty_3 = 4;
@ -586,13 +586,13 @@ pub const BPF_F_PRESERVE_ELEMS: _bindgen_ty_3 = 2048;
pub const BPF_F_INNER_MAP: _bindgen_ty_3 = 4096; pub const BPF_F_INNER_MAP: _bindgen_ty_3 = 4096;
pub const BPF_F_LINK: _bindgen_ty_3 = 8192; pub const BPF_F_LINK: _bindgen_ty_3 = 8192;
pub const BPF_F_PATH_FD: _bindgen_ty_3 = 16384; pub const BPF_F_PATH_FD: _bindgen_ty_3 = 16384;
pub type _bindgen_ty_3 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_3 = ::aya_ebpf_cty::c_uint;
pub mod bpf_stats_type { pub mod bpf_stats_type {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_STATS_RUN_TIME: Type = 0; pub const BPF_STATS_RUN_TIME: Type = 0;
} }
pub mod bpf_stack_build_id_status { pub mod bpf_stack_build_id_status {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_STACK_BUILD_ID_EMPTY: Type = 0; pub const BPF_STACK_BUILD_ID_EMPTY: Type = 0;
pub const BPF_STACK_BUILD_ID_VALID: Type = 1; pub const BPF_STACK_BUILD_ID_VALID: Type = 1;
pub const BPF_STACK_BUILD_ID_IP: Type = 2; pub const BPF_STACK_BUILD_ID_IP: Type = 2;
@ -601,7 +601,7 @@ pub mod bpf_stack_build_id_status {
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub struct bpf_stack_build_id { pub struct bpf_stack_build_id {
pub status: __s32, pub status: __s32,
pub build_id: [::aya_bpf_cty::c_uchar; 20usize], pub build_id: [::aya_ebpf_cty::c_uchar; 20usize],
pub __bindgen_anon_1: bpf_stack_build_id__bindgen_ty_1, pub __bindgen_anon_1: bpf_stack_build_id__bindgen_ty_1,
} }
#[repr(C)] #[repr(C)]
@ -643,7 +643,7 @@ pub struct bpf_attr__bindgen_ty_1 {
pub map_flags: __u32, pub map_flags: __u32,
pub inner_map_fd: __u32, pub inner_map_fd: __u32,
pub numa_node: __u32, pub numa_node: __u32,
pub map_name: [::aya_bpf_cty::c_char; 16usize], pub map_name: [::aya_ebpf_cty::c_char; 16usize],
pub map_ifindex: __u32, pub map_ifindex: __u32,
pub btf_fd: __u32, pub btf_fd: __u32,
pub btf_key_type_id: __u32, pub btf_key_type_id: __u32,
@ -689,7 +689,7 @@ pub struct bpf_attr__bindgen_ty_4 {
pub log_buf: __u64, pub log_buf: __u64,
pub kern_version: __u32, pub kern_version: __u32,
pub prog_flags: __u32, pub prog_flags: __u32,
pub prog_name: [::aya_bpf_cty::c_char; 16usize], pub prog_name: [::aya_ebpf_cty::c_char; 16usize],
pub prog_ifindex: __u32, pub prog_ifindex: __u32,
pub expected_attach_type: __u32, pub expected_attach_type: __u32,
pub prog_btf_fd: __u32, pub prog_btf_fd: __u32,
@ -921,7 +921,7 @@ pub struct bpf_attr__bindgen_ty_19 {
pub flags: __u32, pub flags: __u32,
} }
pub mod bpf_func_id { pub mod bpf_func_id {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_FUNC_unspec: Type = 0; pub const BPF_FUNC_unspec: Type = 0;
pub const BPF_FUNC_map_lookup_elem: Type = 1; pub const BPF_FUNC_map_lookup_elem: Type = 1;
pub const BPF_FUNC_map_update_elem: Type = 2; pub const BPF_FUNC_map_update_elem: Type = 2;
@ -1138,41 +1138,41 @@ pub mod bpf_func_id {
} }
pub const BPF_F_RECOMPUTE_CSUM: _bindgen_ty_4 = 1; pub const BPF_F_RECOMPUTE_CSUM: _bindgen_ty_4 = 1;
pub const BPF_F_INVALIDATE_HASH: _bindgen_ty_4 = 2; pub const BPF_F_INVALIDATE_HASH: _bindgen_ty_4 = 2;
pub type _bindgen_ty_4 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_4 = ::aya_ebpf_cty::c_uint;
pub const BPF_F_HDR_FIELD_MASK: _bindgen_ty_5 = 15; pub const BPF_F_HDR_FIELD_MASK: _bindgen_ty_5 = 15;
pub type _bindgen_ty_5 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_5 = ::aya_ebpf_cty::c_uint;
pub const BPF_F_PSEUDO_HDR: _bindgen_ty_6 = 16; pub const BPF_F_PSEUDO_HDR: _bindgen_ty_6 = 16;
pub const BPF_F_MARK_MANGLED_0: _bindgen_ty_6 = 32; pub const BPF_F_MARK_MANGLED_0: _bindgen_ty_6 = 32;
pub const BPF_F_MARK_ENFORCE: _bindgen_ty_6 = 64; pub const BPF_F_MARK_ENFORCE: _bindgen_ty_6 = 64;
pub type _bindgen_ty_6 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_6 = ::aya_ebpf_cty::c_uint;
pub const BPF_F_INGRESS: _bindgen_ty_7 = 1; pub const BPF_F_INGRESS: _bindgen_ty_7 = 1;
pub type _bindgen_ty_7 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_7 = ::aya_ebpf_cty::c_uint;
pub const BPF_F_TUNINFO_IPV6: _bindgen_ty_8 = 1; pub const BPF_F_TUNINFO_IPV6: _bindgen_ty_8 = 1;
pub type _bindgen_ty_8 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_8 = ::aya_ebpf_cty::c_uint;
pub const BPF_F_SKIP_FIELD_MASK: _bindgen_ty_9 = 255; pub const BPF_F_SKIP_FIELD_MASK: _bindgen_ty_9 = 255;
pub const BPF_F_USER_STACK: _bindgen_ty_9 = 256; pub const BPF_F_USER_STACK: _bindgen_ty_9 = 256;
pub const BPF_F_FAST_STACK_CMP: _bindgen_ty_9 = 512; pub const BPF_F_FAST_STACK_CMP: _bindgen_ty_9 = 512;
pub const BPF_F_REUSE_STACKID: _bindgen_ty_9 = 1024; pub const BPF_F_REUSE_STACKID: _bindgen_ty_9 = 1024;
pub const BPF_F_USER_BUILD_ID: _bindgen_ty_9 = 2048; pub const BPF_F_USER_BUILD_ID: _bindgen_ty_9 = 2048;
pub type _bindgen_ty_9 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_9 = ::aya_ebpf_cty::c_uint;
pub const BPF_F_ZERO_CSUM_TX: _bindgen_ty_10 = 2; pub const BPF_F_ZERO_CSUM_TX: _bindgen_ty_10 = 2;
pub const BPF_F_DONT_FRAGMENT: _bindgen_ty_10 = 4; pub const BPF_F_DONT_FRAGMENT: _bindgen_ty_10 = 4;
pub const BPF_F_SEQ_NUMBER: _bindgen_ty_10 = 8; pub const BPF_F_SEQ_NUMBER: _bindgen_ty_10 = 8;
pub const BPF_F_NO_TUNNEL_KEY: _bindgen_ty_10 = 16; pub const BPF_F_NO_TUNNEL_KEY: _bindgen_ty_10 = 16;
pub type _bindgen_ty_10 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_10 = ::aya_ebpf_cty::c_uint;
pub const BPF_F_TUNINFO_FLAGS: _bindgen_ty_11 = 16; pub const BPF_F_TUNINFO_FLAGS: _bindgen_ty_11 = 16;
pub type _bindgen_ty_11 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_11 = ::aya_ebpf_cty::c_uint;
pub const BPF_F_INDEX_MASK: _bindgen_ty_12 = 4294967295; pub const BPF_F_INDEX_MASK: _bindgen_ty_12 = 4294967295;
pub const BPF_F_CURRENT_CPU: _bindgen_ty_12 = 4294967295; pub const BPF_F_CURRENT_CPU: _bindgen_ty_12 = 4294967295;
pub const BPF_F_CTXLEN_MASK: _bindgen_ty_12 = 4503595332403200; pub const BPF_F_CTXLEN_MASK: _bindgen_ty_12 = 4503595332403200;
pub type _bindgen_ty_12 = ::aya_bpf_cty::c_ulonglong; pub type _bindgen_ty_12 = ::aya_ebpf_cty::c_ulonglong;
pub const BPF_F_CURRENT_NETNS: _bindgen_ty_13 = -1; pub const BPF_F_CURRENT_NETNS: _bindgen_ty_13 = -1;
pub type _bindgen_ty_13 = ::aya_bpf_cty::c_int; pub type _bindgen_ty_13 = ::aya_ebpf_cty::c_int;
pub const BPF_CSUM_LEVEL_QUERY: _bindgen_ty_14 = 0; pub const BPF_CSUM_LEVEL_QUERY: _bindgen_ty_14 = 0;
pub const BPF_CSUM_LEVEL_INC: _bindgen_ty_14 = 1; pub const BPF_CSUM_LEVEL_INC: _bindgen_ty_14 = 1;
pub const BPF_CSUM_LEVEL_DEC: _bindgen_ty_14 = 2; pub const BPF_CSUM_LEVEL_DEC: _bindgen_ty_14 = 2;
pub const BPF_CSUM_LEVEL_RESET: _bindgen_ty_14 = 3; pub const BPF_CSUM_LEVEL_RESET: _bindgen_ty_14 = 3;
pub type _bindgen_ty_14 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_14 = ::aya_ebpf_cty::c_uint;
pub const BPF_F_ADJ_ROOM_FIXED_GSO: _bindgen_ty_15 = 1; pub const BPF_F_ADJ_ROOM_FIXED_GSO: _bindgen_ty_15 = 1;
pub const BPF_F_ADJ_ROOM_ENCAP_L3_IPV4: _bindgen_ty_15 = 2; pub const BPF_F_ADJ_ROOM_ENCAP_L3_IPV4: _bindgen_ty_15 = 2;
pub const BPF_F_ADJ_ROOM_ENCAP_L3_IPV6: _bindgen_ty_15 = 4; pub const BPF_F_ADJ_ROOM_ENCAP_L3_IPV6: _bindgen_ty_15 = 4;
@ -1182,55 +1182,55 @@ pub const BPF_F_ADJ_ROOM_NO_CSUM_RESET: _bindgen_ty_15 = 32;
pub const BPF_F_ADJ_ROOM_ENCAP_L2_ETH: _bindgen_ty_15 = 64; pub const BPF_F_ADJ_ROOM_ENCAP_L2_ETH: _bindgen_ty_15 = 64;
pub const BPF_F_ADJ_ROOM_DECAP_L3_IPV4: _bindgen_ty_15 = 128; pub const BPF_F_ADJ_ROOM_DECAP_L3_IPV4: _bindgen_ty_15 = 128;
pub const BPF_F_ADJ_ROOM_DECAP_L3_IPV6: _bindgen_ty_15 = 256; pub const BPF_F_ADJ_ROOM_DECAP_L3_IPV6: _bindgen_ty_15 = 256;
pub type _bindgen_ty_15 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_15 = ::aya_ebpf_cty::c_uint;
pub const BPF_ADJ_ROOM_ENCAP_L2_MASK: _bindgen_ty_16 = 255; pub const BPF_ADJ_ROOM_ENCAP_L2_MASK: _bindgen_ty_16 = 255;
pub const BPF_ADJ_ROOM_ENCAP_L2_SHIFT: _bindgen_ty_16 = 56; pub const BPF_ADJ_ROOM_ENCAP_L2_SHIFT: _bindgen_ty_16 = 56;
pub type _bindgen_ty_16 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_16 = ::aya_ebpf_cty::c_uint;
pub const BPF_F_SYSCTL_BASE_NAME: _bindgen_ty_17 = 1; pub const BPF_F_SYSCTL_BASE_NAME: _bindgen_ty_17 = 1;
pub type _bindgen_ty_17 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_17 = ::aya_ebpf_cty::c_uint;
pub const BPF_LOCAL_STORAGE_GET_F_CREATE: _bindgen_ty_18 = 1; pub const BPF_LOCAL_STORAGE_GET_F_CREATE: _bindgen_ty_18 = 1;
pub const BPF_SK_STORAGE_GET_F_CREATE: _bindgen_ty_18 = 1; pub const BPF_SK_STORAGE_GET_F_CREATE: _bindgen_ty_18 = 1;
pub type _bindgen_ty_18 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_18 = ::aya_ebpf_cty::c_uint;
pub const BPF_F_GET_BRANCH_RECORDS_SIZE: _bindgen_ty_19 = 1; pub const BPF_F_GET_BRANCH_RECORDS_SIZE: _bindgen_ty_19 = 1;
pub type _bindgen_ty_19 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_19 = ::aya_ebpf_cty::c_uint;
pub const BPF_RB_NO_WAKEUP: _bindgen_ty_20 = 1; pub const BPF_RB_NO_WAKEUP: _bindgen_ty_20 = 1;
pub const BPF_RB_FORCE_WAKEUP: _bindgen_ty_20 = 2; pub const BPF_RB_FORCE_WAKEUP: _bindgen_ty_20 = 2;
pub type _bindgen_ty_20 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_20 = ::aya_ebpf_cty::c_uint;
pub const BPF_RB_AVAIL_DATA: _bindgen_ty_21 = 0; pub const BPF_RB_AVAIL_DATA: _bindgen_ty_21 = 0;
pub const BPF_RB_RING_SIZE: _bindgen_ty_21 = 1; pub const BPF_RB_RING_SIZE: _bindgen_ty_21 = 1;
pub const BPF_RB_CONS_POS: _bindgen_ty_21 = 2; pub const BPF_RB_CONS_POS: _bindgen_ty_21 = 2;
pub const BPF_RB_PROD_POS: _bindgen_ty_21 = 3; pub const BPF_RB_PROD_POS: _bindgen_ty_21 = 3;
pub type _bindgen_ty_21 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_21 = ::aya_ebpf_cty::c_uint;
pub const BPF_RINGBUF_BUSY_BIT: _bindgen_ty_22 = 2147483648; pub const BPF_RINGBUF_BUSY_BIT: _bindgen_ty_22 = 2147483648;
pub const BPF_RINGBUF_DISCARD_BIT: _bindgen_ty_22 = 1073741824; pub const BPF_RINGBUF_DISCARD_BIT: _bindgen_ty_22 = 1073741824;
pub const BPF_RINGBUF_HDR_SZ: _bindgen_ty_22 = 8; pub const BPF_RINGBUF_HDR_SZ: _bindgen_ty_22 = 8;
pub type _bindgen_ty_22 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_22 = ::aya_ebpf_cty::c_uint;
pub const BPF_SK_LOOKUP_F_REPLACE: _bindgen_ty_23 = 1; pub const BPF_SK_LOOKUP_F_REPLACE: _bindgen_ty_23 = 1;
pub const BPF_SK_LOOKUP_F_NO_REUSEPORT: _bindgen_ty_23 = 2; pub const BPF_SK_LOOKUP_F_NO_REUSEPORT: _bindgen_ty_23 = 2;
pub type _bindgen_ty_23 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_23 = ::aya_ebpf_cty::c_uint;
pub mod bpf_adj_room_mode { pub mod bpf_adj_room_mode {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_ADJ_ROOM_NET: Type = 0; pub const BPF_ADJ_ROOM_NET: Type = 0;
pub const BPF_ADJ_ROOM_MAC: Type = 1; pub const BPF_ADJ_ROOM_MAC: Type = 1;
} }
pub mod bpf_hdr_start_off { pub mod bpf_hdr_start_off {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_HDR_START_MAC: Type = 0; pub const BPF_HDR_START_MAC: Type = 0;
pub const BPF_HDR_START_NET: Type = 1; pub const BPF_HDR_START_NET: Type = 1;
} }
pub mod bpf_lwt_encap_mode { pub mod bpf_lwt_encap_mode {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_LWT_ENCAP_SEG6: Type = 0; pub const BPF_LWT_ENCAP_SEG6: Type = 0;
pub const BPF_LWT_ENCAP_SEG6_INLINE: Type = 1; pub const BPF_LWT_ENCAP_SEG6_INLINE: Type = 1;
pub const BPF_LWT_ENCAP_IP: Type = 2; pub const BPF_LWT_ENCAP_IP: Type = 2;
} }
pub const BPF_F_BPRM_SECUREEXEC: _bindgen_ty_24 = 1; pub const BPF_F_BPRM_SECUREEXEC: _bindgen_ty_24 = 1;
pub type _bindgen_ty_24 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_24 = ::aya_ebpf_cty::c_uint;
pub const BPF_F_BROADCAST: _bindgen_ty_25 = 8; pub const BPF_F_BROADCAST: _bindgen_ty_25 = 8;
pub const BPF_F_EXCLUDE_INGRESS: _bindgen_ty_25 = 16; pub const BPF_F_EXCLUDE_INGRESS: _bindgen_ty_25 = 16;
pub type _bindgen_ty_25 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_25 = ::aya_ebpf_cty::c_uint;
pub mod _bindgen_ty_26 { pub mod _bindgen_ty_26 {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_SKB_TSTAMP_UNSPEC: Type = 0; pub const BPF_SKB_TSTAMP_UNSPEC: Type = 0;
pub const BPF_SKB_TSTAMP_DELIVERY_MONO: Type = 1; pub const BPF_SKB_TSTAMP_DELIVERY_MONO: Type = 1;
} }
@ -1356,7 +1356,7 @@ pub union bpf_xfrm_state__bindgen_ty_1 {
pub remote_ipv6: [__u32; 4usize], pub remote_ipv6: [__u32; 4usize],
} }
pub mod bpf_ret_code { pub mod bpf_ret_code {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_OK: Type = 0; pub const BPF_OK: Type = 0;
pub const BPF_DROP: Type = 2; pub const BPF_DROP: Type = 2;
pub const BPF_REDIRECT: Type = 7; pub const BPF_REDIRECT: Type = 7;
@ -1453,7 +1453,7 @@ pub struct bpf_xdp_sock {
pub queue_id: __u32, pub queue_id: __u32,
} }
pub mod xdp_action { pub mod xdp_action {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const XDP_ABORTED: Type = 0; pub const XDP_ABORTED: Type = 0;
pub const XDP_DROP: Type = 1; pub const XDP_DROP: Type = 1;
pub const XDP_PASS: Type = 2; pub const XDP_PASS: Type = 2;
@ -1479,7 +1479,7 @@ pub struct bpf_devmap_val {
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub union bpf_devmap_val__bindgen_ty_1 { pub union bpf_devmap_val__bindgen_ty_1 {
pub fd: ::aya_bpf_cty::c_int, pub fd: ::aya_ebpf_cty::c_int,
pub id: __u32, pub id: __u32,
} }
#[repr(C)] #[repr(C)]
@ -1491,11 +1491,11 @@ pub struct bpf_cpumap_val {
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub union bpf_cpumap_val__bindgen_ty_1 { pub union bpf_cpumap_val__bindgen_ty_1 {
pub fd: ::aya_bpf_cty::c_int, pub fd: ::aya_ebpf_cty::c_int,
pub id: __u32, pub id: __u32,
} }
pub mod sk_action { pub mod sk_action {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const SK_DROP: Type = 0; pub const SK_DROP: Type = 0;
pub const SK_PASS: Type = 1; pub const SK_PASS: Type = 1;
} }
@ -1518,7 +1518,7 @@ pub struct sk_msg_md {
#[repr(align(8))] #[repr(align(8))]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub union sk_msg_md__bindgen_ty_1 { pub union sk_msg_md__bindgen_ty_1 {
pub data: *mut ::aya_bpf_cty::c_void, pub data: *mut ::aya_ebpf_cty::c_void,
pub _bitfield_align_1: [u8; 0], pub _bitfield_align_1: [u8; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>,
} }
@ -1533,7 +1533,7 @@ impl sk_msg_md__bindgen_ty_1 {
#[repr(align(8))] #[repr(align(8))]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub union sk_msg_md__bindgen_ty_2 { pub union sk_msg_md__bindgen_ty_2 {
pub data_end: *mut ::aya_bpf_cty::c_void, pub data_end: *mut ::aya_ebpf_cty::c_void,
pub _bitfield_align_1: [u8; 0], pub _bitfield_align_1: [u8; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>,
} }
@ -1576,7 +1576,7 @@ pub struct sk_reuseport_md {
#[repr(align(8))] #[repr(align(8))]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub union sk_reuseport_md__bindgen_ty_1 { pub union sk_reuseport_md__bindgen_ty_1 {
pub data: *mut ::aya_bpf_cty::c_void, pub data: *mut ::aya_ebpf_cty::c_void,
pub _bitfield_align_1: [u8; 0], pub _bitfield_align_1: [u8; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>,
} }
@ -1591,7 +1591,7 @@ impl sk_reuseport_md__bindgen_ty_1 {
#[repr(align(8))] #[repr(align(8))]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub union sk_reuseport_md__bindgen_ty_2 { pub union sk_reuseport_md__bindgen_ty_2 {
pub data_end: *mut ::aya_bpf_cty::c_void, pub data_end: *mut ::aya_ebpf_cty::c_void,
pub _bitfield_align_1: [u8; 0], pub _bitfield_align_1: [u8; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>,
} }
@ -1646,7 +1646,7 @@ pub struct bpf_prog_info {
pub created_by_uid: __u32, pub created_by_uid: __u32,
pub nr_map_ids: __u32, pub nr_map_ids: __u32,
pub map_ids: __u64, pub map_ids: __u64,
pub name: [::aya_bpf_cty::c_char; 16usize], pub name: [::aya_ebpf_cty::c_char; 16usize],
pub ifindex: __u32, pub ifindex: __u32,
pub _bitfield_align_1: [u8; 0], pub _bitfield_align_1: [u8; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>,
@ -1706,7 +1706,7 @@ pub struct bpf_map_info {
pub value_size: __u32, pub value_size: __u32,
pub max_entries: __u32, pub max_entries: __u32,
pub map_flags: __u32, pub map_flags: __u32,
pub name: [::aya_bpf_cty::c_char; 16usize], pub name: [::aya_ebpf_cty::c_char; 16usize],
pub ifindex: __u32, pub ifindex: __u32,
pub btf_vmlinux_value_type_id: __u32, pub btf_vmlinux_value_type_id: __u32,
pub netns_dev: __u64, pub netns_dev: __u64,
@ -1934,7 +1934,7 @@ impl bpf_sock_ops__bindgen_ty_2 {
#[repr(align(8))] #[repr(align(8))]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub union bpf_sock_ops__bindgen_ty_3 { pub union bpf_sock_ops__bindgen_ty_3 {
pub skb_data: *mut ::aya_bpf_cty::c_void, pub skb_data: *mut ::aya_ebpf_cty::c_void,
pub _bitfield_align_1: [u8; 0], pub _bitfield_align_1: [u8; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>,
} }
@ -1949,7 +1949,7 @@ impl bpf_sock_ops__bindgen_ty_3 {
#[repr(align(8))] #[repr(align(8))]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub union bpf_sock_ops__bindgen_ty_4 { pub union bpf_sock_ops__bindgen_ty_4 {
pub skb_data_end: *mut ::aya_bpf_cty::c_void, pub skb_data_end: *mut ::aya_ebpf_cty::c_void,
pub _bitfield_align_1: [u8; 0], pub _bitfield_align_1: [u8; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>,
} }
@ -1968,7 +1968,7 @@ pub const BPF_SOCK_OPS_PARSE_ALL_HDR_OPT_CB_FLAG: _bindgen_ty_27 = 16;
pub const BPF_SOCK_OPS_PARSE_UNKNOWN_HDR_OPT_CB_FLAG: _bindgen_ty_27 = 32; pub const BPF_SOCK_OPS_PARSE_UNKNOWN_HDR_OPT_CB_FLAG: _bindgen_ty_27 = 32;
pub const BPF_SOCK_OPS_WRITE_HDR_OPT_CB_FLAG: _bindgen_ty_27 = 64; pub const BPF_SOCK_OPS_WRITE_HDR_OPT_CB_FLAG: _bindgen_ty_27 = 64;
pub const BPF_SOCK_OPS_ALL_CB_FLAGS: _bindgen_ty_27 = 127; pub const BPF_SOCK_OPS_ALL_CB_FLAGS: _bindgen_ty_27 = 127;
pub type _bindgen_ty_27 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_27 = ::aya_ebpf_cty::c_uint;
pub const BPF_SOCK_OPS_VOID: _bindgen_ty_28 = 0; pub const BPF_SOCK_OPS_VOID: _bindgen_ty_28 = 0;
pub const BPF_SOCK_OPS_TIMEOUT_INIT: _bindgen_ty_28 = 1; pub const BPF_SOCK_OPS_TIMEOUT_INIT: _bindgen_ty_28 = 1;
pub const BPF_SOCK_OPS_RWND_INIT: _bindgen_ty_28 = 2; pub const BPF_SOCK_OPS_RWND_INIT: _bindgen_ty_28 = 2;
@ -1985,7 +1985,7 @@ pub const BPF_SOCK_OPS_RTT_CB: _bindgen_ty_28 = 12;
pub const BPF_SOCK_OPS_PARSE_HDR_OPT_CB: _bindgen_ty_28 = 13; pub const BPF_SOCK_OPS_PARSE_HDR_OPT_CB: _bindgen_ty_28 = 13;
pub const BPF_SOCK_OPS_HDR_OPT_LEN_CB: _bindgen_ty_28 = 14; pub const BPF_SOCK_OPS_HDR_OPT_LEN_CB: _bindgen_ty_28 = 14;
pub const BPF_SOCK_OPS_WRITE_HDR_OPT_CB: _bindgen_ty_28 = 15; pub const BPF_SOCK_OPS_WRITE_HDR_OPT_CB: _bindgen_ty_28 = 15;
pub type _bindgen_ty_28 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_28 = ::aya_ebpf_cty::c_uint;
pub const BPF_TCP_ESTABLISHED: _bindgen_ty_29 = 1; pub const BPF_TCP_ESTABLISHED: _bindgen_ty_29 = 1;
pub const BPF_TCP_SYN_SENT: _bindgen_ty_29 = 2; pub const BPF_TCP_SYN_SENT: _bindgen_ty_29 = 2;
pub const BPF_TCP_SYN_RECV: _bindgen_ty_29 = 3; pub const BPF_TCP_SYN_RECV: _bindgen_ty_29 = 3;
@ -1999,13 +1999,13 @@ pub const BPF_TCP_LISTEN: _bindgen_ty_29 = 10;
pub const BPF_TCP_CLOSING: _bindgen_ty_29 = 11; pub const BPF_TCP_CLOSING: _bindgen_ty_29 = 11;
pub const BPF_TCP_NEW_SYN_RECV: _bindgen_ty_29 = 12; pub const BPF_TCP_NEW_SYN_RECV: _bindgen_ty_29 = 12;
pub const BPF_TCP_MAX_STATES: _bindgen_ty_29 = 13; pub const BPF_TCP_MAX_STATES: _bindgen_ty_29 = 13;
pub type _bindgen_ty_29 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_29 = ::aya_ebpf_cty::c_uint;
pub mod _bindgen_ty_31 { pub mod _bindgen_ty_31 {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_LOAD_HDR_OPT_TCP_SYN: Type = 1; pub const BPF_LOAD_HDR_OPT_TCP_SYN: Type = 1;
} }
pub mod _bindgen_ty_32 { pub mod _bindgen_ty_32 {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_WRITE_HDR_TCP_CURRENT_MSS: Type = 1; pub const BPF_WRITE_HDR_TCP_CURRENT_MSS: Type = 1;
pub const BPF_WRITE_HDR_TCP_SYNACK_COOKIE: Type = 2; pub const BPF_WRITE_HDR_TCP_SYNACK_COOKIE: Type = 2;
} }
@ -2019,10 +2019,10 @@ pub struct bpf_perf_event_value {
pub const BPF_DEVCG_ACC_MKNOD: _bindgen_ty_33 = 1; pub const BPF_DEVCG_ACC_MKNOD: _bindgen_ty_33 = 1;
pub const BPF_DEVCG_ACC_READ: _bindgen_ty_33 = 2; pub const BPF_DEVCG_ACC_READ: _bindgen_ty_33 = 2;
pub const BPF_DEVCG_ACC_WRITE: _bindgen_ty_33 = 4; pub const BPF_DEVCG_ACC_WRITE: _bindgen_ty_33 = 4;
pub type _bindgen_ty_33 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_33 = ::aya_ebpf_cty::c_uint;
pub const BPF_DEVCG_DEV_BLOCK: _bindgen_ty_34 = 1; pub const BPF_DEVCG_DEV_BLOCK: _bindgen_ty_34 = 1;
pub const BPF_DEVCG_DEV_CHAR: _bindgen_ty_34 = 2; pub const BPF_DEVCG_DEV_CHAR: _bindgen_ty_34 = 2;
pub type _bindgen_ty_34 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_34 = ::aya_ebpf_cty::c_uint;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
pub struct bpf_cgroup_dev_ctx { pub struct bpf_cgroup_dev_ctx {
@ -2038,7 +2038,7 @@ pub struct bpf_raw_tracepoint_args {
pub const BPF_FIB_LOOKUP_DIRECT: _bindgen_ty_35 = 1; pub const BPF_FIB_LOOKUP_DIRECT: _bindgen_ty_35 = 1;
pub const BPF_FIB_LOOKUP_OUTPUT: _bindgen_ty_35 = 2; pub const BPF_FIB_LOOKUP_OUTPUT: _bindgen_ty_35 = 2;
pub const BPF_FIB_LOOKUP_SKIP_NEIGH: _bindgen_ty_35 = 4; pub const BPF_FIB_LOOKUP_SKIP_NEIGH: _bindgen_ty_35 = 4;
pub type _bindgen_ty_35 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_35 = ::aya_ebpf_cty::c_uint;
pub const BPF_FIB_LKUP_RET_SUCCESS: _bindgen_ty_36 = 0; pub const BPF_FIB_LKUP_RET_SUCCESS: _bindgen_ty_36 = 0;
pub const BPF_FIB_LKUP_RET_BLACKHOLE: _bindgen_ty_36 = 1; pub const BPF_FIB_LKUP_RET_BLACKHOLE: _bindgen_ty_36 = 1;
pub const BPF_FIB_LKUP_RET_UNREACHABLE: _bindgen_ty_36 = 2; pub const BPF_FIB_LKUP_RET_UNREACHABLE: _bindgen_ty_36 = 2;
@ -2048,7 +2048,7 @@ pub const BPF_FIB_LKUP_RET_FWD_DISABLED: _bindgen_ty_36 = 5;
pub const BPF_FIB_LKUP_RET_UNSUPP_LWT: _bindgen_ty_36 = 6; pub const BPF_FIB_LKUP_RET_UNSUPP_LWT: _bindgen_ty_36 = 6;
pub const BPF_FIB_LKUP_RET_NO_NEIGH: _bindgen_ty_36 = 7; pub const BPF_FIB_LKUP_RET_NO_NEIGH: _bindgen_ty_36 = 7;
pub const BPF_FIB_LKUP_RET_FRAG_NEEDED: _bindgen_ty_36 = 8; pub const BPF_FIB_LKUP_RET_FRAG_NEEDED: _bindgen_ty_36 = 8;
pub type _bindgen_ty_36 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_36 = ::aya_ebpf_cty::c_uint;
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub struct bpf_fib_lookup { pub struct bpf_fib_lookup {
@ -2104,17 +2104,17 @@ pub union bpf_redir_neigh__bindgen_ty_1 {
pub ipv6_nh: [__u32; 4usize], pub ipv6_nh: [__u32; 4usize],
} }
pub mod bpf_check_mtu_flags { pub mod bpf_check_mtu_flags {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_MTU_CHK_SEGS: Type = 1; pub const BPF_MTU_CHK_SEGS: Type = 1;
} }
pub mod bpf_check_mtu_ret { pub mod bpf_check_mtu_ret {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_MTU_CHK_RET_SUCCESS: Type = 0; pub const BPF_MTU_CHK_RET_SUCCESS: Type = 0;
pub const BPF_MTU_CHK_RET_FRAG_NEEDED: Type = 1; pub const BPF_MTU_CHK_RET_FRAG_NEEDED: Type = 1;
pub const BPF_MTU_CHK_RET_SEGS_TOOBIG: Type = 2; pub const BPF_MTU_CHK_RET_SEGS_TOOBIG: Type = 2;
} }
pub mod bpf_task_fd_type { pub mod bpf_task_fd_type {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_FD_TYPE_RAW_TRACEPOINT: Type = 0; pub const BPF_FD_TYPE_RAW_TRACEPOINT: Type = 0;
pub const BPF_FD_TYPE_TRACEPOINT: Type = 1; pub const BPF_FD_TYPE_TRACEPOINT: Type = 1;
pub const BPF_FD_TYPE_KPROBE: Type = 2; pub const BPF_FD_TYPE_KPROBE: Type = 2;
@ -2125,7 +2125,7 @@ pub mod bpf_task_fd_type {
pub const BPF_FLOW_DISSECTOR_F_PARSE_1ST_FRAG: _bindgen_ty_37 = 1; pub const BPF_FLOW_DISSECTOR_F_PARSE_1ST_FRAG: _bindgen_ty_37 = 1;
pub const BPF_FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL: _bindgen_ty_37 = 2; pub const BPF_FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL: _bindgen_ty_37 = 2;
pub const BPF_FLOW_DISSECTOR_F_STOP_AT_ENCAP: _bindgen_ty_37 = 4; pub const BPF_FLOW_DISSECTOR_F_STOP_AT_ENCAP: _bindgen_ty_37 = 4;
pub type _bindgen_ty_37 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_37 = ::aya_ebpf_cty::c_uint;
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub struct bpf_flow_keys { pub struct bpf_flow_keys {
@ -2314,7 +2314,7 @@ impl bpf_sockopt__bindgen_ty_1 {
#[repr(align(8))] #[repr(align(8))]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub union bpf_sockopt__bindgen_ty_2 { pub union bpf_sockopt__bindgen_ty_2 {
pub optval: *mut ::aya_bpf_cty::c_void, pub optval: *mut ::aya_ebpf_cty::c_void,
pub _bitfield_align_1: [u8; 0], pub _bitfield_align_1: [u8; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>,
} }
@ -2329,7 +2329,7 @@ impl bpf_sockopt__bindgen_ty_2 {
#[repr(align(8))] #[repr(align(8))]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub union bpf_sockopt__bindgen_ty_3 { pub union bpf_sockopt__bindgen_ty_3 {
pub optval_end: *mut ::aya_bpf_cty::c_void, pub optval_end: *mut ::aya_ebpf_cty::c_void,
pub _bitfield_align_1: [u8; 0], pub _bitfield_align_1: [u8; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>,
} }
@ -2393,12 +2393,12 @@ impl bpf_sk_lookup {
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
pub struct btf_ptr { pub struct btf_ptr {
pub ptr: *mut ::aya_bpf_cty::c_void, pub ptr: *mut ::aya_ebpf_cty::c_void,
pub type_id: __u32, pub type_id: __u32,
pub flags: __u32, pub flags: __u32,
} }
pub mod bpf_core_relo_kind { pub mod bpf_core_relo_kind {
pub type Type = ::aya_bpf_cty::c_uint; pub type Type = ::aya_ebpf_cty::c_uint;
pub const BPF_CORE_FIELD_BYTE_OFFSET: Type = 0; pub const BPF_CORE_FIELD_BYTE_OFFSET: Type = 0;
pub const BPF_CORE_FIELD_BYTE_SIZE: Type = 1; pub const BPF_CORE_FIELD_BYTE_SIZE: Type = 1;
pub const BPF_CORE_FIELD_EXISTS: Type = 2; pub const BPF_CORE_FIELD_EXISTS: Type = 2;
@ -2422,7 +2422,7 @@ pub struct bpf_core_relo {
pub kind: bpf_core_relo_kind::Type, pub kind: bpf_core_relo_kind::Type,
} }
pub const BPF_F_TIMER_ABS: _bindgen_ty_39 = 1; pub const BPF_F_TIMER_ABS: _bindgen_ty_39 = 1;
pub type _bindgen_ty_39 = ::aya_bpf_cty::c_uint; pub type _bindgen_ty_39 = ::aya_ebpf_cty::c_uint;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
pub struct bpf_iter_num { pub struct bpf_iter_num {
@ -2431,14 +2431,14 @@ pub struct bpf_iter_num {
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
pub struct pt_regs { pub struct pt_regs {
pub uregs: [::aya_bpf_cty::c_long; 18usize], pub uregs: [::aya_ebpf_cty::c_long; 18usize],
} }
pub type sa_family_t = ::aya_bpf_cty::c_ushort; pub type sa_family_t = ::aya_ebpf_cty::c_ushort;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
pub struct sockaddr { pub struct sockaddr {
pub sa_family: sa_family_t, pub sa_family: sa_family_t,
pub sa_data: [::aya_bpf_cty::c_char; 14usize], pub sa_data: [::aya_ebpf_cty::c_char; 14usize],
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save