Skip to content

Simple project to work with eBPF in linux kernel and eBPF programs in Solana with solana_rbpf.

Notifications You must be signed in to change notification settings

gubasso/ebpf-network-solana

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Network Ebpf

This project was built to learn and implement simple programs related to:

  • Linux kernel eBPF
  • Solana development with Anchor framework
  • Run a Solana binary within solana_rbpf VM

Aya project setup

Setup a development environment1

rustup install stable
rustup toolchain install nightly --component rust-src
cargo install bpf-linker
cargo install cargo-generate
# cargo generate https://github.com/aya-rs/aya-template
# cargo generate --name myapp -d program_type=xdp https://github.com/aya-rs/aya-template
cargo generate --name xdp-drop-limit -d program_type=xdp https://github.com/aya-rs/aya-template

Compile eBPF program

cargo xtask build-ebpf

To verify the program:

# llvm-objdump -S target/bpfel-unknown-none/debug/myapp
llvm-objdump -S target/bpfel-unknown-none/debug/xdp-drop-limit

User-space Component

Build:

cargo build

Run:

# RUST_LOG=info cargo xtask run -- --iface [interface]
RUST_LOG=info cargo xtask run -- --iface wlp1s0

Check if eBPF program is running:

sudo bpftool prog list

References:

Footnotes

  1. https://aya-rs.dev/book/start/development "The Aya Book: Development Environment"

About

Simple project to work with eBPF in linux kernel and eBPF programs in Solana with solana_rbpf.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published