Changes in the sniffer structure - Where have the SSID gone

Thorvald
Posts: 8
Joined: Fri Feb 20, 2015 6:25 am

Changes in the sniffer structure - Where have the SSID gone

Postby Thorvald » Sat Mar 21, 2015 8:22 am

I am updating our device to the new 1.0.0 firmware, and have noticed, that the sniffer structure have changed. I have applied the changes in the documentation, but are no longer able to find the SSID used in the proberequest.

How do I get the 802.11 information element ?

Image

Looking at a capture of the communication it looks like this
Image

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);
            }
         }
      }
   }
}

reaper7
Posts: 25
Joined: Fri Oct 24, 2014 7:26 pm

Re: Changes in the sniffer structure - Where have the SSID g

Postby reaper7 » Sat Mar 21, 2015 7:41 pm

@Thorvald - true, I see the same problem.
Maybe this is a little bug because earlier it was possible and was repaired as @jackon wrote in another post: viewtopic.php?f=13&t=94#p578

Who is online

Users browsing this forum: No registered users and 57 guests