Skip to content
Userspace eBPF VM
Branch: master
Clone or download
#32 Compare This branch is 21 commits ahead of rlane:master.
sbates130272 and pchaigno vm/Makefile: Add an install target
In order to use the ubpf static library in other applications it is
useful to have a "make install" target. We place the relevent files
(libubpf.a and ubpf.h) into the $(DESTDIR)/$(PREFIX) tree at the right
spots to allow other programs to reference them.

Signed-off-by: Stephen Bates <sbates@raithlin.com>
Latest commit 644ad3d Feb 12, 2019

README.md

uBPF

Userspace eBPF VM

Build Status Coverage Status

About

This project aims to create an Apache-licensed library for executing eBPF programs. The primary implementation of eBPF lives in the Linux kernel, but due to its GPL license it can't be used in many projects.

Linux documentation for the eBPF instruction set

Instruction set reference

This project includes an eBPF assembler, disassembler, interpreter, and JIT compiler for x86-64.

Building

Run make -C vm to build the VM. This produces a static library libubpf.a and a simple executable used by the testsuite. After building the library you can install using make -C vm install via either root or sudo.

Compiling C to eBPF

You'll need Clang 3.7.

clang-3.7 -O2 -target bpf -c prog.c -o prog.o

You can then pass the contents of prog.o to ubpf_load_elf, or to the stdin of the vm/test binary.

Contributing

Please fork the project on GitHub and open a pull request. You can run all the tests with nosetests.

License

Copyright 2015, Big Switch Networks, Inc. Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0>.

You can’t perform that action at this time.