ForwardChannel.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef FORWARDCHANNEL_H
  2. #define FORWARDCHANNEL_H
  3. #include "CovertChannel.h"
  4. /**
  5. * @class ForwardChannel
  6. *
  7. * A CovertChannel which forwards the traffic it captures.
  8. */
  9. class ForwardChannel : public CovertChannel {
  10. public:
  11. /**
  12. * Sets up a CovertChannel.
  13. *
  14. * Creates a CovertChannel, sets the network interfaces for sniffing and sending and sets the filter.
  15. *
  16. * @param innerInterface name of the interface of the inner network
  17. * @param outerInterface name of the interface of the outer network
  18. * @param filter pcap filter string which will be set for the channel sniffers and negated for the forward sniffers
  19. */
  20. ForwardChannel(const std::string &innerInterface, const std::string &outerInterface);
  21. /**
  22. * Destroys the CovertChannel.
  23. */
  24. virtual ~ForwardChannel();
  25. /**
  26. * Get the progress
  27. *
  28. * @return progress counters
  29. */
  30. virtual std::pair<uint32_t, uint32_t> getProgress();
  31. protected:
  32. /**
  33. * Handler for sniffed packets filterd to forward from the outer network.
  34. *
  35. * Handles incoming packets and forwards them.
  36. *
  37. * @param pdu sniffed packet
  38. *
  39. * @return false = stop loop | true = continue loop
  40. */
  41. virtual bool handleChannelFromOuter(Tins::PDU &pdu);
  42. /**
  43. * Handler for sniffed packets filterd to forward from the inner network.
  44. *
  45. * Handles incoming packets and forwards them.
  46. *
  47. * @param pdu sniffed packet
  48. *
  49. * @return false = stop loop | true = continue loop
  50. */
  51. virtual bool handleChannelFromInner(Tins::PDU &pdu);
  52. };
  53. #endif