ESP8266 Developer Zone The Official ESP8266 Forum 2015-03-21T19:41:04+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=289 2015-03-21T19:41:04+08:00 2015-03-21T19:41:04+08:00 https://bbs.espressif.com:443/viewtopic.php?t=289&p=1116#p1116 <![CDATA[Re: Changes in the sniffer structure - Where have the SSID g]]> 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

Statistics: Posted by reaper7 — Sat Mar 21, 2015 7:41 pm


]]>
2015-03-21T08:22:43+08:00 2015-03-21T08:22:43+08:00 https://bbs.espressif.com:443/viewtopic.php?t=289&p=1112#p1112 <![CDATA[Changes in the sniffer structure - Where have the SSID gone]]>
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:

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

Statistics: Posted by Thorvald — Sat Mar 21, 2015 8:22 am


]]>