Bpfjit
BPF JIT from FreeBSD
Install / Use
/learn @polachok/BpfjitREADME
BPF JIT
BPF to amd64 JIT compiler for rust extracted from FreeBSD 10 tree.
Example usage
extern crate bpfjit;
extern crate pcap;
use std::mem;
fn main() {
let pcap = pcap::Capture::dead(pcap::Linktype(12 /* raw ip */)).unwrap();
let bpf_prog = pcap.compile("tcp and dst port 80").unwrap();
let insns = bpf_prog.get_instructions();
let filter = bpfjit::BpfJitFilter::compile(unsafe {
mem::transmute(insns)
}).unwrap();
let data = [1,2,3,4];
if filter.matched(&data[..]) {
// ...
}
}
Related Skills
node-connect
349.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
