bpfjit-sys

Crates.iobpfjit-sys
lib.rsbpfjit-sys
version2.1.0
sourcesrc
created_at2019-04-16 19:55:48.806927
updated_at2021-11-01 16:36:47.70433
descriptionRust bindings to NetBSD's cBPF JIT engine
homepagehttps://github.com/alexforster/bpfjit-sys
repositoryhttps://github.com/alexforster/bpfjit-sys
max_upload_size
id128449
size1,172,649
Alex Forster (alexforster)

documentation

README

bpfjit-sys

Rust bindings to NetBSD's cBPF JIT engine

Version: 2.0.0
Author: Alex Forster <alex@alexforster.com>
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 <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).

Commit count: 18

cargo fmt