Skip to content

Conversation

@jweyrich
Copy link
Owner

@jweyrich jweyrich commented Sep 28, 2025

Summary

Implements a complete BPF virtual machine and filter compiler.
Provides native and emulated BPF execution without using any library.
This PR addresses #5.

Features

  • Complete VM for BPF: Full instruction set (LD, LDX, ST, STX, ALU, JMP, RET, MISC) with bounds checking
  • tcpdump-style filters: Protocol (tcp, udp), host (host 1.1.1.1), port (port 80) with hostname resolution
  • Cross-platform: Native Linux/BSD BPF + software emulation fallback (-E flag)
  • Smart auto-enabling: BPF filters automatically enable corresponding display protocols

Breaking changes

  • Filtering: New mandatory tcpdump-style expression as positional argument: babysniff [OPTIONS] <expression>
  • Renamed options:
    • -f/--foreground became -b/--background and now does the opposite
    • -F/--filters became -d/--display-filters and only affect displaying, not filtering

@jweyrich jweyrich changed the title Add BPF support with tcpdump-style filtering Add BPF support with tcpdump-style filtering #5 Sep 28, 2025
@jweyrich jweyrich changed the title Add BPF support with tcpdump-style filtering #5 Add BPF support with tcpdump-style filtering Sep 28, 2025
@jweyrich jweyrich merged commit ab673ba into master Sep 28, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants