repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "shill/attribute_list.h" |
| 6 | |
| 7 | #include <ctype.h> |
| 8 | #include <linux/nl80211.h> |
| 9 | #include <netlink/attr.h> |
| 10 | #include <netlink/netlink.h> |
| 11 | |
| 12 | #include <iomanip> |
| 13 | #include <map> |
| 14 | #include <string> |
| 15 | |
| 16 | #include <base/stl_util.h> |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 17 | #include <base/stringprintf.h> |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 18 | |
| 19 | #include "shill/logging.h" |
| 20 | #include "shill/nl80211_attribute.h" |
| 21 | #include "shill/scope_logger.h" |
| 22 | |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 23 | using base::StringAppendF; |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 24 | using base::WeakPtr; |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 25 | using std::map; |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 26 | using std::string; |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 27 | |
| 28 | namespace shill { |
| 29 | |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 30 | bool AttributeList::CreateAttribute(nl80211_attrs id) { |
| 31 | if (ContainsKey(attributes_, id)) { |
| 32 | LOG(ERROR) << "Trying to re-add attribute: " << id; |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 33 | return false; |
| 34 | } |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 35 | attributes_[id] = AttributePointer(Nl80211Attribute::NewFromName(id)); |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 36 | return true; |
| 37 | } |
| 38 | |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 39 | bool AttributeList::CreateAndInitFromNlAttr(nl80211_attrs id, |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 40 | const nlattr *data) { |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 41 | if (!CreateAttribute(id)) { |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 42 | return false; |
| 43 | } |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 44 | return attributes_[id]->InitFromNlAttr(data); |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 45 | } |
| 46 | |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 47 | string AttributeList::ToString() const { |
| 48 | string output; |
| 49 | map<int, AttributePointer>::const_iterator i; |
| 50 | |
| 51 | for (i = attributes_.begin(); i != attributes_.end(); ++i) { |
| 52 | string attribute_string; |
| 53 | i->second->ToString(&attribute_string); |
| 54 | StringAppendF(&output, " Attr: %s(%d)=%s, Type: %s\n", |
| 55 | i->second->id_string(), |
| 56 | i->second->id(), |
| 57 | attribute_string.c_str(), |
| 58 | i->second->datatype_string()); |
| 59 | } |
| 60 | return output; |
| 61 | } |
| 62 | |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 63 | // U8 Attribute. |
| 64 | |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 65 | bool AttributeList::GetU8AttributeValue(int id, uint8_t *value) const { |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 66 | Nl80211Attribute *attribute = GetAttribute(id); |
| 67 | if (!attribute) |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 68 | return false; |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 69 | return attribute->GetU8Value(value); |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 70 | } |
| 71 | |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 72 | bool AttributeList::CreateU8Attribute(int id, const char *id_string) { |
| 73 | if (ContainsKey(attributes_, id)) { |
| 74 | LOG(ERROR) << "Trying to re-add attribute: " << id; |
| 75 | return false; |
| 76 | } |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 77 | attributes_[id] = AttributePointer( |
| 78 | new Nl80211U8Attribute(id, id_string)); |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 79 | return true; |
| 80 | } |
| 81 | |
| 82 | bool AttributeList::SetU8AttributeValue(int id, uint8_t value) const { |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 83 | Nl80211Attribute *attribute = GetAttribute(id); |
| 84 | if (!attribute) |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 85 | return false; |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 86 | return attribute->SetU8Value(value); |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 87 | } |
| 88 | |
| 89 | |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 90 | // U16 Attribute. |
| 91 | |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 92 | bool AttributeList::GetU16AttributeValue(int id, uint16_t *value) const { |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 93 | Nl80211Attribute *attribute = GetAttribute(id); |
| 94 | if (!attribute) |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 95 | return false; |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 96 | return attribute->GetU16Value(value); |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 97 | } |
| 98 | |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 99 | bool AttributeList::CreateU16Attribute(int id, const char *id_string) { |
| 100 | if (ContainsKey(attributes_, id)) { |
| 101 | LOG(ERROR) << "Trying to re-add attribute: " << id; |
| 102 | return false; |
| 103 | } |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 104 | attributes_[id] = AttributePointer( |
| 105 | new Nl80211U16Attribute(id, id_string)); |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 106 | return true; |
| 107 | } |
| 108 | |
| 109 | bool AttributeList::SetU16AttributeValue(int id, uint16_t value) const { |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 110 | Nl80211Attribute *attribute = GetAttribute(id); |
| 111 | if (!attribute) |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 112 | return false; |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 113 | return attribute->SetU16Value(value); |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 114 | } |
| 115 | |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 116 | // U32 Attribute. |
| 117 | |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 118 | bool AttributeList::GetU32AttributeValue(int id, uint32_t *value) const { |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 119 | Nl80211Attribute *attribute = GetAttribute(id); |
| 120 | if (!attribute) |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 121 | return false; |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 122 | return attribute->GetU32Value(value); |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 123 | } |
| 124 | |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 125 | bool AttributeList::CreateU32Attribute(int id, const char *id_string) { |
| 126 | if (ContainsKey(attributes_, id)) { |
| 127 | LOG(ERROR) << "Trying to re-add attribute: " << id; |
| 128 | return false; |
| 129 | } |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 130 | attributes_[id] = AttributePointer( |
| 131 | new Nl80211U32Attribute(id, id_string)); |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 132 | return true; |
| 133 | } |
| 134 | |
| 135 | bool AttributeList::SetU32AttributeValue(int id, uint32_t value) const { |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 136 | Nl80211Attribute *attribute = GetAttribute(id); |
| 137 | if (!attribute) |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 138 | return false; |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 139 | return attribute->SetU32Value(value); |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 140 | } |
| 141 | |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 142 | // U64 Attribute. |
| 143 | |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 144 | bool AttributeList::GetU64AttributeValue(int id, uint64_t *value) const { |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 145 | Nl80211Attribute *attribute = GetAttribute(id); |
| 146 | if (!attribute) |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 147 | return false; |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 148 | return attribute->GetU64Value(value); |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 149 | } |
| 150 | |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 151 | bool AttributeList::CreateU64Attribute(int id, const char *id_string) { |
| 152 | if (ContainsKey(attributes_, id)) { |
| 153 | LOG(ERROR) << "Trying to re-add attribute: " << id; |
| 154 | return false; |
| 155 | } |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 156 | attributes_[id] = AttributePointer( |
| 157 | new Nl80211U64Attribute(id, id_string)); |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 158 | return true; |
| 159 | } |
| 160 | |
| 161 | bool AttributeList::SetU64AttributeValue(int id, uint64_t value) const { |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 162 | Nl80211Attribute *attribute = GetAttribute(id); |
| 163 | if (!attribute) |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 164 | return false; |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 165 | return attribute->SetU64Value(value); |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 166 | } |
| 167 | |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 168 | // Flag Attribute. |
| 169 | |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 170 | bool AttributeList::GetFlagAttributeValue(int id, bool *value) const { |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 171 | Nl80211Attribute *attribute = GetAttribute(id); |
| 172 | if (!attribute) |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 173 | return false; |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 174 | return attribute->GetFlagValue(value); |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 175 | } |
| 176 | |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 177 | bool AttributeList::CreateFlagAttribute(int id, const char *id_string) { |
| 178 | if (ContainsKey(attributes_, id)) { |
| 179 | LOG(ERROR) << "Trying to re-add attribute: " << id; |
| 180 | return false; |
| 181 | } |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 182 | attributes_[id] = AttributePointer( |
| 183 | new Nl80211FlagAttribute(id, id_string)); |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 184 | return true; |
| 185 | } |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 186 | |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 187 | bool AttributeList::SetFlagAttributeValue(int id, bool value) const { |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 188 | Nl80211Attribute *attribute = GetAttribute(id); |
| 189 | if (!attribute) |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 190 | return false; |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 191 | return attribute->SetFlagValue(value); |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 192 | } |
| 193 | |
| 194 | bool AttributeList::IsFlagAttributeTrue(int id) const { |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 195 | bool flag; |
| 196 | if (!GetFlagAttributeValue(id, &flag)) { |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 197 | return false; |
| 198 | } |
| 199 | return flag; |
| 200 | } |
| 201 | |
| 202 | // String Attribute. |
| 203 | |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 204 | bool AttributeList::GetStringAttributeValue(int id, string *value) const { |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 205 | Nl80211Attribute *attribute = GetAttribute(id); |
| 206 | if (!attribute) |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 207 | return false; |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 208 | return attribute->GetStringValue(value); |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 209 | } |
| 210 | |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 211 | bool AttributeList::CreateStringAttribute(int id, const char *id_string) { |
| 212 | if (ContainsKey(attributes_, id)) { |
| 213 | LOG(ERROR) << "Trying to re-add attribute: " << id; |
| 214 | return false; |
| 215 | } |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 216 | attributes_[id] = AttributePointer( |
| 217 | new Nl80211StringAttribute(id, id_string)); |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 218 | return true; |
| 219 | } |
| 220 | |
| 221 | bool AttributeList::SetStringAttributeValue(int id, string value) const { |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 222 | Nl80211Attribute *attribute = GetAttribute(id); |
| 223 | if (!attribute) |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 224 | return false; |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 225 | return attribute->SetStringValue(value); |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 226 | } |
| 227 | |
| 228 | // Nested Attribute. |
| 229 | |
| 230 | bool AttributeList::GetNestedAttributeValue( |
| 231 | int id, WeakPtr<AttributeList> *value) const { |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 232 | Nl80211Attribute *attribute = GetAttribute(id); |
| 233 | if (!attribute) |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 234 | return false; |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 235 | return attribute->GetNestedValue(value); |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 236 | } |
| 237 | |
| 238 | bool AttributeList::CreateNestedAttribute(int id, const char *id_string) { |
| 239 | if (ContainsKey(attributes_, id)) { |
| 240 | LOG(ERROR) << "Trying to re-add attribute: " << id; |
| 241 | return false; |
| 242 | } |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 243 | attributes_[id] = AttributePointer( |
| 244 | new Nl80211NestedAttribute(id, id_string)); |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 245 | return true; |
| 246 | } |
| 247 | |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 248 | // Raw Attribute. |
| 249 | |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 250 | bool AttributeList::GetRawAttributeValue(int id, |
| 251 | ByteString *output) const { |
| 252 | Nl80211Attribute *attribute = GetAttribute(id); |
| 253 | if (!attribute) |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 254 | return false; |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 255 | |
| 256 | ByteString raw_value; |
| 257 | |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 258 | if (!attribute->GetRawValue(&raw_value)) |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 259 | return false; |
| 260 | |
| 261 | if (output) { |
| 262 | const nlattr *const_data = |
| 263 | reinterpret_cast<const nlattr *>(raw_value.GetConstData()); |
| 264 | // nla_data and nla_len don't change their parameters but don't declare |
| 265 | // them to be const. Hence the cast. |
| 266 | nlattr *data_nlattr = const_cast<nlattr *>(const_data); |
| 267 | *output = ByteString( |
| 268 | reinterpret_cast<unsigned char *>(nla_data(data_nlattr)), |
| 269 | nla_len(data_nlattr)); |
| 270 | } |
| 271 | return true; |
| 272 | } |
| 273 | |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 274 | const Nl80211RawAttribute *AttributeList::GetRawAttribute( |
| 275 | int id) const { |
| 276 | if (!HasRawAttribute(id)) { |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 277 | LOG(ERROR) << "No attribute " << id << " of type kTypeRaw exists."; |
| 278 | return NULL; |
| 279 | } |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 280 | const Nl80211RawAttribute *attr = |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 281 | reinterpret_cast<const Nl80211RawAttribute *>(GetAttribute(id)); |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 282 | return attr; |
| 283 | } |
| 284 | |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 285 | Nl80211Attribute *AttributeList::GetAttribute(int id) const { |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 286 | map<int, AttributePointer>::const_iterator i; |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 287 | i = attributes_.find(id); |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 288 | if (i == attributes_.end()) { |
| 289 | return NULL; |
| 290 | } |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 291 | return i->second.get(); |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 292 | } |
| 293 | |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 294 | bool AttributeList::HasRawAttribute(int id) const { |
| 295 | map<int, AttributePointer>::const_iterator i; |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 296 | i = attributes_.find(id); |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 297 | if (i == attributes_.end()) { |
repo sync | 12cca80 | 2012-12-19 17:34:22 -0800 | [diff] [blame] | 298 | LOG(ERROR) << "FALSE - Didn't find id " << id; |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 299 | return false; |
| 300 | } |
repo sync | 1538d44 | 2012-12-20 15:24:35 -0800 | [diff] [blame^] | 301 | return (i->second->datatype() == Nl80211Attribute::kTypeRaw) ? true : false; |
repo sync | 90ee0fa | 2012-12-18 10:08:08 -0800 | [diff] [blame] | 302 | } |
| 303 | |
| 304 | |
| 305 | } // namespace shill |