aya-rs / book

The Aya Book is an introductory book about using the Rust Programming Language and Aya library to build extended Berkley Packet Filter (eBPF) programs.
https://aya-rs.dev/book/
Apache License 2.0
81 stars 60 forks source link

add kprobe sample program attached to tcp_connect #81

Closed dmitris closed 1 year ago

dmitris commented 1 year ago

PR adds an example kprobe program attached to tcp_connect. It also adds a book page to fill in the current "WIP" https://aya-rs.dev/book/programs/probes/.

Sample output:

$ cargo xtask build-ebpf --release && cargo build --release && sudo RUST_LOG=info target/release/kprobetcp

[2022-12-28T15:12:55Z INFO  kprobetcp] Waiting for Ctrl-C...
[2022-12-28T15:13:08Z INFO  kprobetcp] AF_INET6 src addr: 2001:4998:efeb:282:0:0:0:249, dest addr: 2606:2800:220:1:248:1893:25c8:1946
[2022-12-28T15:13:16Z INFO  kprobetcp] AF_INET src address: 10.53.149.148, dest address: 93.184.216.34
[2022-12-28T15:13:19Z INFO  kprobetcp] AF_INET src address: 10.53.149.148, dest address: 10.222.58.32
netlify[bot] commented 1 year ago

Deploy Preview for aya-rs ready!

Name Link
Latest commit 88d03c10459e56397e34e9e8d8d10b99277ee935
Latest deploy log https://app.netlify.com/sites/aya-rs/deploys/63adb21d2af741000b34ae2d
Deploy Preview https://deploy-preview-81--aya-rs.netlify.app/book/programs/probes
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

dmitris commented 1 year ago

I added a book page describing kprobe programs and linking to the example