shill: Small refactor of iw code.

callback80211_object.cc/.h have been pulled out of config80211.cc/.h
(and, except for a small chunk that is #ifdeffed out, identical).  Also,
gave constant numbers to the indecis of
UserBoundNlMessage::connect_status_map_.  Uncommented-out DeleteStationMessage.

BUG=None.
TEST=shill unit tests.

Change-Id: I51899e810a54b501e9d27b701649455d88bb5172
Reviewed-on: https://gerrit.chromium.org/gerrit/30923
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Wade Guthrie <wdg@chromium.org>
Tested-by: Wade Guthrie <wdg@chromium.org>
diff --git a/Makefile b/Makefile
index c41101c..b611bdd 100644
--- a/Makefile
+++ b/Makefile
@@ -110,6 +110,7 @@
 	arp_packet.o \
 	async_connection.o \
 	byte_string.o \
+	callback80211_object.o \
 	cellular.o \
 	cellular_capability.o \
 	cellular_capability_cdma.o \
diff --git a/callback80211_object.cc b/callback80211_object.cc
new file mode 100644
index 0000000..d028558
--- /dev/null
+++ b/callback80211_object.cc
@@ -0,0 +1,78 @@
+// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "shill/callback80211_object.h"
+
+#include <string>
+
+#include <base/memory/weak_ptr.h>
+
+#include "shill/config80211.h"
+#include "shill/link_monitor.h"
+#include "shill/logging.h"
+#include "shill/scope_logger.h"
+#include "shill/user_bound_nlmessage.h"
+
+using base::Bind;
+using base::LazyInstance;
+using std::string;
+
+namespace shill {
+
+namespace {
+LazyInstance<Callback80211Object> g_callback80211 = LAZY_INSTANCE_INITIALIZER;
+}  // namespace
+
+// static
+const char Callback80211Object::kMetricLinkDisconnectCount[] =
+    "Network.Shill.DisconnectCount";
+
+Callback80211Object::Callback80211Object() :
+    config80211_(NULL),
+    weak_ptr_factory_(this) {
+}
+
+Callback80211Object::~Callback80211Object() {
+  DeinstallAsCallback();
+}
+
+void Callback80211Object::Config80211MessageCallback(
+    const UserBoundNlMessage &msg) {
+  SLOG(WiFi, 2) << "Received " << msg.GetMessageTypeString()
+                << " (" << + msg.GetMessageType() << ")";
+  scoped_ptr<UserBoundNlMessage::AttributeNameIterator> i;
+
+  for (i.reset(msg.GetAttributeNameIterator()); !i->AtEnd(); i->Advance()) {
+    string value = "<unknown>";
+    msg.GetAttributeString(i->GetName(), &value);
+    SLOG(WiFi, 2) << "   Attr:" << msg.StringFromAttributeName(i->GetName())
+                  << "=" << value
+                  << " Type:" << msg.GetAttributeTypeString(i->GetName());
+  }
+}
+
+bool Callback80211Object::InstallAsCallback() {
+  if (config80211_) {
+    Config80211::Callback callback =
+        Bind(&Callback80211Object::Config80211MessageCallback,
+             weak_ptr_factory_.GetWeakPtr());
+    config80211_->SetDefaultCallback(callback);
+    return true;
+  }
+  return false;
+}
+
+bool Callback80211Object::DeinstallAsCallback() {
+  if (config80211_) {
+    config80211_->UnsetDefaultCallback();
+    return true;
+  }
+  return false;
+}
+
+Callback80211Object *Callback80211Object::GetInstance() {
+  return g_callback80211.Pointer();
+}
+
+}  // namespace shill.
diff --git a/callback80211_object.h b/callback80211_object.h
new file mode 100644
index 0000000..d76ab84
--- /dev/null
+++ b/callback80211_object.h
@@ -0,0 +1,65 @@
+// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// This class is a callback object that observes all nl80211 events that come
+// up from the kernel.
+
+#ifndef SHILL_CALLBACK80211_OBJECT_H
+#define SHILL_CALLBACK80211_OBJECT_H
+
+#include <iomanip>
+#include <map>
+#include <string>
+
+#include <base/basictypes.h>
+#include <base/bind.h>
+#include <base/lazy_instance.h>
+
+#include "shill/config80211.h"
+
+namespace shill {
+
+class UserBoundNlMessage;
+
+// Example Config80211 callback object; the callback prints a description of
+// each message with its attributes.  You want to make it a singleton so that
+// its life isn't dependent on any other object (plus, since this handles
+// global events from msg80211, you only want/need one).
+class Callback80211Object {
+ public:
+  Callback80211Object();
+  virtual ~Callback80211Object();
+
+  // Get a pointer to the singleton Callback80211Object.
+  static Callback80211Object *GetInstance();
+
+  // Install ourselves as a callback.  Done automatically by constructor.
+  bool InstallAsCallback();
+
+  // Deinstall ourselves as a callback.  Done automatically by destructor.
+  bool DeinstallAsCallback();
+
+  // Simple accessor.
+  void set_config80211(Config80211 *config80211) { config80211_ = config80211; }
+
+ protected:
+  friend struct base::DefaultLazyInstanceTraits<Callback80211Object>;
+
+ private:
+  // When installed, this is the method Config80211 will call when it gets a
+  // message from the mac80211 drivers.
+  void Config80211MessageCallback(const UserBoundNlMessage &msg);
+
+  static const char kMetricLinkDisconnectCount[];
+
+  Config80211 *config80211_;
+
+  // Config80211MessageCallback method bound to this object to install as a
+  // callback.
+  base::WeakPtrFactory<Callback80211Object> weak_ptr_factory_;
+};
+
+}  // namespace shill
+
+#endif  // SHILL_CALLBACK80211_OBJECT_H
diff --git a/config80211.cc b/config80211.cc
index 6faf422..2343da5 100644
--- a/config80211.cc
+++ b/config80211.cc
@@ -24,7 +24,6 @@
 using base::Bind;
 using base::LazyInstance;
 using base::StringAppendF;
-using base::StringPrintf;
 using std::map;
 using std::string;
 
@@ -32,7 +31,6 @@
 
 namespace {
 LazyInstance<Config80211> g_config80211 = LAZY_INSTANCE_INITIALIZER;
-LazyInstance<Callback80211Object> g_callback80211 = LAZY_INSTANCE_INITIALIZER;
 }  // namespace
 
 map<Config80211::EventType, std::string> *Config80211::event_types_ = NULL;
@@ -175,53 +173,4 @@
   return NL_SKIP;  // Skip current message, continue parsing buffer.
 }
 
