getPhyLessPduPtr -> skip ethernet pdus
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
#include "TinsNetworkInterfaceCard.h"
|
||||
#include <functional>
|
||||
#include <mutex>
|
||||
#include <tins/packet_sender.h>
|
||||
#include <tins/ethernetII.h>
|
||||
#include <tins/network_interface.h>
|
||||
#include <tins/packet_sender.h>
|
||||
#include <tins/sniffer.h>
|
||||
|
||||
ByteVectorHash TinsNetworkInterfaceCard::byteVectorHash;
|
||||
@@ -48,7 +49,7 @@ TinsNetworkInterfaceCard::~TinsNetworkInterfaceCard()
|
||||
|
||||
bool TinsNetworkInterfaceCard::handle(const Tins::PDU &pdu, IPacketHandler *callBackHandler)
|
||||
{
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
void TinsNetworkInterfaceCard::sendPacket(const Tins::PDU &pdu)
|
||||
@@ -104,7 +105,13 @@ void TinsNetworkInterfaceCard::stopListen()
|
||||
|
||||
}
|
||||
|
||||
Tins::PDU * TinsNetworkInterfaceCard::getPhyLessPduPtr(IN const Tins::PDU & pdu) const
|
||||
Tins::PDU * TinsNetworkInterfaceCard::getPhyLessPduPtr(IN Tins::PDU & pdu) const
|
||||
{
|
||||
return pdu.inner_pdu();
|
||||
const Tins::EthernetII * ethPdu = pdu.find_pdu<Tins::EthernetII>();
|
||||
if (ethPdu == nullptr)
|
||||
{
|
||||
return &pdu;
|
||||
}
|
||||
|
||||
return getPhyLessPduPtr(*(ethPdu->inner_pdu()));
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
Tins::PDU * getPhyLessPduPtr(IN const Tins::PDU & pdu) const;
|
||||
Tins::PDU * getPhyLessPduPtr(IN Tins::PDU & pdu) const;
|
||||
void addPduToHashList(IN Tins::PDU &pdu);
|
||||
bool searchAndRemoveHashListItem(IN const std::size_t removedHash);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user