4#ifndef PROTOCORE_PROMISC_H
5#define PROTOCORE_PROMISC_H
77 void (*set_channel)(uint8_t *, uint8_t);
78 void (*end)(uint8_t *);
PROTO_ENUM_PACKED
Application protocol spoken on a listener port or connection slot.
#define PROTOCORE_NS_LAYOUT(T,...)
Pin every dispatch slot of a table that is nothing but function pointers.
#define PROTOCORE_NS
Storage for a dispatch table. The const is load bearing.
enum PROTO_ENUM_PACKED WifiFrameType
802.11 frame type (frame-control bits 2-3).
proto_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(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.
PROTOCORE_NS PromiscNs Promisc PROTOCORE_UNUSED
Module namespace.
uint8_t * protocore_promisc_span(void)
The PROTOCORE_PROMISC_BORROW bytes this module's state lives in.
proto_bool protocore_promisc_wifi_frame_parse(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 .
void(* protocore_promisc_sink_fn)(const uint8_t *frame, uint16_t len, int8_t rssi, uint8_t channel)
Sink for one captured frame: the raw 802.11 bytes plus radio metadata.
Dispatch table. Addressed by offset, so the layout is asserted below.
proto_bool(* wifi_frame_parse)(uint8_t *, const uint8_t *, uint16_t, WifiFrameInfo *)
Decoded 802.11 MAC header. src / dst / bssid point into the frame (6 bytes) or null.
const uint8_t * src
source (transmitter) MAC
uint16_t hdr_len
MAC header length (bytes)
uint16_t seq
12-bit sequence number
const uint8_t * dst
destination (receiver) MAC, per the to/from-DS layout
proto_bool is_qos
QoS data subtype (adds 2 header bytes)
const uint8_t * bssid
BSSID (null for a WDS 4-address frame)
proto_bool protected_frame
the Protected-Frame (WEP/CCMP) bit
WifiFrameType type
WifiFrameType.
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTOCORE_END_DECLS