wlantest: Add support for reading DLT_IEEE802_11 pcap files
This commit is contained in:
parent
350132bec5
commit
0f3e4f2a83
3 changed files with 12 additions and 1 deletions
|
@ -262,3 +262,10 @@ void wlantest_process_prism(struct wlantest *wt, const u8 *data, size_t len)
|
||||||
|
|
||||||
rx_frame(wt, frame, frame_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);
|
||||||
|
}
|
||||||
|
|
|
@ -36,7 +36,8 @@ int read_cap_file(struct wlantest *wt, const char *fname)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
dlt = pcap_datalink(pcap);
|
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",
|
wpa_printf(MSG_ERROR, "Unsupported pcap datalink type: %d",
|
||||||
dlt);
|
dlt);
|
||||||
pcap_close(pcap);
|
pcap_close(pcap);
|
||||||
|
@ -82,6 +83,8 @@ int read_cap_file(struct wlantest *wt, const char *fname)
|
||||||
case DLT_PRISM_HEADER:
|
case DLT_PRISM_HEADER:
|
||||||
wlantest_process_prism(wt, data, hdr->caplen);
|
wlantest_process_prism(wt, data, hdr->caplen);
|
||||||
break;
|
break;
|
||||||
|
case DLT_IEEE802_11:
|
||||||
|
wlantest_process_80211(wt, data, hdr->caplen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -155,6 +155,7 @@ void write_pcap_decrypted(struct wlantest *wt, const u8 *buf1, size_t len1,
|
||||||
const u8 *buf2, size_t len2);
|
const u8 *buf2, size_t len2);
|
||||||
void wlantest_process(struct wlantest *wt, const u8 *data, size_t len);
|
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_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);
|
void wlantest_process_wired(struct wlantest *wt, const u8 *data, size_t len);
|
||||||
u32 crc32(const u8 *frame, size_t frame_len);
|
u32 crc32(const u8 *frame, size_t frame_len);
|
||||||
int monitor_init(struct wlantest *wt, const char *ifname);
|
int monitor_init(struct wlantest *wt, const char *ifname);
|
||||||
|
|
Loading…
Reference in a new issue