ebpf - Erlang eBPF Library

Copyright © 2021 Oskar Mazerath

Version: 0.2.1

Authors: Oskar Mazerath (moskar.drummer@gmail.com).

ebpf is an Erlang library for generating and interacting with eBPF programs.

Contents

  1. Introduction
  2. Generating eBPF code
  3. Interacting with eBPF programs
  4. Interacting with eBPF maps

Introduction

ebpf has two main functionalities:

The first is implemented in ebpf_kern, the latter in ebpf_user. These modules are related, and can integrate with each other, but they can act seperately and are not dependent on each other.

ebpf also includes the ebpf_asm module for assembling ebpf_kern generated instructions into eBPF binary code.

Generating eBPF code

See ebpf_kern.

Interacting with eBPF programs

See ebpf_user.

Interacting with eBPF maps

eBPF maps are the main method of keeping state and communicating with userspace in eBPF programs. The standard workflow with eBPF maps is creating and initializing a map Map from userspace, then loading an eBPF program Prog that accesses Map, e.g. to read some configuration data, and then using from userspace Map to interact with Prog, e.g. by updating the configuration stored in Map or reading values that Prog may have updated.

For the interacting with eBPF maps from userspace, see ebpf_maps.

Generated by EDoc