shill: Adds BSS nl80211 attribute.
The BSS attribute, which is contained in the
NL80211_CMD_NEW_SCAN_RESULTS netlink message, contains SSID information
received from a scan.
BUG=chromium:221118
TEST=unittest.
Change-Id: I20766ae6d73ae5729e4ae8de47cac8bcbf5b3fe9
Reviewed-on: https://gerrit.chromium.org/gerrit/48013
Reviewed-by: Wade Guthrie <wdg@chromium.org>
Tested-by: Wade Guthrie <wdg@chromium.org>
Commit-Queue: Wade Guthrie <wdg@chromium.org>
diff --git a/netlink_attribute.cc b/netlink_attribute.cc
index af1c842..a934074 100644
--- a/netlink_attribute.cc
+++ b/netlink_attribute.cc
@@ -15,6 +15,7 @@
#include "shill/control_netlink_attribute.h"
#include "shill/logging.h"
#include "shill/nl80211_attribute.h"
+#include "shill/wifi.h"
using std::map;
using std::string;
@@ -42,6 +43,9 @@
NetlinkAttribute *NetlinkAttribute::NewNl80211AttributeFromId(int id) {
scoped_ptr<NetlinkAttribute> attr;
switch (id) {
+ case NL80211_ATTR_BSS:
+ attr.reset(new Nl80211AttributeBss());
+ break;
case NL80211_ATTR_COOKIE:
attr.reset(new Nl80211AttributeCookie());
break;
@@ -626,6 +630,21 @@
value_.size() + 1);
}
+// SSID attribute.
+
+bool NetlinkSsidAttribute::ToString(string *output) const {
+ if (!output) {
+ LOG(ERROR) << "Null |output| parameter";
+ return false;
+ }
+ string value;
+ if (!GetStringValue(&value))
+ return false;
+
+ *output = WiFi::LogSSID(value);
+ return true;
+}
+
// NetlinkNestedAttribute
const char NetlinkNestedAttribute::kMyTypeString[] = "nested";