Search Linux Wireless

Re: [PATCH] wireless: consolidate on a single escape_essid implementation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



John W. Linville wrote:
This is also an excuse to create the long rumored lib80211 module...

+++ b/net/wireless/lib80211.c
@@ -0,0 +1,58 @@
+/*
+ * lib80211 -- common bits for IEEE802.11 drivers
+ *
+ * Copyright(c) 2008 John W. Linville <linville@xxxxxxxxxxxxx>
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/wireless.h>

Alternatively #include <linux/ieee80211.h>, and avoid the WE header/constants? Or would you expect WE helpers in this file as well?

+const char *escape_essid(const char *essid, u8 essid_len)
+{
+	static char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
                          [IEEE80211_SSID_MAX_LEN * 2 + 1]

+	const char *s = essid;
+	char *d = escaped;
+
+	if (is_empty_essid(essid, essid_len)) {
+		memcpy(escaped, "<hidden>", sizeof("<hidden>"));
+		return escaped;
+	}
+
+	essid_len = min(essid_len, (u8) IW_ESSID_MAX_SIZE);
                                       IEEE80211_SSID_MAX_LEN

Also, are we worried about drivers interrupting each other and getting the others SSID? In which case maybe something like print_mac:

/* in lib80211.h */
#define DECLARE_SSID_BUF(x) char x[IEEE80211_SSID_MAX_LEN * 2 + 1]

const char *print_ssid(char *escaped, const char *ssid, u8 ssid_len);



Regards,

Dave.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux