1 #ifndef PCAPPP_FILE_DEVICE 2 #define PCAPPP_FILE_DEVICE 10 typedef struct pcap_dumper pcap_dumper_t;
28 std::string m_FileName;
57 uint32_t m_NumOfPacketsRead;
58 uint32_t m_NumOfPacketsNotParsed;
77 uint64_t getFileSize()
const;
79 virtual bool getNextPacket(
RawPacket& rawPacket) = 0;
88 int getNextPackets(
RawPacketVector& packetVec,
int numOfPacketsToRead = -1);
140 bool getNextPacket(
RawPacket& rawPacket);
168 uint64_t identification_pattern;
169 uint32_t version_number;
170 uint32_t datalink_type;
171 } snoop_file_header_t;
177 uint32_t original_length;
178 uint32_t included_length;
179 uint32_t packet_record_length;
180 uint32_t ndrops_cumulative;
183 } snoop_packet_header_t;
187 std::ifstream m_snoopFile;
220 bool getNextPacket(
RawPacket& rawPacket);
275 std::string getOS()
const;
283 std::string getHardware()
const;
291 std::string getCaptureApplication()
const;
299 std::string getCaptureFileComment()
const;
309 bool getNextPacket(
RawPacket& rawPacket, std::string& packetComment);
319 bool getNextPacket(
RawPacket& rawPacket);
339 bool setFilter(std::string filterAsString);
355 uint32_t m_NumOfPacketsWritten;
356 uint32_t m_NumOfPacketsNotWritten;
367 virtual bool writePacket(
RawPacket const& packet) = 0;
372 virtual bool open(
bool appendMode) = 0;
385 pcap_dumper_t* m_PcapDumpHandler;
418 bool writePacket(
RawPacket const& packet);
449 bool open(
bool appendMode);
454 virtual void close();
480 int m_CompressionLevel;
517 bool open(
const std::string& os,
const std::string& hardware,
const std::string& captureApp,
const std::string& fileComment);
527 bool writePacket(
RawPacket const& packet,
const std::string& comment);
537 bool writePacket(
RawPacket const& packet);
565 bool open(
bool appendMode);
588 bool setFilter(std::string filterAsString);
The main namespace for the PcapPlusPlus lib.
Definition: PcapFileDevice.h:25
Definition: RawPacket.h:30
Definition: PcapFileDevice.h:54
std::string getFileName() const
Definition: PcapFileDevice.h:160
Definition: PcapFileDevice.h:246
Definition: PcapDevice.h:27
virtual ~PcapFileReaderDevice()
Definition: PcapFileDevice.h:124
Definition: PointerVector.h:24
virtual ~IFileReaderDevice()
Definition: PcapFileDevice.h:72
Definition: RawPacket.h:254
virtual ~IFileWriterDevice()
Definition: PcapFileDevice.h:365
Definition: PcapFileDevice.h:476
Definition: PcapFileDevice.h:382
Definition: PcapFilter.h:77
SnoopFileReaderDevice(const std::string &fileName)
Definition: PcapFileDevice.h:199
~PcapFileWriterDevice()
Definition: PcapFileDevice.h:408
Definition: PcapFileDevice.h:104
LinkLayerType
Definition: RawPacket.h:25
PcapFileReaderDevice(const std::string &fileName)
Definition: PcapFileDevice.h:119
virtual void getStatistics(PcapStats &stats) const =0
LinkLayerType getLinkLayerType() const
Definition: PcapFileDevice.h:129
virtual ~PcapNgFileWriterDevice()
Definition: PcapFileDevice.h:500
virtual bool setFilter(std::string filterAsString)
LinkLayerType getLinkLayerType() const
Definition: PcapFileDevice.h:209
Definition: PcapFileDevice.h:352
virtual ~PcapNgFileReaderDevice()
Definition: PcapFileDevice.h:267
Definition: PcapDevice.h:41