summaryrefslogtreecommitdiff
path: root/pcapplusplus.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pcapplusplus.cpp')
-rw-r--r--pcapplusplus.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/pcapplusplus.cpp b/pcapplusplus.cpp
index d78a2eb..743e845 100644
--- a/pcapplusplus.cpp
+++ b/pcapplusplus.cpp
@@ -77,16 +77,26 @@ bool PcapPlusPlus::processPacket(pcpp::Packet & packet)
return false;
}
-pcpp::RawPacket &PcapPlusPlus::getRawPacket(size_t index)
+pcpp::RawPacket& PcapPlusPlus::getRawPacket(size_t index)
{
return rawPackets.at(index);
}
-pcpp::Packet &PcapPlusPlus::getParsedPacket(size_t index)
+pcpp::Packet& PcapPlusPlus::getParsedPacket(size_t index)
{
return parsedPackets.at(index);
}
+pcpp::LinkLayerType PcapPlusPlus::getLinkLayer()
+{
+ const auto& pcap_file_reader = dynamic_cast<pcpp::PcapFileReaderDevice*>(reader);
+
+ if (pcap_file_reader)
+ return pcap_file_reader->getLinkLayerType();
+ else
+ return pcpp::LinkLayerType::LINKTYPE_NULL;
+}
+
std::vector<pcpp::RawPacket>::iterator PcapPlusPlus::rawPacketsBegin()
{
return rawPackets.begin();