shill: Config80211 Cleanup.

Just cleaning up a bunch of things that didn't fit anywhere else.

Added |ToString| methods to several classes to make them easier to debug
(changed some things from |AsString| to |ToString| to make it consistent
with the rest of the code base).

Put error-returning getters/setters in Nl80211Attribute to eliminate the
need for specific casts (and, removed the casts in other parts of the
code).

Converted AttributeList::attributes_ to use a smart pointer.

Removed AttributeList's dependency on Nl80211Attribute.

BUG=None.
TEST=Unit tests.

Change-Id: I630bf59a4f73bee71953fe8faeb1d8f6a168cb29
Reviewed-on: https://gerrit.chromium.org/gerrit/40144
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Wade Guthrie <wdg@chromium.org>
Tested-by: Wade Guthrie <wdg@chromium.org>
Commit-Queue: Wade Guthrie <wdg@chromium.org>
diff --git a/user_bound_nlmessage.cc b/user_bound_nlmessage.cc
index d82c8ae..9afaeaf 100644
--- a/user_bound_nlmessage.cc
+++ b/user_bound_nlmessage.cc
@@ -47,6 +47,7 @@
 #include "shill/attribute_list.h"
 #include "shill/ieee80211.h"
 #include "shill/logging.h"
+#include "shill/nl80211_attribute.h"
 #include "shill/scope_logger.h"
 
 using base::LazyInstance;
@@ -537,6 +538,14 @@
   return match->second;
 }
 
+string UserBoundNlMessage::GenericToString() const {
+  string output;
+  StringAppendF(&output, "Received %s (%d)\n",
+                message_type_string(), message_type());
+  StringAppendF(&output, "%s", attributes_.ToString().c_str());
+  return output;
+}
+
 Nl80211Frame::Nl80211Frame(const ByteString &raw_frame)
   : frame_type_(kIllegalFrameType), reason_(UINT16_MAX), status_(UINT16_MAX),
     frame_(raw_frame) {