summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorguy <guy>2007-12-29 23:25:28 +0000
committerguy <guy>2007-12-29 23:25:28 +0000
commit97bba47494d4c80bc35ed708b0632b80c92375bc (patch)
tree15ce069db5b7d6f942c8110226eb72b153785bdb
parent9fcb6369ed108c394aa1c4b82f0ac8576e38ce35 (diff)
downloadtcpdump-97bba47494d4c80bc35ed708b0632b80c92375bc.tar.gz
Handle version 2 of the AVS header.
-rw-r--r--print-802_11.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/print-802_11.c b/print-802_11.c
index 2712dcab..835d21bd 100644
--- a/print-802_11.c
+++ b/print-802_11.c
@@ -22,7 +22,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-802_11.c,v 1.47.2.1 2007-12-20 08:14:18 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-802_11.c,v 1.47.2.2 2007-12-29 23:25:28 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -1236,32 +1236,38 @@ ieee802_11_avs_radio_print(const u_char *p, u_int length, u_int caplen)
#define PRISM_HDR_LEN 144
+#define WLANCAP_MAGIC_COOKIE_BASE 0x80211000
#define WLANCAP_MAGIC_COOKIE_V1 0x80211001
+#define WLANCAP_MAGIC_COOKIE_V2 0x80211002
/*
* For DLT_PRISM_HEADER; like DLT_IEEE802_11, but with an extra header,
* containing information such as radio information, which we
* currently ignore.
*
- * If, however, the packet begins with WLANCAP_MAGIC_COOKIE_V1, it's
- * really DLT_IEEE802_11_RADIO (currently, on Linux, there's no
- * ARPHRD_ type for DLT_IEEE802_11_RADIO, as there is a
- * ARPHRD_IEEE80211_PRISM for DLT_PRISM_HEADER, so
- * ARPHRD_IEEE80211_PRISM is used for DLT_IEEE802_11_RADIO, and
- * the first 4 bytes of the header are used to indicate which it is).
+ * If, however, the packet begins with WLANCAP_MAGIC_COOKIE_V1 or
+ * WLANCAP_MAGIC_COOKIE_V2, it's really DLT_IEEE802_11_RADIO_AVS
+ * (currently, on Linux, there's no ARPHRD_ type for
+ * DLT_IEEE802_11_RADIO_AVS, as there is a ARPHRD_IEEE80211_PRISM
+ * for DLT_PRISM_HEADER, so ARPHRD_IEEE80211_PRISM is used for
+ * the AVS header, and the first 4 bytes of the header are used to
+ * indicate whether it's a Prism header or an AVS header).
*/
u_int
prism_if_print(const struct pcap_pkthdr *h, const u_char *p)
{
u_int caplen = h->caplen;
u_int length = h->len;
+ u_int32_t msgcode;
if (caplen < 4) {
printf("[|802.11]");
return caplen;
}
- if (EXTRACT_32BITS(p) == WLANCAP_MAGIC_COOKIE_V1)
+ msgcode = EXTRACT_32BITS(p);
+ if (msgcode == WLANCAP_MAGIC_COOKIE_V1 ||
+ msgcode == WLANCAP_MAGIC_COOKIE_V2)
return ieee802_11_avs_radio_print(p, length, caplen);
if (caplen < PRISM_HDR_LEN) {