1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-28 20:44:26 +01:00

Sniffer now differentiates between EthernetII and Dot3 when sniffing.

This commit is contained in:
Matias Fontanini
2013-04-23 22:55:32 -03:00
parent eb87b82c17
commit 5197e7f5f1
3 changed files with 16 additions and 4 deletions

View File

@@ -70,8 +70,12 @@ PtrPacket BaseSniffer::next_packet() {
// timestamp_ = header.ts;
if(content) {
try {
if(iface_type == DLT_EN10MB)
ret = new EthernetII((const uint8_t*)content, header.caplen);
if(iface_type == DLT_EN10MB) {
if(is_dot3((const uint8_t*)content, header.caplen))
ret = new Dot3((const uint8_t*)content, header.caplen);
else
ret = new EthernetII((const uint8_t*)content, header.caplen);
}
else if(iface_type == DLT_IEEE802_11_RADIO)
ret = new RadioTap((const uint8_t*)content, header.caplen);
else if(iface_type == DLT_IEEE802_11)