From: guy Date: Thu, 20 Dec 2007 08:13:35 +0000 (+0000) Subject: Support DLT_IEEE802_11_RADIO_AVS. X-Git-Tag: tcpdump-4.1.0~205 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/efb80785aa98567c48553f9134781b0d6e02a16a Support DLT_IEEE802_11_RADIO_AVS. Update a comment (we now parse the radiotap header). --- diff --git a/interface.h b/interface.h index 52264e16..ff43534f 100644 --- a/interface.h +++ b/interface.h @@ -18,7 +18,7 @@ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.281 2007-12-09 00:30:47 guy Exp $ (LBL) + * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.282 2007-12-20 08:13:35 guy Exp $ (LBL) */ #ifndef tcpdump_interface_h @@ -219,6 +219,8 @@ extern u_int ieee802_11_if_print(const struct pcap_pkthdr *, const u_char *); extern u_int ieee802_11_radio_if_print(const struct pcap_pkthdr *, const u_char *); extern u_int ap1394_if_print(const struct pcap_pkthdr *, const u_char *); +extern u_int ieee802_11_radio_avs_if_print(const struct pcap_pkthdr *, + const u_char *); extern void gre_print(const u_char *, u_int); extern void icmp_print(const u_char *, u_int, const u_char *, int); extern void igmp_print(const u_char *, u_int); diff --git a/print-802_11.c b/print-802_11.c index 611ae602..99a3f8ea 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 2007-07-22 23:13:41 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-802_11.c,v 1.48 2007-12-20 08:13:35 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -1209,6 +1209,11 @@ ieee802_11_avs_radio_print(const u_char *p, u_int length, u_int caplen) { u_int32_t caphdr_len; + if (caplen < 8) { + printf("[|802.11]"); + return caplen; + } + caphdr_len = EXTRACT_32BITS(p + 4); if (caphdr_len < 8) { /* @@ -1270,19 +1275,21 @@ prism_if_print(const struct pcap_pkthdr *h, const u_char *p) /* * For DLT_IEEE802_11_RADIO; like DLT_IEEE802_11, but with an extra - * header, containing information such as radio information, which we - * currently ignore. + * header, containing information such as radio information. */ u_int ieee802_11_radio_if_print(const struct pcap_pkthdr *h, const u_char *p) { - u_int caplen = h->caplen; - u_int length = h->len; - - if (caplen < 8) { - printf("[|802.11]"); - return caplen; - } + return ieee802_11_radio_print(p, h->len, h->caplen); +} - return ieee802_11_radio_print(p, length, caplen); +/* + * For DLT_IEEE802_11_RADIO_AVS; like DLT_IEEE802_11, but with an + * extra header, containing information such as radio information, + * which we currently ignore. + */ +u_int +ieee802_11_radio_avs_if_print(const struct pcap_pkthdr *h, const u_char *p) +{ + return ieee802_11_avs_radio_print(p, h->len, h->caplen); } diff --git a/tcpdump.c b/tcpdump.c index e0043787..aabcd4de 100644 --- a/tcpdump.c +++ b/tcpdump.c @@ -30,7 +30,7 @@ static const char copyright[] _U_ = "@(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000\n\ The Regents of the University of California. All rights reserved.\n"; static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.274 2007-11-21 20:39:24 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.275 2007-12-20 08:13:35 guy Exp $ (LBL)"; #endif /* @@ -222,6 +222,9 @@ static struct printer printers[] = { #ifdef DLT_APPLE_IP_OVER_IEEE1394 { ap1394_if_print, DLT_APPLE_IP_OVER_IEEE1394 }, #endif +#ifdef DLT_IEEE802_11_RADIO_AVS + { ieee802_11_radio_avs_if_print, DLT_IEEE802_11_RADIO_AVS }, +#endif #ifdef DLT_JUNIPER_ATM1 { juniper_atm1_print, DLT_JUNIPER_ATM1 }, #endif