Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Apr 2016 04:37:09 +0000 (UTC)
From:      Fehmi Noyan ISI <fnoyanisi@yahoo.com>
To:        "freebsd-wireless@freebsd.org" <freebsd-wireless@freebsd.org>
Subject:   struct ieee80211req_scan_result and couple of questions
Message-ID:  <1577375135.1864049.1460954229303.JavaMail.yahoo@mail.yahoo.com>
References:  <1577375135.1864049.1460954229303.JavaMail.yahoo.ref@mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi there,

I have been digging into the IEEE 802.11 related code for a couple of days and need to clarify some points (or get my interpretation of the code confirmed :} ). So, here are some gray areas I have;


1 ) ioctl(2) returns a memory address (in i_data field of ireq structure) which points a series of "ieee80211req_scan_result" structures when request type is IEEE80211_IOC_SCAN_RESULTS, and it is the programmer's responsibility to parse the returned data in a proper way?


The code for list_scan(int) in sbin/ifconfig/ifieee80211.c is a good example to this?


2 ) The "mesh" networking related parts of "ieee80211req_scan_result" structure are IEEE 802.11s additions?

3 ) A "ieee80211req_scan_result" structure can either have an SSID or a MESH ID? If so, in the code snippet below (from sbin/ifconfig/ifieee80211.c)


/* cp points a memory location returned by ioctl(2)

 * when request = IEEE80211_IOC_SCAN_RESULTS

 */

const uint8_t *vp, *idp;
sr = (const struct ieee80211req_scan_result *) cp;
vp = cp + sr->isr_ie_off;
if (sr->isr_meshid_len) {
                         idp = vp + sr->isr_ssid_len;
                         idlen = sr->isr_meshid_len;
} else {
                         idp = vp;
                         idlen = sr->isr_ssid_len;
}

why don't we have 

if (sr->isr_meshid_len) {
  idp = vp + sr->isr_meshid_len; /* THIS LINE */
  idlen = sr->isr_meshid_len;
} else {
   idp = vp;
   idlen = sr->isr_ssid_len;
}

Assuming the memory is organized like this

+-------------------+----+------+---------+
| Fixed Size struct | IE | SSID | MESH ID |
+-------------------+----+------+---------+

4 ) NET80211(4) manual page does not include the description of ieee80211req_scan_result structure. Would be good to have in the manual page rather than reading the net80211/ieee80211_ioctl.h file. 

I am happy to submit a patch if you aggree that a definition of ieee80211req_scan_result should appear in net80211(4). This will be freebsd-doc related issue then.

Regards
Fehmi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1577375135.1864049.1460954229303.JavaMail.yahoo>