Layer: Foundation · Build flags: PROTOCORE_ENABLE_PROMISC, PROTOCORE_ENABLE_FORWARD, PROTOCORE_ENABLE_ETHERNET, ETH_PHY_*
A wireless tap: put the radio in promiscuous (monitor) mode and forward every captured frame out the wired interface to a collector - "capture on Wi-Fi, forward to Ethernet". It wires three existing pieces together:
On the collector, receive the UDP datagrams, prepend one protocore_pcap_global_header(..., PROTOCORE_DLT_IEEE802_11), and you have a .pcap Wireshark opens directly as 802.11.
Forward only what you want with the plane's ingress ACL (protocore_forward_acl_add()) - e.g. match on the frame-control byte to forward management frames only, or deny a specific BSSID. The pure wifi_frame_parse() helper decodes the 802.11 header (type/subtype, the to/from-DS src/dst/bssid layout, sequence number) if you want to filter or annotate in your sink. Both the parser and the PCAP framing are host-tested (pio test -e native_promisc); the radio is ESP32-only.
This example calls protocore_forward_ingress() directly in the capture callback for clarity. On a busy channel, copy the frame and post it to the FORWARD lane of the preempting queue (PROTOCORE_ENABLE_PREEMPT_QUEUE) instead, so the radio callback stays light and the plane drains on a dedicated task - the same pattern the DMA ingest path uses.
In the Arduino IDE the build_opt.h beside this sketch sets the flags for you. Needs an ESP32 with an Ethernet PHY to run.