Skip to content

Commit

Permalink
docs: Use Ebpf instead of Bpf
Browse files Browse the repository at this point in the history
  • Loading branch information
vadorovsky authored and dave-tucker committed Mar 7, 2024
1 parent 110a76c commit 57a69fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ use a `BPF_PROG_TYPE_CGROUP_SKB` program with aya:

```rust
use std::fs::File;
use aya::Bpf;
use aya::Ebpf;
use aya::programs::{CgroupSkb, CgroupSkbAttachType};

// 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`.
let ingress: &mut CgroupSkb = bpf.program_mut("ingress_filter")?.try_into()?;
// get the `ingress_filter` program compiled into `ebpf.o`.
let ingress: &mut CgroupSkb = ebpf.program_mut("ingress_filter")?.try_into()?;

// load the program into the kernel
ingress.load()?;
Expand Down
6 changes: 3 additions & 3 deletions aya/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ use a `BPF_PROG_TYPE_CGROUP_SKB` program with aya:

```rust
use std::fs::File;
use aya::Bpf;
use aya::Ebpf;
use aya::programs::{CgroupSkb, CgroupSkbAttachType};

// 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`.
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
ingress.load()?;
Expand Down

0 comments on commit 57a69fe

Please sign in to comment.