package bpf

  1. Overview
  2. Docs
Embedded eBPF assembler

Install

Dune Dependency

Authors

Maintainers

Sources

bpf-0.1.tbz
sha256=94d602c50c9503d9e20f210ab3f0d49ced27f8c6a945dc6fd8f9135c26d420e5
md5=fe1e6b23e9f9786bd6396754de5c1e5c

Description

Generate BPF programs directly from OCaml, for use with Linux kernel socket/seccomp/event filters or to generate machine code with ubpf JIT for userspace.

Tags

org:ygrek

Published: 04 Jul 2017

README

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_ 1 R2 `EQ 0x806;
  movi R0 0;
  ret
]

See src/test.ml for more examples.

Dependencies (5)

  1. ppx_deriving
  2. topkg build
  3. ocamlbuild build
  4. ocamlfind build
  5. ocaml >= "4.02.0"

Dev Dependencies

None

Used by

None

Conflicts

None

OCaml

Innovation. Community. Security.