rust-bpf
A Rust library for attaching Berkeley Packet Filter (BPF) programs to sockets on Linux systems.
Features
- Create and attach BPF filters to sockets
- Lock BPF filters to prevent further modifications
- Detach BPF filters when no longer needed
- Provides a convenient macro for creating BPF programs
- Trait-based API for easy integration with socket types
- Cross-platform compatibility (dummy implementation on non-Linux systems)
Usage
Add this to your Cargo.toml:
[]
= "0.1"
Basic Example
use ;
use UdpSocket;
License
ISC License
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.