|
Politician 1.0.0
WiFi Auditing Library for ESP32
|
Helper for writing HandshakeRecords and raw packets to a standard PCAPNG file. More...
#include <PoliticianStorage.h>
Public Member Functions | |
| PcapngFileLogger () | |
| ~PcapngFileLogger () | |
| bool | open (fs::FS &fs, const char *path) |
| Opens the PCAPNG file for streaming writes. | |
| bool | write (const HandshakeRecord &rec) |
| Writes a HandshakeRecord to the open file. | |
| bool | writePacket (const uint8_t *payload, uint16_t len, int8_t rssi, uint8_t channel, uint32_t ts_usec) |
| Writes a raw 802.11 sniffer frame to the open file. | |
| void | close () |
| Closes the underlying file handle. | |
| bool | isOpen () const |
| Returns true if the file is currently open for streaming. | |
Static Public Member Functions | |
| static bool | append (fs::FS &fs, const char *path, const HandshakeRecord &rec) |
| Appends a HandshakeRecord to a file as PCAPNG (opens and closes per call). | |
| static bool | appendPacket (fs::FS &fs, const char *path, const uint8_t *payload, uint16_t len, int8_t rssi, uint8_t channel, uint32_t ts_usec) |
| Appends a raw 802.11 sniffer frame to a PCAPNG file (opens and closes per call). | |
Helper for writing HandshakeRecords and raw packets to a standard PCAPNG file.
Two usage modes:
Definition at line 44 of file PoliticianStorage.h.
|
inline |
Definition at line 46 of file PoliticianStorage.h.
|
inline |
Definition at line 48 of file PoliticianStorage.h.
References close().
|
inlinestatic |
Appends a HandshakeRecord to a file as PCAPNG (opens and closes per call).
Prefer the streaming API (open/write/close) for continuous capture.
Definition at line 118 of file PoliticianStorage.h.
|
inlinestatic |
Appends a raw 802.11 sniffer frame to a PCAPNG file (opens and closes per call).
Prefer the streaming API (open/writePacket/close) for continuous capture.
Definition at line 127 of file PoliticianStorage.h.
References open(), and writePacket().
|
inline |
Closes the underlying file handle.
Safe to call multiple times.
Definition at line 105 of file PoliticianStorage.h.
Referenced by open(), and ~PcapngFileLogger().
|
inline |
Returns true if the file is currently open for streaming.
Definition at line 110 of file PoliticianStorage.h.
|
inline |
Opens the PCAPNG file for streaming writes.
Writes the global Section Header Block if the file is new or empty.
| fs | The filesystem (e.g., SD, LittleFS) |
| path | The file path (e.g., "/captures.pcapng") |
Definition at line 58 of file PoliticianStorage.h.
References close(), and politician::format::writePcapngGlobalHeader().
Referenced by append(), and appendPacket().
|
inline |
Writes a HandshakeRecord to the open file.
Definition at line 84 of file PoliticianStorage.h.
References politician::format::writePcapngRecord().
Referenced by append().
|
inline |
Writes a raw 802.11 sniffer frame to the open file.
Definition at line 96 of file PoliticianStorage.h.
References politician::format::writePcapngPacket().
Referenced by appendPacket().