-// Callback80211Object
-
-Callback80211Object::Callback80211Object() :
-    config80211_(NULL),
-    weak_ptr_factory_(this) {
-}
-
-Callback80211Object::~Callback80211Object() {
-  DeinstallAsCallback();
-}
-
-void Callback80211Object::Config80211MessageCallback(
-    const UserBoundNlMessage &msg) {
-  SLOG(WiFi, 2) << "Received " << msg.GetMessageTypeString()
-                << " (" << + msg.GetMessageType() << ")";
-  scoped_ptr<UserBoundNlMessage::AttributeNameIterator> i;
-
-  for (i.reset(msg.GetAttributeNameIterator()); !i->AtEnd(); i->Advance()) {
-    string value = "<unknown>";
-    msg.GetAttributeString(i->GetName(), &value);
-    SLOG(WiFi, 2) << "   Attr:" << msg.StringFromAttributeName(i->GetName())
-                  << "=" << value
-                  << " Type:" << msg.GetAttributeTypeString(i->GetName());
-  }
-}
-
-bool Callback80211Object::InstallAsCallback() {
-  if (config80211_) {
-    Config80211::Callback callback =
-        Bind(&Callback80211Object::Config80211MessageCallback,
-             weak_ptr_factory_.GetWeakPtr());
-    config80211_->SetDefaultCallback(callback);
-    return true;
-  }
-  return false;
-}
-
-bool Callback80211Object::DeinstallAsCallback() {
-  if (config80211_) {
-    config80211_->UnsetDefaultCallback();
-    return true;
-  }
-  return false;
-}
-
-Callback80211Object *Callback80211Object::GetInstance() {
-  return g_callback80211.Pointer();
-}
-
 }  // namespace shill.
diff --git a/config80211.h b/config80211.h
index ce4d2fa..b88b229 100644
--- a/config80211.h
+++ b/config80211.h
@@ -167,43 +167,6 @@
   DISALLOW_COPY_AND_ASSIGN(Config80211);
 };
 
