pcap_processor.h 984 B

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