Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexforster/bpfjit-sys
Rust bindings to NetBSD's cBPF JIT engine
https://github.com/alexforster/bpfjit-sys
bpf bpfjit cbpf jit libbpfjit pcap rust rust-lang rustlang
Last synced: 5 days ago
JSON representation
Rust bindings to NetBSD's cBPF JIT engine
- Host: GitHub
- URL: https://github.com/alexforster/bpfjit-sys
- Owner: alexforster
- License: bsd-2-clause
- Created: 2019-04-16T15:30:39.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-08-09T23:51:47.000Z (about 2 months ago)
- Last Synced: 2024-09-24T20:18:11.999Z (9 days ago)
- Topics: bpf, bpfjit, cbpf, jit, libbpfjit, pcap, rust, rust-lang, rustlang
- Language: C
- Homepage: https://crates.io/crates/bpfjit-sys
- Size: 459 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
# bpfjit-sys
Rust bindings to NetBSD's cBPF JIT engine
**Author:** Alex Forster \
**License:** BSD-2-Clause[![Build Status](https://travis-ci.org/alexforster/bpfjit-sys.svg?branch=master)](https://travis-ci.org/alexforster/bpfjit-sys)
### Usage
```rust
use bpfjit_sys::{BpfJit, Linktype};static PACKET: &'static [u8] = &[
// 0xDE, 0xAD, 0xBE, 0xEF, ...
];fn main() {
let filter = BpfJit::new("udp dst port 123", Linktype::Ethernet)?;
if filter.matches(PACKET) {
// ...
}
}
```### Attributions
#### `sljit`
Copyright © Zoltan Herczeg \. All rights reserved.
Distributed under the 2-clause BSD license (BSD-2-Clause).
#### `bpfjit`
Copyright © Alexander Nasonov \. All rights reserved.
Distributed under the 2-clause BSD license (BSD-2-Clause).