Skip to content

hostd: WiFi scanning via CoreWLAN (macOS) #106

@dougborg

Description

@dougborg

Summary

Add WiFi scanning to hostd on macOS using CoreWLAN bindings. macOS cannot do monitor mode without kext hacks, but CWInterface.scanForNetworks returns BSSID, SSID, RSSI, and channel — enough for most WiFi signatures.

Context

Phase 1 of hostd (BLE scanning) is implemented. This adds macOS WiFi scanning as a complement to the Linux pcap approach (#102).

Implementation

  • New hostd/src/wifi_macos.rs module (#[cfg(target_os = "macos")])
  • Use objc2 / objc2-core-wlan bindings to call CWInterface.scanForNetworks(withSSID:includeHidden:)
  • Map scan results to WiFiEvent with FrameType::Beacon (no raw frame subtypes available)
  • Periodic polling (e.g., every 2s) since CoreWLAN doesn't stream
  • Location Services permission required on macOS 14+

Known Limitations

  • No raw 802.11 frames — only beacon-equivalent data (SSID, BSSID, RSSI, channel)
  • Cannot capture probe requests, deauths, or other management frames
  • wifi_frame_content signatures won't fire
  • Requires Location Services authorization

Dependencies

  • objc2 + objc2-core-wlan (or core-foundation + raw ObjC FFI)

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthostdHost daemon (Mac/Linux)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions