Skip to content

ygrek/ocaml-bpf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.