add test fo receive and sending packets

This commit is contained in:
stubbfel
2017-03-16 23:36:14 +01:00
parent 76e86f556a
commit 0facb2f57b
4 changed files with 179 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
#ifndef TINSNETWORKINTERFACECARD_H
#define TINSNETWORKINTERFACECARD_H
#include <atomic>
#include "TinsNetworkInterfaceCard_t.h"
#include "INetworkInterfaceCard_t.h"
#include "INetworkInterfaceCard.h"
@@ -24,17 +25,24 @@ public:
virtual void startListen() override;
virtual void stopListen() override;
Tins::SnifferConfiguration & getSnifferConfig() const;
SPtrIPacketHandlerList & getHandlerList();
bool isSniffRunning() const;
private:
Tins::PDU * getPhyLessPduPtr(IN Tins::PDU & pdu) const;
bool tinsSnifferCallback(IN Tins::PDU & some_pdu);
Tins::PDU * getPhyLessPduPtr(IN Tins::PDU & pdu) const;
void addPduToHashList(IN Tins::PDU &pdu);
bool searchAndRemoveHashListItem(IN const std::size_t removedHash);
UPtrSniffer sniffer;
UPtrSnifferConfiguration snifferConfig;
UPtrPacketSender packetSender;
static ByteVectorHash byteVectorHash;
UPtrHashList sendPduHashList;
UPtrMutex hashListMutex;
std::atomic<bool> isSnifferRunning;
SPtrIPacketHandlerList handlerList;
std::string sniffNetworkInterfaceName;
};
#endif