aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest/readpcap.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2010-11-11 23:00:31 (GMT)
committerJouni Malinen <j@w1.fi>2010-11-11 23:00:31 (GMT)
commit64f45d070b13f260c2e2f7bb21527f5a809b5cde (patch)
treeea1812b9811ae4e49a16cf1fd00a836e10e37a1d /wlantest/readpcap.c
parent5db8cf314ef169cd256483e32dcc49e31e605121 (diff)
downloadhostap-64f45d070b13f260c2e2f7bb21527f5a809b5cde.zip
hostap-64f45d070b13f260c2e2f7bb21527f5a809b5cde.tar.gz
hostap-64f45d070b13f260c2e2f7bb21527f5a809b5cde.tar.bz2
wlantest: Add option for writing a PCAP dump file
The output file includes all the capture (or read from wireless PCAP file) frames in their original contents and another copy of each frame that is decrypted in wlantest (including EAPOL-Key Key Data field).
Diffstat (limited to 'wlantest/readpcap.c')
-rw-r--r--wlantest/readpcap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/wlantest/readpcap.c b/wlantest/readpcap.c
index dfb7ac0..bd93d7b 100644
--- a/wlantest/readpcap.c
+++ b/wlantest/readpcap.c
@@ -55,6 +55,10 @@ int read_cap_file(struct wlantest *wt, const char *fname)
"len=%u/%u",
(int) hdr->ts.tv_sec, (int) hdr->ts.tv_usec,
hdr->caplen, hdr->len);
+ if (wt->write_pcap_dumper) {
+ wt->write_pcap_time = hdr->ts;
+ pcap_dump(wt->write_pcap_dumper, hdr, data);
+ }
if (hdr->caplen < hdr->len) {
wpa_printf(MSG_DEBUG, "pcap: Dropped incomplete frame "
"(%u/%u captured)",