Skip to content

Latest commit

 

History

History
40 lines (25 loc) · 840 Bytes

README.md

File metadata and controls

40 lines (25 loc) · 840 Bytes

bpfjit-sys

Rust bindings to NetBSD's cBPF JIT engine

Author: Alex Forster <[email protected]>
License: BSD-2-Clause

Build Status

Usage

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 <[email protected]>. All rights reserved.

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

bpfjit

Copyright © Alexander Nasonov <[email protected]>. All rights reserved.

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