Queue.h 1019 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef QUEUE_H
  2. #define QUEUE_H
  3. #include <deque>
  4. #include <mutex>
  5. #include <string>
  6. #include "CovertChannel/ChannelControls.h"
  7. /**
  8. * Namespace wich manages the queue for the covert channel
  9. */
  10. namespace Queue {
  11. /**
  12. * Adds file to queue
  13. * @param file add file to queue
  14. */
  15. bool push(const std::string &file);
  16. /**
  17. * Remove file from queue. Checks if remove is allowed
  18. * @param file file to remove from queue
  19. */
  20. bool remove(const std::string &file);
  21. /**
  22. * Schedules one file to be transfered over the covert channel.
  23. * schedule() must be called again to send the next file.
  24. */
  25. void schedule();
  26. /**
  27. * The queue. Stores filenames. Acts as FIFO.
  28. */
  29. extern std::deque<std::string> queue;
  30. /**
  31. * Holds the name of the file of the current transfer. Empty otherwise.
  32. */
  33. extern std::string curTransfer;
  34. /**
  35. * Mutex to lock queue while editing it.
  36. */
  37. extern std::mutex mtx;
  38. /**
  39. * Covert channel which will be used to send files.
  40. */
  41. extern ChannelControls *channel;
  42. }; // namespace Queue
  43. #endif // QUEUE_H