-
-// Example Config80211 callback object; the callback prints a description of
-// each message with its attributes.  You want to make it a singleton so that
-// its life isn't dependent on any other object (plus, since this handles
-// global events from msg80211, you only want/need one).
-class Callback80211Object {
- public:
-  Callback80211Object();
-  virtual ~Callback80211Object();
-
-  // Get a pointer to the singleton Callback80211Object.
-  static Callback80211Object *GetInstance();
-
-  // Install ourselves as a callback.  Done automatically by constructor.
-  bool InstallAsCallback();
-
-  // Deinstall ourselves as a callback.  Done automatically by destructor.
-  bool DeinstallAsCallback();
-
-  // Simple accessor.
-  void set_config80211(Config80211 *config80211) { config80211_ = config80211; }
-
- protected:
-  friend struct base::DefaultLazyInstanceTraits<Callback80211Object>;
-
- private:
-  // When installed, this is the method Config80211 will call when it gets a
-  // message from the mac80211 drivers.
-  void Config80211MessageCallback(const UserBoundNlMessage &msg);
-
-  Config80211 *config80211_;
-
-  // Config80211MessageCallback method bound to this object to install as a
-  // callback.
-  base::WeakPtrFactory<Callback80211Object> weak_ptr_factory_;
-};
-
 }  // namespace shill
 
 #endif  // SHILL_CONFIG80211_H_
diff --git a/ieee80211.h b/ieee80211.h
index 83f53b2..ee52e02 100644
--- a/ieee80211.h
+++ b/ieee80211.h
@@ -60,6 +60,61 @@
   } u;
 };
 
+// Status/reason code returned by nl80211 messages: Authenticate,
+// Deauthenticate, Associate, and Reassociate.
+enum ConnectStatus {
+  kConnectStatusSuccessful = 0,
+  kConnectStatusFailure = 1,
+  kConnectStatusNoLongerValid = 2,
+  kConnectStatusSenderHasLeft = 3,
+  kConnectStatusNonAuthenticated = 7,
+  kConnectStatusAllCapabilitiesNotSupported = 10,
+  kConnectStatusCantConfirmAssociation = 11,
+  kConnectStatusAssociationDenied = 12,
+  kConnectStatusAuthenticationUnsupported = 13,
+  kConnectStatusOutOfSequence = 14,
+  kConnectStatusChallengeFailure = 15,
+  kConnectStatusFrameTimeout = 16,
+  kConnectStatusMaxSta = 17,
+  kConnectStatusDataRateUnsupported = 18,
+  kConnectStatusShortPreambleUnsupported = 19,
+  kConnectStatusPbccUnsupported = 20,
+  kConnectStatusChannelAgilityUnsupported = 21,
+  kConnectStatusNeedSpectrumManagement = 22,
+  kConnectStatusUnacceptablePowerCapability = 23,
+  kConnectStatusUnacceptableSupportedChannelInfo = 24,
+  kConnectStatusShortTimeSlotRequired = 25,
+  kConnectStatusErPbccRequired = 26,
+  kConnectStatusHtFeaturesRequired = 27,
+  kConnectStatusR0khUnreachable = 28,
+  kConnectStatusPcoTransitionRequired = 29,
+  kConnectStatusRejectedTemporarily = 30,
+  kConnectStatusRobustPolicyViolated = 31,
+  kConnectStatusQosFailure = 32,
+  kConnectStatusInsufficientBandwithForQsta = 33,
+  kConnectStatusPoorConditions = 34,
+  kConnectStatusQosNotSupported = 35,
+  kConnectStatusDeclined = 37,
+  kConnectStatusInvalidParameterValues = 38,
+  kConnectStatusCannotBeHonored = 39,
+  kConnectStatusInvalidInfoElement = 40,
+  kConnectStatusGroupCipherInvalid = 41,
+  kConnectStatusPairwiseCipherInvalid = 42,
+  kConnectStatusAkmpInvalid = 43,
+  kConnectStatusUnsupportedRsnIeVersion = 44,
+  kConnectStatusInvalidRsnIeCaps = 45,
+  kConnectStatusCipherSuiteRejected = 46,
+  kConnectStatusTsDelayNotMet = 47,
+  kConnectStatusDirectLinkIllegal = 48,
+  kConnectStatusStaNotInQbss = 49,
+  kConnectStatusStaNotInQsta = 50,
+  kConnectStatusExcessiveListenInterval = 51,
+  kConnectStatusInvalidFastBssFrameCount = 52,
+  kConnectStatusInvalidPmkid = 53,
+  kConnectStatusInvalidMdie = 54,
+  kConnectStatusInvalidFtie = 55,
+};
+
 }
 
 }  // namespace shill
diff --git a/shill_daemon.cc b/shill_daemon.cc
index 727d6f6..a86721b 100644
--- a/shill_daemon.cc
+++ b/shill_daemon.cc
@@ -12,6 +12,8 @@
 #include <base/bind.h>
 #include <base/file_path.h>
 
+#include "shill/callback80211_object.h"
+#include "shill/config80211.h"
 #include "shill/dhcp_provider.h"
 #include "shill/error.h"
 #include "shill/logging.h"
diff --git a/shill_daemon.h b/shill_daemon.h
index e027ca6..291a479 100644
--- a/shill_daemon.h
+++ b/shill_daemon.h
@@ -9,7 +9,6 @@
 
 #include <base/memory/scoped_ptr.h>
 
-#include "shill/config80211.h"
 #include "shill/event_dispatcher.h"
 #include "shill/glib.h"
 #include "shill/manager.h"
@@ -18,7 +17,9 @@
 
 namespace shill {
 
+class Callback80211Object;
 class Config;
+class Config80211;
 class ControlInterface;
 class DHCPProvider;
 class Error;
diff --git a/user_bound_nlmessage.cc b/user_bound_nlmessage.cc
index c2087ae..9d40f27 100644
--- a/user_bound_nlmessage.cc
+++ b/user_bound_nlmessage.cc
@@ -131,91 +131,135 @@
   // strings describing the status.
   if (!connect_status_map_) {
     connect_status_map_ = new map<uint16_t, string>;
-    (*connect_status_map_)[0] = "Successful";
-    (*connect_status_map_)[1] = "Unspecified failure";
-    (*connect_status_map_)[2] = "Previous authentication no longer valid";
-    (*connect_status_map_)[3] = "Deauthenticated because sending station is "
-        "leaving (or has left) the IBSS or ESS";
-    (*connect_status_map_)[7] = "Class 3 frame received from non-authenticated "
-        "station";
-    (*connect_status_map_)[10] = "Cannot support all requested capabilities in "
-        "the capability information field";
-    (*connect_status_map_)[11] = "Reassociation denied due to inability to "
-        "confirm that association exists";
-    (*connect_status_map_)[12] = "Association denied due to reason outside the "
-        "scope of this standard";
-    (*connect_status_map_)[13] = "Responding station does not support the "
-        "specified authentication algorithm";
-    (*connect_status_map_)[14] = "Received an authentication frame with "
-        "authentication transaction sequence number out of expected sequence";
-    (*connect_status_map_)[15] = "Authentication rejected because of challenge "
-        "failure";
-    (*connect_status_map_)[16] = "Authentication rejected due to timeout "
-        "waiting for next frame in sequence";
-    (*connect_status_map_)[17] = "Association denied because AP is unable to "
-        "handle additional associated STA";
-    (*connect_status_map_)[18] = "Association denied due to requesting station "
-        "not supporting all of the data rates in the BSSBasicRateSet parameter";
-    (*connect_status_map_)[19] = "Association denied due to requesting station "
-        "not supporting the short preamble option";
-    (*connect_status_map_)[20] = "Association denied due to requesting station "
-        "not supporting the PBCC modulation option";
-    (*connect_status_map_)[21] = "Association denied due to requesting station "
-        "not supporting the channel agility option";
-    (*connect_status_map_)[22] = "Association request rejected because "
-        "Spectrum Management capability is required";
-    (*connect_status_map_)[23] = "Association request rejected because the "
-        "information in the Power Capability element is unacceptable";
-    (*connect_status_map_)[24] = "Association request rejected because the "
-        "information in the Supported Channels element is unacceptable";
-    (*connect_status_map_)[25] = "Association request rejected due to "
-        "requesting station not supporting the short slot time option";
-    (*connect_status_map_)[26] = "Association request rejected due to "
-        "requesting station not supporting the ER-PBCC modulation option";
-    (*connect_status_map_)[27] = "Association denied due to requesting STA not "
-        "supporting HT features";
-    (*connect_status_map_)[28] = "R0KH Unreachable";
-    (*connect_status_map_)[29] = "Association denied because the requesting "
-        "STA does not support the PCO transition required by the AP";
-    (*connect_status_map_)[30] = "Association request rejected temporarily; "
-        "try again later";
-    (*connect_status_map_)[31] = "Robust Management frame policy violation";
-    (*connect_status_map_)[32] = "Unspecified, QoS related failure";
-    (*connect_status_map_)[33] = "Association denied due to QAP having "
-        "insufficient bandwidth to handle another QSTA";
-    (*connect_status_map_)[34] = "Association denied due to poor channel "
-        "conditions";
-    (*connect_status_map_)[35] = "Association (with QBSS) denied due to "
-        "requesting station not supporting the QoS facility";
-    (*connect_status_map_)[37] = "The request has been declined";
-    (*connect_status_map_)[38] = "The request has not been successful as one "
-        "or more parameters have invalid values";
-    (*connect_status_map_)[39] = "The TS has not been created because the "
-        "request cannot be honored. However, a suggested Tspec is provided so "
-        "that the initiating QSTA may attempt to send another TS with the "
-        "suggested changes to the TSpec";
-    (*connect_status_map_)[40] = "Invalid Information Element";
-    (*connect_status_map_)[41] = "Group Cipher is not valid";
-    (*connect_status_map_)[42] = "Pairwise Cipher is not valid";
-    (*connect_status_map_)[43] = "AKMP is not valid";
-    (*connect_status_map_)[44] = "Unsupported RSN IE version";
-    (*connect_status_map_)[45] = "Invalid RSN IE Capabilities";
-    (*connect_status_map_)[46] = "Cipher suite is rejected per security policy";
-    (*connect_status_map_)[47] = "The TS has not been created. However, the HC "
-        "may be capable of creating a TS, in response to a request, after the "
-        "time indicated in the TS Delay element";
-    (*connect_status_map_)[48] = "Direct link is not allowed in the BSS by "
-        "policy";
-    (*connect_status_map_)[49] = "Destination STA is not present within this "
-        "QBSS";
-    (*connect_status_map_)[50] = "The destination STA is not a QSTA";
-    (*connect_status_map_)[51] = "Association denied because Listen Interval "
-        "is too large";
-    (*connect_status_map_)[52] = "Invalid Fast BSS Transition Action Frame "
-        "Count";
-    (*connect_status_map_)[53] = "Invalid PMKID";
-    (*connect_status_map_)[54] = "Invalid MDIE";
-    (*connect_status_map_)[55] = "Invalid FTIE";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusSuccessful] = "Successful";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusFailure] =
+        "Unspecified failure";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusNoLongerValid] =
+        "Previous authentication no longer valid";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusSenderHasLeft] =
+        "Deauthenticated because sending station is leaving (or has left) the "
+        "IBSS or ESS";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusNonAuthenticated] =
+        "Class 3 frame received from non-authenticated station";
+    (*connect_status_map_)[
+        IEEE_80211::kConnectStatusAllCapabilitiesNotSupported] =
+        "Cannot support all requested capabilities in the capability "
+        "information field";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusCantConfirmAssociation] =
+        "Reassociation denied due to inability to confirm that association "
+        "exists";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusAssociationDenied] =
+        "Association denied due to reason outside the scope of this standard";
+    (*connect_status_map_)[
+        IEEE_80211::kConnectStatusAuthenticationUnsupported] =
+        "Responding station does not support the specified authentication "
+        "algorithm";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusOutOfSequence] =
+        "Received an authentication frame with authentication transaction "
+        "sequence number out of expected sequence";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusChallengeFailure] =
+        "Authentication rejected because of challenge failure";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusFrameTimeout] =
+        "Authentication rejected due to timeout waiting for next frame in "
+        "sequence";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusMaxSta] = "Association "
+        "denied because AP is unable to handle additional associated STA";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusDataRateUnsupported] =
+        "Association denied due to requesting station not supporting all of "
+        "the data rates in the BSSBasicRateSet parameter";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusShortPreambleUnsupported] =
+        "Association denied due to requesting station not supporting the "
+        "short preamble option";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusPbccUnsupported] =
+        "Association denied due to requesting station not supporting the PBCC "
+        "modulation option";
+    (*connect_status_map_)[
+        IEEE_80211::kConnectStatusChannelAgilityUnsupported] =
+        "Association denied due to requesting station not supporting the "
+        "channel agility option";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusNeedSpectrumManagement] =
+        "Association request rejected because Spectrum Management capability "
+        "is required";
+    (*connect_status_map_)[
+        IEEE_80211::kConnectStatusUnacceptablePowerCapability] =
+        "Association request rejected because the information in the Power "
+        "Capability element is unacceptable";
+    (*connect_status_map_)[
+        IEEE_80211::kConnectStatusUnacceptableSupportedChannelInfo] =
+        "Association request rejected because the information in the "
+        "Supported Channels element is unacceptable";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusShortTimeSlotRequired] =
+        "Association request rejected due to requesting station not "
+        "supporting the short slot time option";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusErPbccRequired] =
+        "Association request rejected due to requesting station not supporting "
+        "the ER-PBCC modulation option";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusHtFeaturesRequired] =
+        "Association denied due to requesting STA not supporting HT features";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusR0khUnreachable] = "R0KH "
+        "Unreachable";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusPcoTransitionRequired] =
+        "Association denied because the requesting STA does not support the "
+        "PCO transition required by the AP";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusRejectedTemporarily] =
+        "Association request rejected temporarily; try again later";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusRobustPolicyViolated] =
+        "Robust Management frame policy violation";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusQosFailure] =
+        "Unspecified, QoS related failure";
+    (*connect_status_map_)[
+        IEEE_80211::kConnectStatusInsufficientBandwithForQsta] =
+        "Association denied due to QAP having insufficient bandwidth to handle "
+        "another QSTA";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusPoorConditions] =
+        "Association denied due to poor channel conditions";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusQosNotSupported] =
+        "Association (with QBSS) denied due to requesting station not "
+        "supporting the QoS facility";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusDeclined] = "The request "
+        "has been declined";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusInvalidParameterValues] =
+        "The request has not been successful as one or more parameters have "
+        "invalid values";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusCannotBeHonored] = "The "
+        "TS has not been created because the request cannot be honored. "
+        "However, a suggested Tspec is provided so that the initiating QSTA "
+        "may attempt to send another TS with the suggested changes to the "
+        "TSpec";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusInvalidInfoElement] =
+        "Invalid Information Element";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusGroupCipherInvalid] =
+        "Group Cipher is not valid";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusPairwiseCipherInvalid] =
+        "Pairwise Cipher is not valid";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusAkmpInvalid] = "AKMP is "
+        "not valid";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusUnsupportedRsnIeVersion] =
+      "Unsupported RSN IE version";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusInvalidRsnIeCaps] =
+        "Invalid RSN IE Capabilities";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusCipherSuiteRejected] =
+        "Cipher suite is rejected per security policy";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusTsDelayNotMet] = "The TS "
+        "has not been created. However, the HC may be capable of creating a "
+        "TS, in response to a request, after the time indicated in the TS "
+        "Delay element";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusDirectLinkIllegal] =
+        "Direct link is not allowed in the BSS by policy";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusStaNotInQbss] =
+        "Destination STA is not present within this QBSS";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusStaNotInQsta] = "The "
+        "destination STA is not a QSTA";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusExcessiveListenInterval] =
+        "Association denied because Listen Interval is too large";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusInvalidFastBssFrameCount] =
+        "Invalid Fast BSS Transition Action Frame Count";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusInvalidPmkid] =
+        "Invalid PMKID";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusInvalidMdie] =
+        "Invalid MDIE";
+    (*connect_status_map_)[IEEE_80211::kConnectStatusInvalidFtie] =
+        "Invalid FTIE";
   }
 
   return true;
@@ -1751,15 +1795,8 @@
       message.reset(new ConnectMessage()); break;
     case DeauthenticateMessage::kCommand:
       message.reset(new DeauthenticateMessage()); break;
-
-#if 0
-    // TODO(wdg): our version of 'iw' doesn't have this so I can't put it in
-    // without breaking the diff.  Remove the 'if 0' after the unit tests are
-    // added.
     case DeleteStationMessage::kCommand:
       message.reset(new DeleteStationMessage()); break;
-#endif
-
     case DisassociateMessage::kCommand:
       message.reset(new DisassociateMessage()); break;
     case DisconnectMessage::kCommand:
diff --git a/user_bound_nlmessage.h b/user_bound_nlmessage.h
index e3a9427..c727660 100644
--- a/user_bound_nlmessage.h
+++ b/user_bound_nlmessage.h
@@ -38,6 +38,7 @@
     kTypeOther,  // Specified in the message but not listed, here.
     kTypeError
   };
+
   // TODO(wdg): break 'Attribute' into its own class to handle
   // nested attributes better.