ForwardChannel.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. #endif