1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Add FileSniffer constructor with FILE pointer as pcap source (#499)

This commit is contained in:
Tobias Specht
2023-04-30 18:44:49 +02:00
committed by GitHub
parent df509e7e36
commit ba0c820852
2 changed files with 48 additions and 2 deletions

View File

@@ -406,10 +406,17 @@ private:
*/
class TINS_API FileSniffer : public BaseSniffer {
public:
/**
* \brief Constructs an instance of FileSniffer.
* \param fp The pcap file which will be parsed.
* \param configuration A SnifferConfiguration to be used on the file.
*/
FileSniffer(FILE *fp, const SnifferConfiguration& configuration);
/**
* \brief Constructs an instance of FileSniffer.
* \param file_name The pcap file which will be parsed.
* \param filter A capture filter to be used on the file.(optional);
* \param configuration A SnifferConfiguration to be used on the file.
*/
FileSniffer(const std::string& file_name, const SnifferConfiguration& configuration);
@@ -418,9 +425,18 @@ public:
*
* \brief Constructs an instance of FileSniffer.
* \param file_name The pcap file which will be parsed.
* \param filter A capture filter to be used on the file.(optional);
* \param filter A capture filter to be used on the file. (optional)
*/
FileSniffer(const std::string& file_name, const std::string& filter = "");
/**
* \deprecated Use the constructor that takes a SnifferConfiguration instead.
*
* \brief Constructs an instance of FileSniffer.
* \param fp The pcap file which will be parsed.
* \param filter A capture filter to be used on the file. (optional)
*/
FileSniffer(FILE *fp, const std::string& filter = "");
};
template <typename T>