ChannelControls.h 895 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef CHANNELCONTROLS_H
  2. #define CHANNELCONTROLS_H
  3. #include <ctime>
  4. #include <string>
  5. #include <utility>
  6. class ChannelControls {
  7. public:
  8. /**
  9. * Send a file over the covert channel.
  10. *
  11. * @param fileName name of the file in the file directory
  12. * @return true - file will be sent | false - file was not accepted
  13. */
  14. virtual bool sendFile(const std::string &fileName) = 0;
  15. /**
  16. * Get the progress
  17. *
  18. * @return progress counters
  19. */
  20. virtual std::pair<uint32_t, uint32_t> getProgress() = 0;
  21. /**
  22. * Get the transfer start time
  23. *
  24. * @return start time of the transfer
  25. */
  26. virtual std::time_t getTransferStart();
  27. /**
  28. * Test if a transfer is running
  29. *
  30. * @return true - a transfer runs | false - no transfer runs
  31. */
  32. virtual bool isTransferRunning() = 0;
  33. protected:
  34. /**
  35. * Time when the transfer was started with sendFile
  36. */
  37. std::time_t transferStart;
  38. };
  39. #endif