]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
RNR: Add bss_parameters to the neighbor_db
authorJohn Crispin <john@phrozen.org>
Tue, 27 Jul 2021 23:42:17 +0000 (16:42 -0700)
committerJouni Malinen <j@w1.fi>
Mon, 8 Nov 2021 21:39:46 +0000 (23:39 +0200)
Add a new field to include BSS Parameter subfield in the neighbor
database as described in IEEE Std 802.11ax-2021, Figure 9-632a (BSS
Parameters subfield format). This field holds information related to
multiple BSSID, access point co-location, and 20 TU probe response
active/inactive state.

Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Aloka Dixit <alokad@codeaurora.org>
hostapd/ctrl_iface.c
src/ap/hostapd.h
src/ap/neighbor_db.c
src/ap/neighbor_db.h

index 128fa9538f981f64fb7130ffdf8b6a68c220a2ea..e084b2a1fcbc3216f47392257264bce28d8a2ccf 100644 (file)
@@ -3191,6 +3191,7 @@ static int hostapd_ctrl_iface_set_neighbor(struct hostapd_data *hapd, char *buf)
        u8 bssid[ETH_ALEN];
        struct wpabuf *nr, *lci = NULL, *civic = NULL;
        int stationary = 0;
+       int bss_parameters = 0;
        char *tmp;
        int ret;
 
@@ -3275,9 +3276,22 @@ static int hostapd_ctrl_iface_set_neighbor(struct hostapd_data *hapd, char *buf)
        if (os_strstr(buf, "stat"))
                stationary = 1;
 
+       tmp = os_strstr(buf, "bss_parameter=");
+       if (tmp) {
+               bss_parameters = atoi(tmp + 14);
+               if (bss_parameters < 0 || bss_parameters > 0xff) {
+                       wpa_printf(MSG_ERROR,
+                                  "CTRL: SET_NEIGHBOR: Bad bss_parameters subelement");
+                       wpabuf_free(nr);
+                       wpabuf_free(lci);
+                       wpabuf_free(civic);
+                       return -1;
+               }
+       }
+
 set:
        ret = hostapd_neighbor_set(hapd, bssid, &ssid, nr, lci, civic,
-                                  stationary);
+                                  stationary, bss_parameters);
 
        wpabuf_free(nr);
        wpabuf_free(lci);
index bb9a35eb10301020699ce4bc0eb0d794581b9c31..f3ca7529ac96a41528d209172443c2164dcbe405 100644 (file)
@@ -139,6 +139,7 @@ struct hostapd_neighbor_entry {
        struct os_time lci_date;
        int stationary;
        u32 short_ssid;
+       u8 bss_parameters;
 };
 
 struct hostapd_sae_commit_queue {
index e9bdf0033592d0aa8a137c1677700a4f5bdd2e97..229edd2a94c4ec6765f6349be29b57eb0811555d 100644 (file)
@@ -121,7 +121,8 @@ hostapd_neighbor_add(struct hostapd_data *hapd)
 int hostapd_neighbor_set(struct hostapd_data *hapd, const u8 *bssid,
                         const struct wpa_ssid_value *ssid,
                         const struct wpabuf *nr, const struct wpabuf *lci,
-                        const struct wpabuf *civic, int stationary)
+                        const struct wpabuf *civic, int stationary,
+                        u8 bss_parameters)
 {
        struct hostapd_neighbor_entry *entry;
 
@@ -154,6 +155,7 @@ int hostapd_neighbor_set(struct hostapd_data *hapd, const u8 *bssid,
        }
 
        entry->stationary = stationary;
+       entry->bss_parameters = bss_parameters;
 
        return 0;
 
@@ -313,7 +315,7 @@ void hostapd_neighbor_set_own_report(struct hostapd_data *hapd)
        wpabuf_put_u8(nr, center_freq2_idx);
 
        hostapd_neighbor_set(hapd, hapd->own_addr, &ssid, nr, hapd->iconf->lci,
-                            hapd->iconf->civic, hapd->iconf->stationary_ap);
+                            hapd->iconf->civic, hapd->iconf->stationary_ap, 0);
 
        wpabuf_free(nr);
 #endif /* NEED_AP_MLME */
index bed0a2f5fb7f2cc1b5bdf2468b3a084b8cfe9730..992671b62608a8306f3ca4eef9362480313533ec 100644 (file)
@@ -17,7 +17,8 @@ int hostapd_neighbor_show(struct hostapd_data *hapd, char *buf, size_t buflen);
 int hostapd_neighbor_set(struct hostapd_data *hapd, const u8 *bssid,
                         const struct wpa_ssid_value *ssid,
                         const struct wpabuf *nr, const struct wpabuf *lci,
-                        const struct wpabuf *civic, int stationary);
+                        const struct wpabuf *civic, int stationary,
+                        u8 bss_parameters);
 void hostapd_neighbor_set_own_report(struct hostapd_data *hapd);
 int hostapd_neighbor_remove(struct hostapd_data *hapd, const u8 *bssid,
                            const struct wpa_ssid_value *ssid);