aboutsummaryrefslogtreecommitdiffstats
path: root/src/ap
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-01-31 20:20:41 (GMT)
committerJouni Malinen <j@w1.fi>2014-02-04 11:23:35 (GMT)
commitb37d582eaf47c042bd957c45c428724dc5930f20 (patch)
tree770fb035a113199a3f86adee9288b037acc2a061 /src/ap
parent93ee3022dc3fdb6e199a57c14b6cc008fe29d921 (diff)
downloadhostap-b37d582eaf47c042bd957c45c428724dc5930f20.zip
hostap-b37d582eaf47c042bd957c45c428724dc5930f20.tar.gz
hostap-b37d582eaf47c042bd957c45c428724dc5930f20.tar.bz2
Replace ieee802_11_print_ssid() with wpa_ssid_txt()
There is no need to maintain two different functions for printing out ASCII text version of SSID. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/ap')
-rw-r--r--src/ap/beacon.c6
-rw-r--r--src/ap/ieee802_11.c19
-rw-r--r--src/ap/ieee802_11.h1
3 files changed, 3 insertions, 23 deletions
diff --git a/src/ap/beacon.c b/src/ap/beacon.c
index 5318ecb..b1ebf6e 100644
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
@@ -520,12 +520,10 @@ void handle_probe_req(struct hostapd_data *hapd,
sta->ssid_probe = &hapd->conf->ssid;
} else {
if (!(mgmt->da[0] & 0x01)) {
- char ssid_txt[33];
- ieee802_11_print_ssid(ssid_txt, elems.ssid,
- elems.ssid_len);
wpa_printf(MSG_MSGDUMP, "Probe Request from " MACSTR
" for foreign SSID '%s' (DA " MACSTR ")%s",
- MAC2STR(mgmt->sa), ssid_txt,
+ MAC2STR(mgmt->sa),
+ wpa_ssid_txt(elems.ssid, elems.ssid_len),
MAC2STR(mgmt->da),
elems.ssid_list ? " (SSID list)" : "");
}
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index dee3c7a..0f67883 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -178,21 +178,6 @@ u16 hostapd_own_capab_info(struct hostapd_data *hapd, struct sta_info *sta,
}
-void ieee802_11_print_ssid(char *buf, const u8 *ssid, u8 len)
-{
- int i;
- if (len > HOSTAPD_MAX_SSID_LEN)
- len = HOSTAPD_MAX_SSID_LEN;
- for (i = 0; i < len; i++) {
- if (ssid[i] >= 32 && ssid[i] < 127)
- buf[i] = ssid[i];
- else
- buf[i] = '.';
- }
- buf[len] = '\0';
-}
-
-
static u16 auth_shared_key(struct hostapd_data *hapd, struct sta_info *sta,
u16 auth_transaction, const u8 *challenge,
int iswep)
@@ -781,12 +766,10 @@ static u16 check_ssid(struct hostapd_data *hapd, struct sta_info *sta,
if (ssid_ie_len != hapd->conf->ssid.ssid_len ||
os_memcmp(ssid_ie, hapd->conf->ssid.ssid, ssid_ie_len) != 0) {
- char ssid_txt[33];
- ieee802_11_print_ssid(ssid_txt, ssid_ie, ssid_ie_len);
hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
HOSTAPD_LEVEL_INFO,
"Station tried to associate with unknown SSID "
- "'%s'", ssid_txt);
+ "'%s'", wpa_ssid_txt(ssid_ie, ssid_ie_len));
return WLAN_STATUS_UNSPECIFIED_FAILURE;
}
diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h
index 5edeb71..566a65a 100644
--- a/src/ap/ieee802_11.h
+++ b/src/ap/ieee802_11.h
@@ -19,7 +19,6 @@ int ieee802_11_mgmt(struct hostapd_data *hapd, const u8 *buf, size_t len,
struct hostapd_frame_info *fi);
void ieee802_11_mgmt_cb(struct hostapd_data *hapd, const u8 *buf, size_t len,
u16 stype, int ok);
-void ieee802_11_print_ssid(char *buf, const u8 *ssid, u8 len);
#ifdef NEED_AP_MLME
int ieee802_11_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen);
int ieee802_11_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta,