* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.198 2002-12-04 19:09:30 hannes Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.199 2002-12-12 07:28:35 guy Exp $ (LBL)
*/
#ifndef tcpdump_interface_h
extern void fr_if_print(u_char *, const struct pcap_pkthdr *, const u_char *);
extern void ieee802_11_if_print(u_char *, const struct pcap_pkthdr *,
const u_char *);
+extern void ieee802_11_radio_if_print(u_char *, 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 *);
extern void igmp_print(const u_char *, u_int);
const u_char *);
extern void pppoe_if_print(u_char *, const struct pcap_pkthdr *,
const u_char *);
+extern void prism_if_print(u_char *, const struct pcap_pkthdr *,
+ const u_char *);
extern int vjc_print(register const char *, u_short);
extern void raw_if_print(u_char *, const struct pcap_pkthdr *, const u_char *);
extern void rip_print(const u_char *, u_int);
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-802_11.c,v 1.12 2002-12-11 04:56:44 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-802_11.c,v 1.13 2002-12-12 07:28:35 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
* Print the 802.11 MAC header
*/
static inline void
-ieee_802_11_print(u_int16_t fc, const u_char *p)
+ieee_802_11_hdr_print(u_int16_t fc, const u_char *p)
{
switch (FC_TYPE(fc)) {
case T_MGMT:
}
}
-/*
- * This is the top level routine of the printer. 'p' points
- * to the 802.11 header of the packet, 'h->ts' is the timestamp,
- * 'h->length' is the length of the packet off the wire, and 'h->caplen'
- * is the number of bytes actually captured.
- */
-void
-ieee802_11_if_print(u_char *user _U_, const struct pcap_pkthdr *h, const u_char *p)
+static void
+ieee802_11_print(const u_char *p, u_int length, u_int caplen)
{
- u_int caplen = h->caplen;
- u_int length = h->len;
u_int16_t fc;
u_int HEADER_LENGTH;
u_short extracted_ethertype;
- ++infodelay;
- ts_print(&h->ts);
-
- if (caplen < IEEE802_11_FC_LEN) {
- printf("[|802.11]");
- goto out;
- }
-
fc = EXTRACT_LE_16BITS(p);
HEADER_LENGTH = GetHeaderLength(fc);
if (caplen < HEADER_LENGTH) {
printf("[|802.11]");
- goto out;
+ return;
}
if (eflag)
- ieee_802_11_print(fc, p);
+ ieee_802_11_hdr_print(fc, p);
/*
* Some printers want to get back at the ethernet addresses,
if (!mgmt_body_print(fc, (const struct mgmt_header_t *)packetp,
p)) {
printf("[|802.11]");
- goto out;
+ return;
}
break;
case T_CTRL:
if (!ctrl_body_print(fc, p - HEADER_LENGTH)) {
printf("[|802.11]");
- goto out;
+ return;
}
break;
if (FC_WEP(fc)) {
if (!wep_print(p)) {
printf("[|802.11]");
- goto out;
+ return;
}
} else {
if (llc_print(p, length, caplen, packetp + 10,
* handle intelligently
*/
if (!eflag)
- ieee_802_11_print(fc, p - HEADER_LENGTH);
+ ieee_802_11_hdr_print(fc, p - HEADER_LENGTH);
if (extracted_ethertype) {
printf("(LLC %s) ",
etherproto_string(htons(extracted_ethertype)));
if (xflag)
default_print(p, caplen);
- out:
+}
+
+/*
+ * This is the top level routine of the printer. 'p' points
+ * to the 802.11 header of the packet, 'h->ts' is the timestamp,
+ * 'h->length' is the length of the packet off the wire, and 'h->caplen'
+ * is the number of bytes actually captured.
+ */
+void
+ieee802_11_if_print(u_char *user _U_, const struct pcap_pkthdr *h, const u_char *p)
+{
+ u_int caplen = h->caplen;
+ u_int length = h->len;
+
+ ++infodelay;
+ ts_print(&h->ts);
+
+ if (caplen < IEEE802_11_FC_LEN) {
+ printf("[|802.11]");
+ goto out;
+ }
+
+ ieee802_11_print(p, length, caplen);
+
+out:
+ putchar('\n');
+ --infodelay;
+ if (infoprint)
+ info(0);
+}
+
+#define PRISM_HDR_LEN 144
+
+/*
+ * For DLT_PRISM_HEADER; like DLT_IEEE802_11, but with an extra header,
+ * containing information such as radio information, which we
+ * currently ignore.
+ */
+void
+prism_if_print(u_char *user _U_, const struct pcap_pkthdr *h, const u_char *p)
+{
+ u_int caplen = h->caplen;
+ u_int length = h->len;
+
+ ++infodelay;
+ ts_print(&h->ts);
+
+ if (caplen < PRISM_HDR_LEN + IEEE802_11_FC_LEN) {
+ printf("[|802.11]");
+ goto out;
+ }
+
+ ieee802_11_print(p + PRISM_HDR_LEN, length - PRISM_HDR_LEN,
+ caplen - PRISM_HDR_LEN);
+
+out:
+ putchar('\n');
+ --infodelay;
+ if (infoprint)
+ info(0);
+}
+
+#define IEEE802_11_RADIO_HDR_LEN 146
+
+/*
+ * For DLT_IEEE802_11_RADIO; like DLT_IEEE802_11, but with an extra
+ * header, containing information such as radio information, which we
+ * currently ignore.
+ */
+void
+ieee802_11_radio_if_print(u_char *user _U_, const struct pcap_pkthdr *h,
+ const u_char *p)
+{
+ u_int caplen = h->caplen;
+ u_int length = h->len;
+
+ ++infodelay;
+ ts_print(&h->ts);
+
+ if (caplen < IEEE802_11_RADIO_HDR_LEN + IEEE802_11_FC_LEN) {
+ printf("[|802.11]");
+ goto out;
+ }
+
+ ieee802_11_print(p + IEEE802_11_RADIO_HDR_LEN,
+ length - IEEE802_11_RADIO_HDR_LEN,
+ caplen - IEEE802_11_RADIO_HDR_LEN);
+
+out:
putchar('\n');
--infodelay;
if (infoprint)
"@(#) 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[] =
- "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.188 2002-11-11 19:54:40 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.189 2002-12-12 07:28:36 guy Exp $ (LBL)";
#endif
/*
#endif
#ifdef DLT_IP_OVER_FC
{ ipfc_if_print, DLT_IP_OVER_FC },
+#endif
+#ifdef DLT_PRISM_HEADER
+ { prism_if_print, DLT_PRISM_HEADER },
+#endif
+#ifdef DLT_IEEE802_11_RADIO
+ { ieee802_11_radio_if_print, DLT_IEEE802_11_RADIO },
#endif
{ NULL, 0 },
};