ChannelControls.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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() = 0;
  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. /**
  34. * Resets the state of the channel
  35. */
  36. virtual void reset() = 0;
  37. /**
  38. * Get file name of the file which is currently be sent or received.
  39. *
  40. * @return file name
  41. */
  42. virtual std::string getFileName() = 0;
  43. protected:
  44. /**
  45. * Time when the transfer was started with sendFile
  46. */
  47. std::time_t transferStart;
  48. /**
  49. * file name of the file wich is being sent or received
  50. */
  51. std::string fileName;
  52. };
  53. #endif