OCaml embedded eBPF assembler
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
doc
pkg
src
.gitignore
.merlin
CHANGES.md
Makefile
README.md
_tags
opam

README.md

OCaml embedded eBPF assembler.

eBPF.mli

Assuming R1 points to packet data - check if it is an ARP packet :

let arp =
[
  ldx H R2 (R1,12);
  movi R0 1;
  jmpi `Exit R2 `EQ 0x806;
  movi R0 0;
label `Exit;
  ret
]

See src/test.ml for more examples.