Kbman99 / bpfjit-sys

Rust bindings to NetBSD's cBPF JIT engine

Home Page:https://crates.io/crates/bpfjit-sys

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bpfjit-sys

Rust bindings to NetBSD's cBPF JIT engine

Version: 1.1.0
Author: Alex Forster <alex@alexforster.com>
License: BSD-2-Clause

Build Status

Usage

use bpfjit_sys::BpfJit;

static PACKET: &'static [u8] = &[
	// 0xDE, 0xAD, 0xBE, 0xEF, ...
];

fn main() {
	let filter = BpfJit::new("udp dst port 123")?;
	
	if filter.matches(PACKET) {
		// ...
	}
}

Attributions

sljit

Copyright © Zoltan Herczeg <hzmester@freemail.hu>. All rights reserved.

Distributed under the 2-clause BSD license (BSD-2-Clause).

bpfjit

Copyright © Alexander Nasonov <alnsn@yandex.ru>. All rights reserved.

Distributed under the 2-clause BSD license (BSD-2-Clause).

About

Rust bindings to NetBSD's cBPF JIT engine

https://crates.io/crates/bpfjit-sys

License:BSD 2-Clause "Simplified" License


Languages

Language:C 99.2%Language:Rust 0.8%