Politician 1.0.0
WiFi Auditing Library for ESP32
Loading...
Searching...
No Matches
politician::storage::PcapngFileLogger Class Reference

Helper for writing HandshakeRecords to a standard PCAPNG file. More...

#include <PoliticianStorage.h>

Static Public Member Functions

static bool append (fs::FS &fs, const char *path, const HandshakeRecord &rec)
 Appends a HandshakeRecord to a file as PCAPNG.
 
static bool appendPacket (fs::FS &fs, const char *path, const uint8_t *payload, uint16_t len, int8_t rssi, uint32_t ts_usec)
 Appends a raw 802.11 sniffer frame to a PCAPNG file (used for intel gathering).
 

Detailed Description

Helper for writing HandshakeRecords to a standard PCAPNG file.

Definition at line 15 of file PoliticianStorage.h.

Member Function Documentation

◆ append()

static bool politician::storage::PcapngFileLogger::append ( fs::FS &  fs,
const char *  path,
const HandshakeRecord rec 
)
inlinestatic

Appends a HandshakeRecord to a file as PCAPNG.

If the file is empty, it automatically writes the global PCAPNG Header Block first.

Parameters
fsThe filesystem (e.g., SD, LittleFS)
pathThe path to the file (e.g., "/captures.pcapng")
recThe HandshakeRecord to write
Returns
true if successful, false if file could not be opened

Definition at line 26 of file PoliticianStorage.h.

References politician::format::writePcapngGlobalHeader(), and politician::format::writePcapngRecord().

◆ appendPacket()

static bool politician::storage::PcapngFileLogger::appendPacket ( fs::FS &  fs,
const char *  path,
const uint8_t *  payload,
uint16_t  len,
int8_t  rssi,
uint32_t  ts_usec 
)
inlinestatic

Appends a raw 802.11 sniffer frame to a PCAPNG file (used for intel gathering).

Parameters
fsThe filesystem (e.g., SD, LittleFS)
pathThe path to the file (e.g., "/intel.pcapng")
payloadRaw packet data
lenPacket length
rssiSignal strength
ts_usecHardware microsecond timestamp
Returns
true if successful, false otherwise

Definition at line 66 of file PoliticianStorage.h.

References politician::format::writePcapngGlobalHeader(), and politician::format::writePcapngPacket().


The documentation for this class was generated from the following file: