From 9a71f8aa86c623b197d8ae26c6fb8d38b297593a Mon Sep 17 00:00:00 2001 From: Seth Hall Date: Wed, 4 Feb 2015 23:33:20 -0500 Subject: [PATCH] Initial commit of RadioTap encapsulation support) - It works for me, but I believe that one of the headers I'm stripping is variable length so this is unlikely to be complete. --- src/iosource/PktSrc.cc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/iosource/PktSrc.cc b/src/iosource/PktSrc.cc index 527dadd393..cda5ae3f8b 100644 --- a/src/iosource/PktSrc.cc +++ b/src/iosource/PktSrc.cc @@ -171,6 +171,9 @@ int PktSrc::GetLinkHeaderSize(int link_type) case DLT_PPP_SERIAL: // PPP_SERIAL return 4; + case DLT_IEEE802_11_RADIO: // 802.11 plus RadioTap + return 59; + case DLT_RAW: return 0; } @@ -376,6 +379,26 @@ void PktSrc::Process() } break; } + + case DLT_IEEE802_11_RADIO: + { + protocol = (data[57] << 8) + data[58]; + if ( (data[54] == 0 && data[55] == 0 && data[56] == 0) && + (protocol == 0x0800 || protocol == 0x86DD) ) + { + // Found an IPv4 or IPv6 packet. + // Skip over the RadioTap header, the IEEE QoS header, + // and logical link control header. + data += GetLinkHeaderSize(props.link_type); + pkt_hdr_size = 0; + } + else + { + Weird("non_ip_packet_in_ieee802_11_radio_encapsulation", ¤t_packet); + goto done; + } + break; + } } if ( have_mpls )