diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2005-11-22 11:36:13 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2005-11-22 11:36:13 +0000 |
commit | bb76f74956fe60e8ce58011926a3848c10f71890 (patch) | |
tree | 69ef41d74e90182d74d72011d09e3c508d10c444 /usr.sbin/tcpdump/print-802_11.c | |
parent | a02d75045e483f60b8fea1479ebf4bcd44ace3d3 (diff) |
add printer for IAPP and hostapd(8) messages
ok canacar@, tested by aanriot@ and others
Diffstat (limited to 'usr.sbin/tcpdump/print-802_11.c')
-rw-r--r-- | usr.sbin/tcpdump/print-802_11.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/usr.sbin/tcpdump/print-802_11.c b/usr.sbin/tcpdump/print-802_11.c index 4008df38a62..10566cac92c 100644 --- a/usr.sbin/tcpdump/print-802_11.c +++ b/usr.sbin/tcpdump/print-802_11.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-802_11.c,v 1.4 2005/05/28 09:01:52 reyk Exp $ */ +/* $OpenBSD: print-802_11.c,v 1.5 2005/11/22 11:36:12 reyk Exp $ */ /* * Copyright (c) 2005 Reyk Floeter <reyk@vantronix.net> @@ -68,6 +68,8 @@ u_int ieee80211_any2ieee(u_int, u_int); #define TCARR(a) TCHECK2(*a, sizeof(a)) +int ieee80211_encap = 0; + int ieee80211_hdr(struct ieee80211_frame *wh) { @@ -449,7 +451,8 @@ ieee802_11_if_print(u_char *user, const struct pcap_pkthdr *h, { struct ieee80211_frame *wh = (struct ieee80211_frame*)p; - ts_print(&h->ts); + if (!ieee80211_encap) + ts_print(&h->ts); packetp = p; snapend = p + h->caplen; @@ -457,10 +460,11 @@ ieee802_11_if_print(u_char *user, const struct pcap_pkthdr *h, if (ieee80211_print(wh, (u_int)h->caplen) != 0) printf("[|802.11]"); - if (xflag) - default_print(p, (u_int)h->caplen); - - putchar('\n'); + if (!ieee80211_encap) { + if (xflag) + default_print(p, (u_int)h->caplen); + putchar('\n'); + } } void @@ -474,7 +478,8 @@ ieee802_11_radio_if_print(u_char *user, const struct pcap_pkthdr *h, u_int32_t present; u_int len, rh_len; - ts_print(&h->ts); + if (!ieee80211_encap) + ts_print(&h->ts); packetp = p; snapend = p + h->caplen; @@ -484,7 +489,7 @@ ieee802_11_radio_if_print(u_char *user, const struct pcap_pkthdr *h, len = h->caplen; rh_len = letoh16(rh->it_len); if (rh->it_version != 0) { - printf("[?radiotap + 802.11 v:%u]\n", rh->it_version); + printf("[?radiotap + 802.11 v:%u]", rh->it_version); goto out; } @@ -645,7 +650,9 @@ ieee802_11_radio_if_print(u_char *user, const struct pcap_pkthdr *h, printf("[|radiotap + 802.11]"); out: - if (xflag) - default_print(p, h->caplen); - putchar('\n'); + if (!ieee80211_encap) { + if (xflag) + default_print(p, h->caplen); + putchar('\n'); + } } |