build(deps): bump github/codeql-action from 3.24.10 to 3.25.1 (#430)

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.10 to 3.25.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/4355270be187e1b672a7a1c7c7bae5afdc1ab94a...c7f9125735019aa87cfc361530512d50ea439c71)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 files changed
tree: eeaf27eb001c0e9fcf79343227c6dfe8e53443b8
  1. .github/
  2. aarch64_test/
  3. bin/
  4. bpf/
  5. cmake/
  6. compat/
  7. docs/
  8. external/
  9. scripts/
  10. test_framework/
  11. tests/
  12. ubpf/
  13. ubpf_plugin/
  14. vm/
  15. .clang-format
  16. .editorconfig
  17. .gitignore
  18. .gitmodules
  19. .travis.yml
  20. CMakeLists.txt
  21. Doxyfile
  22. LICENSE.txt
  23. mainpage.dox
  24. README.md
  25. requirements.txt
README.md

uBPF

Userspace eBPF VM

Main 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

API Documentation

This project includes an eBPF assembler, disassembler, interpreter (for all platforms), and JIT compiler (for x86-64 and Arm64 targets).

Checking Out

Before following any of the instructions below for building, testing, contributing, etc, please be sure to properly check out the source code which requires properly initializing submodules:

git submodule update --init --recursive

Preparing system for build

In order to prepare your system to successfully generate the build system using CMake, follow the platform-specific instructions below.

Windows

Building, compiling and testing on Windows requires an installation of Visual Studio (not VS Code -- the MSVC compiler is necessary!).

Note: There are free-to-use versions of Visual Studio for individual developers. These versions are known as the community version.

You can build, compile and test uBPF using VS Code but Visual Studio is still required.

The other requirement is that you have nuget.exe in your PATH. You can determine if your host meets this criteria by testing whether

> nuget.exe

produces output about how to execute the program. With nuget.exe installed, the cmake configuration system will download all the required developer libraries as it configures the build system.

macOS

First, make sure that you have the XCode Command Line Tools installed:

$ xcode-select --install

Installing the XCode Command Linux Tools will install Apple's version of the Clang compiler and other developer-support tools.

uBpf requires that your host have several support libraries installed. The easiest way to configure your host to meet these requirements,

  1. Install homebrew
  2. Install boost:
$ brew install boost
  1. Install LLVM (and related tools):
$ brew install llvm cmake
$ brew install clang-format

Installing LLVM from Homebrew is optional for developing and using uBPF on macOS. It is required if you plan on compiling/creating eBPF programs by compiling LLVM and storing them in ELF files. If you do install LLVM from Homebrew, add -DUBPF_ALTERNATE_LLVM_PATH=/opt/homebrew/opt/llvm/bin to the cmake configuration command:

cmake -S . -B build -DUBPF_ENABLE_TESTS=true -DUBPF_ALTERNATE_LLVM_PATH=/opt/homebrew/opt/llvm/bin

Linux

./scripts/build-libbpf.sh

Building with CMake

A build system for compiling and testing ubpf is generated for Windows, Linux and macOS platforms using cmake:

cmake -S . -B build -DUBPF_ENABLE_TESTS=true
cmake --build build --config Debug

Running the tests

Linux and MacOS

cmake --build build --target test --

Windows

ctest --test-dir build

Contributing

We love contributions!

Preparing Code Contributions

We aim to maintain code coverage with every code change. The CI/CD pipeline will verify this invariant as part of the contribution process. However, you can calculate code coverage locally by

coveralls --gcov-options '\-lp' -i $PWD/vm/ubpf_vm.c -i $PWD/vm/ubpf_jit_x86_64.c -i $PWD/vm/ubpf_loader.c

We also aim to maintain a consistent code format. The pre-commit git hooks configured for the uBPF repository will guarantee that code changes match the format we expect. In order for those hooks to work effectively, you must have clang-format installed and available on your system.

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.

License

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