Summary
Add WiFi scanning to hostd on Linux using the pcap crate for raw 802.11 frame capture in monitor mode. This reuses the library's parse_wifi_frame() and filter_wifi_with_rules() — same pipeline as ESP32 firmware.
Context
Phase 1 of hostd (BLE scanning via btleplug) is implemented. This adds the WiFi half, Linux-only since monitor mode requires CAP_NET_RAW.
Implementation
- Add
pcap crate dependency (behind a wifi feature flag or #[cfg(target_os = "linux")])
- New
hostd/src/wifi_linux.rs module:
- Open monitor-mode interface via
pcap::Capture::from_device()
- Parse raw frames with
airhound::scanner::parse_wifi_frame()
- Convert to
WiFiEvent and send on existing scan channel
- Add
WifiEvent variant handling in filter_task (currently BLE-only)
- Channel hopping: either manage via netlink/
iw or document external setup
- Requires
CAP_NET_RAW + CAP_NET_ADMIN or root
Dependencies
pcap = "2" (libpcap FFI)
- System:
libpcap-dev on Debian/Ubuntu
Related
Summary
Add WiFi scanning to
hostdon Linux using thepcapcrate for raw 802.11 frame capture in monitor mode. This reuses the library'sparse_wifi_frame()andfilter_wifi_with_rules()— same pipeline as ESP32 firmware.Context
Phase 1 of hostd (BLE scanning via btleplug) is implemented. This adds the WiFi half, Linux-only since monitor mode requires
CAP_NET_RAW.Implementation
pcapcrate dependency (behind awififeature flag or#[cfg(target_os = "linux")])hostd/src/wifi_linux.rsmodule:pcap::Capture::from_device()airhound::scanner::parse_wifi_frame()WiFiEventand send on existing scan channelWifiEventvariant handling infilter_task(currently BLE-only)iwor document external setupCAP_NET_RAW+CAP_NET_ADMINor rootDependencies
pcap = "2"(libpcap FFI)libpcap-devon Debian/UbuntuRelated