How do I get the 802.11 information element ?

Looking at a capture of the communication it looks like this

I can get the management request, the probe request (That gives me the 10 first chars of the SSID), and the Beacon without problems, but it seems like the the software is not listening on the Information Elements.
My current code looks like this
Code: Select all
void ICACHE_FLASH_ATTR smartlink_wifi_promiscuous_rx(uint8_t *buf, uint16 len) {
uint16 i;
uint8_t type;
if (len == 12) {
struct RxControl *ctrl = (struct RxControl*) buf;
return;
}
struct sniffer_buf *sniffer = (struct sniffer_buf*) buf;
struct probe_request_80211 *probe_buf = (struct probe_request_80211*) sniffer->buf;
if (FRAME_TYPE_MANAGEMENT == probe_buf->framectrl.Type) {
/* Management frame */
if (FRAME_SUBTYPE_BEACON == probe_buf->framectrl.Subtype || FRAME_SUBTYPE_PROBE_REQUEST == probe_buf->framectrl.Subtype) {
/* Probe Request */
if (FRAME_SUBTYPE_PROBE_REQUEST == probe_buf->framectrl.Subtype) {
ptagged_parameter tag = (ptagged_parameter) (sniffer->buf + sizeof(probe_request));
if (tag->tag_length != 0) {
uint8_t ssid_buff[32];
os_memset(ssid_buff, 0, 32);
// This gives only the first 10 chars of the SSID
os_memcpy(ssid_buff, (uint8_t *) tag + 2, tag->tag_length);
}
} else {
os_printf("[M] Empty TAG ", sniffer->cnt);
}
}
}
}
}