ForwardChannel.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. protected:
  26. /**
  27. * Handler for sniffed packets filterd to forward from the outer network.
  28. *
  29. * Handles incoming packets and forwards them.
  30. *
  31. * @param pdu sniffed packet
  32. *
  33. * @return false = stop loop | true = continue loop
  34. */
  35. virtual bool handleChannelFromOuter(Tins::PDU &pdu);
  36. /**
  37. * Handler for sniffed packets filterd to forward from the inner network.
  38. *
  39. * Handles incoming packets and forwards them.
  40. *
  41. * @param pdu sniffed packet
  42. *
  43. * @return false = stop loop | true = continue loop
  44. */
  45. virtual bool handleChannelFromInner(Tins::PDU &pdu);
  46. /**
  47. * Handler for sniffed packets filterd to use as channel from the outer network.
  48. *
  49. * Handles incoming packets and redirets them.
  50. *
  51. * @param pdu sniffed packet
  52. *
  53. * @return false = stop loop | true = continue loop
  54. */
  55. virtual bool handlePartnerFromOuter(Tins::PDU &pdu);
  56. };
  57. #endif