wlantest: Add support for reading DLT_IEEE802_11 pcap files

This commit is contained in:
Jouni Malinen 2010-12-04 11:18:21 -08:00 committed by Jouni Malinen
parent 350132bec5
commit 0f3e4f2a83
3 changed files with 12 additions and 1 deletions

View file

@ -262,3 +262,10 @@ void wlantest_process_prism(struct wlantest *wt, const u8 *data, size_t len)
rx_frame(wt, frame, frame_len);
}
void wlantest_process_80211(struct wlantest *wt, const u8 *data, size_t len)
{
wpa_hexdump(MSG_EXCESSIVE, "Process data", data, len);
rx_frame(wt, data, len);
}

View file

@ -36,7 +36,8 @@ int read_cap_file(struct wlantest *wt, const char *fname)
return -1;
}
dlt = pcap_datalink(pcap);
if (dlt != DLT_IEEE802_11_RADIO && dlt != DLT_PRISM_HEADER) {
if (dlt != DLT_IEEE802_11_RADIO && dlt != DLT_PRISM_HEADER &&
dlt != DLT_IEEE802_11) {
wpa_printf(MSG_ERROR, "Unsupported pcap datalink type: %d",
dlt);
pcap_close(pcap);
@ -82,6 +83,8 @@ int read_cap_file(struct wlantest *wt, const char *fname)
case DLT_PRISM_HEADER:
wlantest_process_prism(wt, data, hdr->caplen);
break;
case DLT_IEEE802_11:
wlantest_process_80211(wt, data, hdr->caplen);
}
}

View file

@ -155,6 +155,7 @@ void write_pcap_decrypted(struct wlantest *wt, const u8 *buf1, size_t len1,
const u8 *buf2, size_t len2);
void wlantest_process(struct wlantest *wt, const u8 *data, size_t len);
void wlantest_process_prism(struct wlantest *wt, const u8 *data, size_t len);
void wlantest_process_80211(struct wlantest *wt, const u8 *data, size_t len);
void wlantest_process_wired(struct wlantest *wt, const u8 *data, size_t len);
u32 crc32(const u8 *frame, size_t frame_len);
int monitor_init(struct wlantest *wt, const char *ifname);