diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-08-25 20:31:13 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-08-25 20:31:13 -0400 |
commit | b4bf343093e81e33d75bede45896eda52cd5f2b4 (patch) | |
tree | 7fd5ce5f428995e6d612014e3ca7ad3f917fcf65 /net/ieee80211/ieee80211_module.c | |
parent | 343b0597297c3190647854881c087c01faf40a6f (diff) | |
parent | 099c5bb169e9816a7761336f668b63010762807b (diff) |
/spare/repo/netdev-2.6 branch 'ieee80211'
Diffstat (limited to 'net/ieee80211/ieee80211_module.c')
-rw-r--r-- | net/ieee80211/ieee80211_module.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/net/ieee80211/ieee80211_module.c b/net/ieee80211/ieee80211_module.c index e0802b8755a0..553acb2e93d5 100644 --- a/net/ieee80211/ieee80211_module.c +++ b/net/ieee80211/ieee80211_module.c | |||
@@ -269,5 +269,31 @@ module_exit(ieee80211_exit); | |||
269 | module_init(ieee80211_init); | 269 | module_init(ieee80211_init); |
270 | #endif | 270 | #endif |
271 | 271 | ||
272 | |||
273 | const char *escape_essid(const char *essid, u8 essid_len) { | ||
274 | static char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; | ||
275 | const char *s = essid; | ||
276 | char *d = escaped; | ||
277 | |||
278 | if (ieee80211_is_empty_essid(essid, essid_len)) { | ||
279 | memcpy(escaped, "<hidden>", sizeof("<hidden>")); | ||
280 | return escaped; | ||
281 | } | ||
282 | |||
283 | essid_len = min(essid_len, (u8)IW_ESSID_MAX_SIZE); | ||
284 | while (essid_len--) { | ||
285 | if (*s == '\0') { | ||
286 | *d++ = '\\'; | ||
287 | *d++ = '0'; | ||
288 | s++; | ||
289 | } else { | ||
290 | *d++ = *s++; | ||
291 | } | ||
292 | } | ||
293 | *d = '\0'; | ||
294 | return escaped; | ||
295 | } | ||
296 | |||
272 | EXPORT_SYMBOL(alloc_ieee80211); | 297 | EXPORT_SYMBOL(alloc_ieee80211); |
273 | EXPORT_SYMBOL(free_ieee80211); | 298 | EXPORT_SYMBOL(free_ieee80211); |
299 | EXPORT_SYMBOL(escape_essid); | ||