-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Mark Bednarczyk edited this page Nov 11, 2024
·
2 revisions
Welcome to the JNetRuntime BPF Compiler module documentation. This module provides a flexible and extensible compilation framework for transforming network filter expressions into Berkeley Packet Filter (BPF) bytecode.
-
Multi-Dialect Support
- TCPDump/PCAP filter syntax
- Wireshark display filter expressions
- Napatech NTPL filter language
-
Standard BPF Compatibility
- Generates bytecode compatible with kernel BPF
- Works with JNetRuntime BPF VM
- Compatible with traditional BPF interpreters
-
High Performance
- Optimized compilation process
- Efficient bytecode generation
- Multiple optimization levels
The BPF Compiler module serves as a bridge between human-readable filter expressions and efficient machine-executable BPF bytecode. It enables:
-
Network Traffic Filtering
- Packet capture and analysis
- Network monitoring
- Protocol-specific filtering
-
Cross-Platform Compatibility
- Works on any Java-supported platform
- Kernel BPF integration when available
- Pure Java fallback with BPF VM
-
Tool Integration
- Compatible with existing network tools
- Support for industry-standard syntaxes
- Extensible for custom requirements
// Choose your preferred dialect
BpfCompiler compiler = BpfCompiler.forDialect(FilterDialect.PCAP);
// Compile a filter expression
byte[] bytecode = compiler.compile("tcp port 80");
// Use with JNetRuntime BPF VM
BPFProgram program = BPFProgram.load(bytecode);
boolean matches = program.execute(packet);
The compiler module works seamlessly with other JNetRuntime components:
[Filter Expression]
โ
[BPF Compiler Module]
โ
[BPF Bytecode]
โ
โโโโโโโดโโโโโโ
[BPF VM] [Kernel BPF]
Check out our API Documentation for detailed information about using the compiler.
Have questions? Join our Community Discussion!