|
@@ -1,7 +1,6 @@
|
|
|
#include "../../include/CovertChannel/CovertChannel.h"
|
|
|
#include <cstdlib>
|
|
|
#include <iostream>
|
|
|
-#include <thread>
|
|
|
|
|
|
CovertChannel::CovertChannel(const std::string &innerInterface, const std::string &outerInterface, const std::string &innerForwardFilter,
|
|
|
const std::string &outerForwardFilter, const std::string &innerChannelFilter, const std::string &outerChannelFilter)
|
|
@@ -30,6 +29,10 @@ CovertChannel::~CovertChannel() {
|
|
|
outerForwardSniffer->stop_sniff();
|
|
|
innerChannelSniffer->stop_sniff();
|
|
|
outerChannelSniffer->stop_sniff();
|
|
|
+ innerForwardSnifferThread.join();
|
|
|
+ outerForwardSnifferThread.join();
|
|
|
+ innerChannelSnifferThread.join();
|
|
|
+ outerChannelSnifferThread.join();
|
|
|
delete (innerForwardSniffer);
|
|
|
delete (outerForwardSniffer);
|
|
|
delete (innerChannelSniffer);
|
|
@@ -45,15 +48,10 @@ void CovertChannel::setFilter(const std::string &innerForwardFilter, const std::
|
|
|
}
|
|
|
|
|
|
void CovertChannel::startSniffing() {
|
|
|
- std::thread innerForwardSnifferThread(&CovertChannel::startInnerForwardSniffing, this);
|
|
|
- std::thread outerForwardSnifferThread(&CovertChannel::startOuterForwardSniffing, this);
|
|
|
- std::thread innerChannelSnifferThread(&CovertChannel::startInnerChannelSniffing, this);
|
|
|
- std::thread outerChannelSnifferThread(&CovertChannel::startOuterChannelSniffing, this);
|
|
|
-
|
|
|
- innerForwardSnifferThread.detach();
|
|
|
- outerForwardSnifferThread.detach();
|
|
|
- innerChannelSnifferThread.detach();
|
|
|
- outerChannelSnifferThread.detach();
|
|
|
+ innerForwardSnifferThread = std::thread(&CovertChannel::startInnerForwardSniffing, this);
|
|
|
+ outerForwardSnifferThread = std::thread(&CovertChannel::startOuterForwardSniffing, this);
|
|
|
+ innerChannelSnifferThread = std::thread(&CovertChannel::startInnerChannelSniffing, this);
|
|
|
+ outerChannelSnifferThread = std::thread(&CovertChannel::startOuterChannelSniffing, this);
|
|
|
}
|
|
|
|
|
|
void CovertChannel::startInnerForwardSniffing() { innerForwardSniffer->sniff_loop(make_sniffer_handler(this, &CovertChannel::handleForwardFromInner)); }
|