Wi-Fi promiscuous (monitor) capture (PROTOCORE_ENABLE_PROMISC) - passive 802.11 sniffing.
More...
|
| | EMBED_ENUM_BYTE (WifiFrameType, WIFI_FT_MGMT=0, WIFI_FT_CTRL=1, WIFI_FT_DATA=2, WIFI_FT_EXT=3,) |
| | 802.11 frame type (frame-control bits 2-3).
|
| | PROTOCORE_NS_LAYOUT (PromiscNs, wifi_frame_parse, begin, set_channel, end) |
| embed_bool | protocore_promisc_wifi_frame_parse (const uint8_t *work, const uint8_t *frame, uint16_t len, WifiFrameInfo *out) |
| | Parse an 802.11 MAC header (IEEE 802.11 §9.2 / §9.3.2, the .
|
| embed_bool | protocore_promisc_begin (uint8_t *work, uint8_t channel, protocore_promisc_sink_fn sink) |
| | Start promiscuous capture on channel; every frame is delivered to .
|
| void | protocore_promisc_set_channel (const uint8_t *work, uint8_t channel) |
| | Retune the capture to a different channel (1..14).
|
| void | protocore_promisc_end (uint8_t *work) |
| | Stop promiscuous capture.
|
| uint8_t * | protocore_promisc_span (void) |
| | The PROTOCORE_PROMISC_BORROW bytes this module's state lives in.
|
Wi-Fi promiscuous (monitor) capture (PROTOCORE_ENABLE_PROMISC) - passive 802.11 sniffing.
A read-only capture path: instead of joining a network and terminating traffic, listen to every 802.11 frame on a channel and hand it to a sink. The canonical wiring feeds the sink into the forwarding plane (network_drivers/network/forward), so captured Wi-Fi frames are bridged to another interface (e.g. Ethernet) for a wired collector - "capture on Wi-Fi, forward to Ethernet".
Two host-testable pieces plus the ESP32 radio binding:
- wifi_frame_parse(): decode the 802.11 MAC header (type/subtype, the to/from-DS address layout -> src / dst / bssid, sequence number, header length). Pure.
- pcap_* : build the classic libpcap global + per-record headers (DLT_IEEE802_11) so a forwarded frame is a valid PCAP stream a wired Wireshark / tcpdump can read. Pure.
- protocore_promisc_begin() / _set_channel() / _end(): monitor-mode bring-up whose rx callback copies each frame (with RSSI + channel) to the registered sink. ESP32 only.
Capture is strictly passive (no injection) and fail-closed: the sink is expected to drop, not block, when its downstream is full, so the live data path is never stalled.
work is PROTOCORE_PROMISC_BORROW bytes the CALLER took, at an address it knows. It is not held past the call, so nothing here aliases it. How those bytes are carved is this module's and is never named here.
- Author
- Douglas Quigg (dstroy0)
- Date
- 2026
Definition in file promisc.h.