Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anoushk1234/zig-ebpf
Zig virtual machine for eBPF programs.
https://github.com/anoushk1234/zig-ebpf
assembler bpf ebpf interpreter packet-filtering zig
Last synced: 23 days ago
JSON representation
Zig virtual machine for eBPF programs.
- Host: GitHub
- URL: https://github.com/anoushk1234/zig-ebpf
- Owner: anoushk1234
- License: apache-2.0
- Created: 2024-08-21T06:43:36.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-09-04T15:26:09.000Z (2 months ago)
- Last Synced: 2024-10-01T03:20:16.605Z (about 1 month ago)
- Topics: assembler, bpf, ebpf, interpreter, packet-filtering, zig
- Language: Zig
- Homepage:
- Size: 5.61 MB
- Stars: 24
- Watchers: 1
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# eBPF in Zig ⚡️
This is a wip implementation of eBPF in native Zig inspired by Quentin Monnet's [rbpf](https://github.com/qmonnet/rbpf/). This is different from existing zig eBPF libraries as it implements the ISA natively in zig without depending on libbpf or any C modules.
## What works
- [x] 64-bit ALU operations
- [x] Memory operations
- [x] Byteswap operations
- [x] Branch instructions (needs more testing)
- [x] Syscalls
- [ ] JIT Compiler
- [x] Assembler (needs more testing)
- [x] Disassembler
- [ ] Unit Tests & Fuzzing## Why
Short answer: I was boredLong answer: I wanted to work on something low level and complex, and also I really like Zig and wanted an excuse to write a large-ish project in it. I was inspired by Quentin Monnet and Solana Labs's work in rbpf and thought there should be a native Zig eBPF implementation. So I wanted to learn, experiment and have some fun in open source.
## Contribution and Feedback
The author of this repo is new to Zig so if you feel there can be some improvements in making the code more idiomatic then PRs are welcome!Following in the footsteps of rbpf, this project expects new commits to be coveryed by the [Developer's Ceritificate of Origin](https://wiki.linuxfoundation.org/dco).
## License
zig-ebpf is distributed under both MIT License and Apache License(Version 2.0).