Add support for setting SSID hiding mode through set_ap()
This commit is contained in:
parent
b11d1d6439
commit
97a7a0b504
3 changed files with 36 additions and 0 deletions
|
@ -530,6 +530,17 @@ void ieee802_11_set_beacon(struct hostapd_data *hapd)
|
|||
(hapd->conf->ieee802_1x &&
|
||||
(hapd->conf->default_wep_key_len ||
|
||||
hapd->conf->individual_wep_key_len));
|
||||
switch (hapd->conf->ignore_broadcast_ssid) {
|
||||
case 0:
|
||||
params.hide_ssid = NO_SSID_HIDING;
|
||||
break;
|
||||
case 1:
|
||||
params.hide_ssid = HIDDEN_SSID_ZERO_LEN;
|
||||
break;
|
||||
case 2:
|
||||
params.hide_ssid = HIDDEN_SSID_ZERO_CONTENTS;
|
||||
break;
|
||||
}
|
||||
if (hostapd_drv_set_ap(hapd, ¶ms))
|
||||
wpa_printf(MSG_ERROR, "Failed to set beacon parameters");
|
||||
|
||||
|
|
|
@ -500,6 +500,12 @@ struct wpa_driver_associate_params {
|
|||
int uapsd;
|
||||
};
|
||||
|
||||
enum hide_ssid {
|
||||
NO_SSID_HIDING,
|
||||
HIDDEN_SSID_ZERO_LEN,
|
||||
HIDDEN_SSID_ZERO_CONTENTS
|
||||
};
|
||||
|
||||
struct wpa_driver_ap_params {
|
||||
/**
|
||||
* head - Beacon head from IEEE 802.11 header to IEs before TIM IE
|
||||
|
@ -541,6 +547,11 @@ struct wpa_driver_ap_params {
|
|||
*/
|
||||
size_t ssid_len;
|
||||
|
||||
/**
|
||||
* hide_ssid - Whether to hide the SSID
|
||||
*/
|
||||
enum hide_ssid hide_ssid;
|
||||
|
||||
/**
|
||||
* pairwise_ciphers - WPA_CIPHER_* bitfield
|
||||
*/
|
||||
|
|
|
@ -3852,6 +3852,20 @@ static int wpa_driver_nl80211_set_ap(void *priv,
|
|||
NLA_PUT_U32(msg, NL80211_ATTR_DTIM_PERIOD, params->dtim_period);
|
||||
NLA_PUT(msg, NL80211_ATTR_SSID, params->ssid_len,
|
||||
params->ssid);
|
||||
switch (params->hide_ssid) {
|
||||
case NO_SSID_HIDING:
|
||||
NLA_PUT_U32(msg, NL80211_ATTR_HIDDEN_SSID,
|
||||
NL80211_HIDDEN_SSID_NOT_IN_USE);
|
||||
break;
|
||||
case HIDDEN_SSID_ZERO_LEN:
|
||||
NLA_PUT_U32(msg, NL80211_ATTR_HIDDEN_SSID,
|
||||
NL80211_HIDDEN_SSID_ZERO_LEN);
|
||||
break;
|
||||
case HIDDEN_SSID_ZERO_CONTENTS:
|
||||
NLA_PUT_U32(msg, NL80211_ATTR_HIDDEN_SSID,
|
||||
NL80211_HIDDEN_SSID_ZERO_CONTENTS);
|
||||
break;
|
||||
}
|
||||
if (params->privacy)
|
||||
NLA_PUT_FLAG(msg, NL80211_ATTR_PRIVACY);
|
||||
if ((params->auth_algs & (WPA_AUTH_ALG_OPEN | WPA_AUTH_ALG_SHARED)) ==
|
||||
|
|
Loading…
Reference in a new issue