pcap_processor.h 996 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /**
  2. * Class for processing PCAPs to collect statistical data.
  3. */
  4. #ifndef CPP_PCAPREADER_MAIN_H
  5. #define CPP_PCAPREADER_MAIN_H
  6. <<<<<<< HEAD
  7. =======
  8. >>>>>>> 48c729f6dbfeb1e2670c762729090a48d5f0b490
  9. #include <iomanip>
  10. #include <tins/tins.h>
  11. #include <iostream>
  12. #include <time.h>
  13. #include <stdio.h>
  14. #include <sys/stat.h>
  15. #include <unordered_map>
  16. #include "statistics.h"
  17. using namespace Tins;
  18. class pcap_processor {
  19. public:
  20. /*
  21. * Class constructor
  22. */
  23. pcap_processor(std::string path, std::string extraTests);
  24. /*
  25. * Attributes
  26. */
  27. statistics stats;
  28. std::string filePath;
  29. /*
  30. * Methods
  31. */
  32. inline bool file_exists(const std::string &filePath);
  33. void process_packets(const Packet &pkt);
  34. long double get_timestamp_mu_sec(const int after_packet_number);
  35. std::string merge_pcaps(const std::string pcap_path);
  36. void collect_statistics();
  37. void write_to_database(std::string database_path);
  38. };
  39. #endif //CPP_PCAPREADER_MAIN_H