hostapd: Add a configuration to set an AP as stationary
Add a configuration option in hostapd.conf and in neighbor report that sets an AP as stationary. To enable this option on the current AP set the config option stationary_ap to 1. To set a neighbor entry to be marked as stationary add the word stat to the SET_NEIGHBOR command. This option tells hostapd to send LCI data even if it is older than requested by max age subelement in RRM request. Signed-off-by: David Spinadel <david.spinadel@intel.com>
This commit is contained in:
parent
5cb59370d5
commit
451a27b1ad
10 changed files with 32 additions and 11 deletions
|
@ -713,6 +713,7 @@ struct hostapd_config {
|
|||
|
||||
struct wpabuf *lci;
|
||||
struct wpabuf *civic;
|
||||
int stationary_ap;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -1645,7 +1645,7 @@ static void hostapd_set_own_neighbor_report(struct hostapd_data *hapd)
|
|||
wpabuf_put_u8(nr, center_freq2);
|
||||
|
||||
hostapd_neighbor_set(hapd, hapd->own_addr, &ssid, nr, hapd->iconf->lci,
|
||||
hapd->iconf->civic);
|
||||
hapd->iconf->civic, hapd->iconf->stationary_ap);
|
||||
|
||||
wpabuf_free(nr);
|
||||
#endif /* NEED_AP_MLME */
|
||||
|
|
|
@ -109,6 +109,7 @@ struct hostapd_neighbor_entry {
|
|||
struct wpabuf *civic;
|
||||
/* LCI update time */
|
||||
struct os_time lci_date;
|
||||
int stationary;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -43,6 +43,7 @@ static void hostapd_neighbor_clear_entry(struct hostapd_neighbor_entry *nr)
|
|||
nr->civic = NULL;
|
||||
os_memset(nr->bssid, 0, sizeof(nr->bssid));
|
||||
os_memset(&nr->ssid, 0, sizeof(nr->ssid));
|
||||
nr->stationary = 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -64,7 +65,7 @@ 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)
|
||||
const struct wpabuf *civic, int stationary)
|
||||
{
|
||||
struct hostapd_neighbor_entry *entry;
|
||||
|
||||
|
@ -95,6 +96,8 @@ int hostapd_neighbor_set(struct hostapd_data *hapd, const u8 *bssid,
|
|||
goto fail;
|
||||
}
|
||||
|
||||
entry->stationary = stationary;
|
||||
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
|
|
|
@ -16,7 +16,7 @@ hostapd_neighbor_get(struct hostapd_data *hapd, const u8 *bssid,
|
|||
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);
|
||||
const struct wpabuf *civic, int stationary);
|
||||
int hostapd_neighbor_remove(struct hostapd_data *hapd, const u8 *bssid,
|
||||
const struct wpa_ssid_value *ssid);
|
||||
void hostpad_free_neighbor_db(struct hostapd_data *hapd);
|
||||
|
|
|
@ -129,12 +129,12 @@ static int hostapd_check_lci_age(struct hostapd_neighbor_entry *nr, u16 max_age)
|
|||
struct os_time curr, diff;
|
||||
unsigned long diff_l;
|
||||
|
||||
if (nr->stationary || max_age == 0xffff)
|
||||
return 1;
|
||||
|
||||
if (!max_age)
|
||||
return 0;
|
||||
|
||||
if (max_age == 0xffff)
|
||||
return 1;
|
||||
|
||||
if (os_get_time(&curr))
|
||||
return 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue