Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kfl/ebpf-tools
Experiments with eBPF bytecode
https://github.com/kfl/ebpf-tools
ebpf hacktoberfest haskell
Last synced: about 14 hours ago
JSON representation
Experiments with eBPF bytecode
- Host: GitHub
- URL: https://github.com/kfl/ebpf-tools
- Owner: kfl
- License: mit
- Created: 2022-01-19T10:07:16.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-25T08:53:52.000Z (11 months ago)
- Last Synced: 2024-02-25T09:38:50.000Z (11 months ago)
- Topics: ebpf, hacktoberfest, haskell
- Language: Haskell
- Homepage:
- Size: 60.5 KB
- Stars: 3
- Watchers: 4
- Forks: 4
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
eBPF Tools
==========Framework for allowing easy experimentation with eBPF byte-code.
The project can be used both as a library for working with eBPF
byte-code, and it comes with a command-line program that can be as an
assembler and (eventually) a disassembler.Build instructions
------------------Build with:
$ cabal build
As a library
------------The project consists of a number of modules:
* [`Ebpf.Asm`](./src/Ebpf/Asm.hs) types for representing AST for eBPF programs.
* [`Ebpf.AsmParser`](./src/Ebpf/AsmParser.hs) parser for a textual format of eBPF bytecode.
* [`Ebpf.Decode`](./src/Ebpf/Decode.hs) reading bytecode into an AST (incomplete).
* [`Ebpf.Encode`](./src/Ebpf/Encode.hs) encoding the AST to bytecode.
* [`Ebpf.Helpers`](./src/Ebpf/Helpers.hs) helper functions for building AST.
* [`Ebpf.Display`](./src/Ebpf/Display.hs) for user-facing printing of the AST.Command-line executable
-----------------------```
$ cabal exec -- ebpf-tools --help
Usage: ebpf-tools ((-a|--assemble) | (-d|--disassemble) | --dump)
[-o|--output OUTFILE] INFILEAssembler and disassembler for eBPF bytecode
Available options:
-a,--assemble Parse asm file and write bytecode to output
-d,--disassemble Parse bytecode file and write assembly to output
--dump Parse asm file and print an AST
-o,--output OUTFILE Write output to OUTFILE (writes to stdout if not
given)
-h,--help Show this help text
```eBPF Resources
--------------See
*
* [Linux documentation for the eBPF instruction
set](https://www.kernel.org/doc/Documentation/networking/filter.txt)* [Instruction set
reference](https://github.com/iovisor/bpf-docs/blob/master/eBPF.md)* [ubpf: User-space eBPF VM](https://github.com/iovisor/ubpf/)