1 #ifndef PCAPPP_FILE_DEVICE 2 #define PCAPPP_FILE_DEVICE 10 typedef struct pcap_dumper pcap_dumper_t;
28 std::string m_FileName;
58 uint32_t m_NumOfPacketsRead;
59 uint32_t m_NumOfPacketsNotParsed;
78 uint64_t getFileSize()
const;
80 virtual bool getNextPacket(
RawPacket& rawPacket) = 0;
89 int getNextPackets(
RawPacketVector& packetVec,
int numOfPacketsToRead = -1);
141 bool getNextPacket(
RawPacket& rawPacket);
169 uint64_t identification_pattern;
170 uint32_t version_number;
171 uint32_t datalink_type;
172 } snoop_file_header_t;
178 uint32_t original_length;
179 uint32_t included_length;
180 uint32_t packet_record_length;
181 uint32_t ndrops_cumulative;
184 } snoop_packet_header_t;
188 std::ifstream m_snoopFile;
221 bool getNextPacket(
RawPacket& rawPacket);
276 std::string getOS()
const;
284 std::string getHardware()
const;
292 std::string getCaptureApplication()
const;
300 std::string getCaptureFileComment()
const;
310 bool getNextPacket(
RawPacket& rawPacket, std::string& packetComment);
320 bool getNextPacket(
RawPacket& rawPacket);
340 bool setFilter(std::string filterAsString);
356 uint32_t m_NumOfPacketsWritten;
357 uint32_t m_NumOfPacketsNotWritten;
368 virtual bool writePacket(
RawPacket const& packet) = 0;
373 virtual bool open(
bool appendMode) = 0;
386 pcap_dumper_t* m_PcapDumpHandler;
419 bool writePacket(
RawPacket const& packet);
450 bool open(
bool appendMode);
455 virtual void close();
481 int m_CompressionLevel;
518 bool open(
const std::string& os,
const std::string& hardware,
const std::string& captureApp,
const std::string& fileComment);
528 bool writePacket(
RawPacket const& packet,
const std::string& comment);
538 bool writePacket(
RawPacket const& packet);
566 bool open(
bool appendMode);
589 bool setFilter(std::string filterAsString);
The main namespace for the PcapPlusPlus lib.
Definition: PcapFileDevice.h:25
Definition: RawPacket.h:30
Definition: PcapFileDevice.h:55
std::string getFileName() const
Definition: PcapFileDevice.h:161
Definition: PcapFileDevice.h:247
Definition: PcapDevice.h:27
virtual ~PcapFileReaderDevice()
Definition: PcapFileDevice.h:125
Definition: PointerVector.h:24
virtual ~IFileReaderDevice()
Definition: PcapFileDevice.h:73
Definition: RawPacket.h:252
virtual ~IFileWriterDevice()
Definition: PcapFileDevice.h:366
Definition: PcapFileDevice.h:477
Definition: PcapFileDevice.h:383
Definition: PcapFilter.h:77
SnoopFileReaderDevice(const std::string &fileName)
Definition: PcapFileDevice.h:200
~PcapFileWriterDevice()
Definition: PcapFileDevice.h:409
Definition: PcapFileDevice.h:105
LinkLayerType
Definition: RawPacket.h:25
PcapFileReaderDevice(const std::string &fileName)
Definition: PcapFileDevice.h:120
virtual void getStatistics(PcapStats &stats) const =0
LinkLayerType getLinkLayerType() const
Definition: PcapFileDevice.h:130
virtual ~PcapNgFileWriterDevice()
Definition: PcapFileDevice.h:501
virtual bool setFilter(std::string filterAsString)
LinkLayerType getLinkLayerType() const
Definition: PcapFileDevice.h:210
Definition: PcapFileDevice.h:353
virtual ~PcapNgFileReaderDevice()
Definition: PcapFileDevice.h:268
Definition: PcapDevice.h:41