artifacts_tests.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /**
  2. * Class for performing artifacts tests.
  3. */
  4. #ifndef CPP_ARTIFACTS_TESTS_H
  5. #define CPP_ARTIFACTS_TESTS_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 "utilities.h"
  16. using namespace Tins;
  17. class artifacts_tests {
  18. public:
  19. /*
  20. * Class constructor
  21. */
  22. artifacts_tests();
  23. /*
  24. * Attributes
  25. */
  26. int correctChecksum;
  27. int incorrectChecksum;
  28. float checksumIncorrectRatio;
  29. int noPayloadCount;
  30. int payloadCount;
  31. //std::string timstampPrecision;
  32. //statistics stats;
  33. //std::string filePath;
  34. /*
  35. * Methods
  36. */
  37. void check_checksum(std::string ipAddressSender, std::string ipAddressReceiver, TCP tcpPkt);
  38. float get_checksum_incorrect_ratio();
  39. void check_payload(const PDU *pkt);
  40. float get_payload_ratio();
  41. void check_tos(uint8_t ToS);
  42. //bool check_timestamp_precision(const Packet &pkt);
  43. /*
  44. inline bool file_exists(const std::string &filePath);
  45. long double get_timestamp_mu_sec(const int after_packet_number);
  46. std::string merge_pcaps(const std::string pcap_path);
  47. void collect_statistics();
  48. void write_to_database(std::string database_path);
  49. */
  50. };
  51. #endif //CPP_ARTIFACTS_TESTS_H