blob: 463ac70ed35a4ea357ff25aef2fdfa2726f3e7cd [file] [log] [blame]
Wade Guthrie16196242012-11-20 15:53:52 -08001// 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
Wade Guthrief162f8b2013-02-27 14:13:55 -08005#ifndef SHILL_NL80211_ATTRIBUTE_H_
6#define SHILL_NL80211_ATTRIBUTE_H_
Wade Guthrie16196242012-11-20 15:53:52 -08007
Wade Guthrie8343f7f2012-12-04 13:52:32 -08008#include <netlink/attr.h>
Wade Guthrie16196242012-11-20 15:53:52 -08009
Wade Guthrie89e6cb32013-03-07 08:03:45 -080010#include <base/basictypes.h>
11
Wade Guthrief162f8b2013-02-27 14:13:55 -080012#include "shill/netlink_attribute.h"
Wade Guthrie16196242012-11-20 15:53:52 -080013
14struct nlattr;
15
16namespace shill {
17
Wade Guthrie25cdb382012-12-04 14:04:05 -080018// U8.
Wade Guthrie16196242012-11-20 15:53:52 -080019
Wade Guthrie68da97c2013-02-26 13:09:35 -080020class Nl80211AttributeKeyIdx : public NetlinkU8Attribute {
Wade Guthrie25cdb382012-12-04 14:04:05 -080021 public:
Wade Guthrie68da97c2013-02-26 13:09:35 -080022 static const int kName;
Wade Guthrie25cdb382012-12-04 14:04:05 -080023 static const char kNameString[];
Wade Guthrie68da97c2013-02-26 13:09:35 -080024 Nl80211AttributeKeyIdx() : NetlinkU8Attribute(kName, kNameString) {}
Wade Guthrie89e6cb32013-03-07 08:03:45 -080025
26 private:
27 DISALLOW_COPY_AND_ASSIGN(Nl80211AttributeKeyIdx);
Wade Guthrie25cdb382012-12-04 14:04:05 -080028};
29
Wade Guthrie68da97c2013-02-26 13:09:35 -080030class Nl80211AttributeRegType : public NetlinkU8Attribute {
Wade Guthrie25cdb382012-12-04 14:04:05 -080031 public:
Wade Guthrie68da97c2013-02-26 13:09:35 -080032 static const int kName;
Wade Guthrie25cdb382012-12-04 14:04:05 -080033 static const char kNameString[];
Wade Guthrie68da97c2013-02-26 13:09:35 -080034 Nl80211AttributeRegType() : NetlinkU8Attribute(kName, kNameString) {}
Wade Guthrie89e6cb32013-03-07 08:03:45 -080035
36 private:
37 DISALLOW_COPY_AND_ASSIGN(Nl80211AttributeRegType);
Wade Guthrie25cdb382012-12-04 14:04:05 -080038};
39
40// U16.
41
Wade Guthrie68da97c2013-02-26 13:09:35 -080042class Nl80211AttributeReasonCode : public NetlinkU16Attribute {
Wade Guthrie25cdb382012-12-04 14:04:05 -080043 public:
Wade Guthrie68da97c2013-02-26 13:09:35 -080044 static const int kName;
Wade Guthrie25cdb382012-12-04 14:04:05 -080045 static const char kNameString[];
Wade Guthrie68da97c2013-02-26 13:09:35 -080046 Nl80211AttributeReasonCode() : NetlinkU16Attribute(kName, kNameString) {}
Wade Guthrie89e6cb32013-03-07 08:03:45 -080047
48 private:
49 DISALLOW_COPY_AND_ASSIGN(Nl80211AttributeReasonCode);
Wade Guthrie25cdb382012-12-04 14:04:05 -080050};
51
Wade Guthrie68da97c2013-02-26 13:09:35 -080052class Nl80211AttributeStatusCode : public NetlinkU16Attribute {
Wade Guthrie25cdb382012-12-04 14:04:05 -080053 public:
Wade Guthrie68da97c2013-02-26 13:09:35 -080054 static const int kName;
Wade Guthrie25cdb382012-12-04 14:04:05 -080055 static const char kNameString[];
Wade Guthrie68da97c2013-02-26 13:09:35 -080056 Nl80211AttributeStatusCode() : NetlinkU16Attribute(kName, kNameString) {}
Wade Guthrie89e6cb32013-03-07 08:03:45 -080057
58 private:
59 DISALLOW_COPY_AND_ASSIGN(Nl80211AttributeStatusCode);
Wade Guthrie25cdb382012-12-04 14:04:05 -080060};
61
62// U32.
63
Wade Guthrie68da97c2013-02-26 13:09:35 -080064class Nl80211AttributeDuration : public NetlinkU32Attribute {
Wade Guthrie25cdb382012-12-04 14:04:05 -080065 public:
Wade Guthrie68da97c2013-02-26 13:09:35 -080066 static const int kName;
Wade Guthrie25cdb382012-12-04 14:04:05 -080067 static const char kNameString[];
Wade Guthrie68da97c2013-02-26 13:09:35 -080068 Nl80211AttributeDuration() : NetlinkU32Attribute(kName, kNameString) {}
Wade Guthrie89e6cb32013-03-07 08:03:45 -080069
70 private:
71 DISALLOW_COPY_AND_ASSIGN(Nl80211AttributeDuration);
Wade Guthrie25cdb382012-12-04 14:04:05 -080072};
73
Wade Guthrie68da97c2013-02-26 13:09:35 -080074class Nl80211AttributeGeneration : public NetlinkU32Attribute {
Wade Guthrie25cdb382012-12-04 14:04:05 -080075 public:
Wade Guthrie68da97c2013-02-26 13:09:35 -080076 static const int kName;
Wade Guthrie25cdb382012-12-04 14:04:05 -080077 static const char kNameString[];
Wade Guthrie68da97c2013-02-26 13:09:35 -080078 Nl80211AttributeGeneration() : NetlinkU32Attribute(kName, kNameString) {}
Wade Guthrie89e6cb32013-03-07 08:03:45 -080079
80 private:
81 DISALLOW_COPY_AND_ASSIGN(Nl80211AttributeGeneration);
Wade Guthrie25cdb382012-12-04 14:04:05 -080082};
83
Wade Guthrie68da97c2013-02-26 13:09:35 -080084class Nl80211AttributeIfindex : public NetlinkU32Attribute {
Wade Guthrie25cdb382012-12-04 14:04:05 -080085 public:
Wade Guthrie68da97c2013-02-26 13:09:35 -080086 static const int kName;
Wade Guthrie25cdb382012-12-04 14:04:05 -080087 static const char kNameString[];
Wade Guthrie68da97c2013-02-26 13:09:35 -080088 Nl80211AttributeIfindex() : NetlinkU32Attribute(kName, kNameString) {}
Wade Guthrie89e6cb32013-03-07 08:03:45 -080089
90 private:
91 DISALLOW_COPY_AND_ASSIGN(Nl80211AttributeIfindex);
Wade Guthrie25cdb382012-12-04 14:04:05 -080092};
93
Paul Stewart2ddf2c62013-04-16 09:47:34 -070094class Nl80211AttributeIftype : public NetlinkU32Attribute {
95 public:
96 static const int kName;
97 static const char kNameString[];
98 Nl80211AttributeIftype() : NetlinkU32Attribute(kName, kNameString) {}
99
100 private:
101 DISALLOW_COPY_AND_ASSIGN(Nl80211AttributeIftype);
102};
103
Wade Guthrie68da97c2013-02-26 13:09:35 -0800104class Nl80211AttributeKeyType : public NetlinkU32Attribute {
Wade Guthrie25cdb382012-12-04 14:04:05 -0800105 public:
Wade Guthrie68da97c2013-02-26 13:09:35 -0800106 static const int kName;
Wade Guthrie25cdb382012-12-04 14:04:05 -0800107 static const char kNameString[];
Wade Guthrie68da97c2013-02-26 13:09:35 -0800108 Nl80211AttributeKeyType() : NetlinkU32Attribute(kName, kNameString) {}
Wade Guthrie89e6cb32013-03-07 08:03:45 -0800109
110 private:
111 DISALLOW_COPY_AND_ASSIGN(Nl80211AttributeKeyType);
Wade Guthrie25cdb382012-12-04 14:04:05 -0800112};
113
Wade Guthrie68da97c2013-02-26 13:09:35 -0800114class Nl80211AttributeRegInitiator : public NetlinkU32Attribute {
Wade Guthrie25cdb382012-12-04 14:04:05 -0800115 public:
Wade Guthrie68da97c2013-02-26 13:09:35 -0800116 static const int kName;
Wade Guthrie25cdb382012-12-04 14:04:05 -0800117 static const char kNameString[];
Wade Guthrie68da97c2013-02-26 13:09:35 -0800118 Nl80211AttributeRegInitiator() : NetlinkU32Attribute(kName, kNameString) {}
Wade Guthrie89e6cb32013-03-07 08:03:45 -0800119
120 private:
121 DISALLOW_COPY_AND_ASSIGN(Nl80211AttributeRegInitiator);
Wade Guthrie25cdb382012-12-04 14:04:05 -0800122};
123
Wade Guthrie68da97c2013-02-26 13:09:35 -0800124class Nl80211AttributeWiphy : public NetlinkU32Attribute {
Wade Guthrie25cdb382012-12-04 14:04:05 -0800125 public:
Wade Guthrie68da97c2013-02-26 13:09:35 -0800126 static const int kName;
Wade Guthrie25cdb382012-12-04 14:04:05 -0800127 static const char kNameString[];
Wade Guthrie68da97c2013-02-26 13:09:35 -0800128 Nl80211AttributeWiphy() : NetlinkU32Attribute(kName, kNameString) {}
Wade Guthrie89e6cb32013-03-07 08:03:45 -0800129
130 private:
131 DISALLOW_COPY_AND_ASSIGN(Nl80211AttributeWiphy);
Wade Guthrie25cdb382012-12-04 14:04:05 -0800132};
133
Wade Guthrie68da97c2013-02-26 13:09:35 -0800134class Nl80211AttributeWiphyFreq : public NetlinkU32Attribute {
Wade Guthrie25cdb382012-12-04 14:04:05 -0800135 public:
Wade Guthrie68da97c2013-02-26 13:09:35 -0800136 static const int kName;
Wade Guthrie25cdb382012-12-04 14:04:05 -0800137 static const char kNameString[];
Wade Guthrie68da97c2013-02-26 13:09:35 -0800138 Nl80211AttributeWiphyFreq() : NetlinkU32Attribute(kName, kNameString) {}
Wade Guthrie89e6cb32013-03-07 08:03:45 -0800139
140 private:
141 DISALLOW_COPY_AND_ASSIGN(Nl80211AttributeWiphyFreq);
Wade Guthrie25cdb382012-12-04 14:04:05 -0800142};
143
144// U64.
145
Wade Guthrie68da97c2013-02-26 13:09:35 -0800146class Nl80211AttributeCookie : public NetlinkU64Attribute {
Wade Guthrie25cdb382012-12-04 14:04:05 -0800147 public:
Wade Guthrie68da97c2013-02-26 13:09:35 -0800148 static const int kName;
Wade Guthrie25cdb382012-12-04 14:04:05 -0800149 static const char kNameString[];
Wade Guthrie68da97c2013-02-26 13:09:35 -0800150 Nl80211AttributeCookie() : NetlinkU64Attribute(kName, kNameString) {}
Wade Guthrie89e6cb32013-03-07 08:03:45 -0800151
152 private:
153 DISALLOW_COPY_AND_ASSIGN(Nl80211AttributeCookie);
Wade Guthrie25cdb382012-12-04 14:04:05 -0800154};
155
156// Flag.
157
Wade Guthrie68da97c2013-02-26 13:09:35 -0800158class Nl80211AttributeDisconnectedByAp : public NetlinkFlagAttribute {
Wade Guthrie25cdb382012-12-04 14:04:05 -0800159 public:
Wade Guthrie68da97c2013-02-26 13:09:35 -0800160 static const int kName;
Wade Guthrie25cdb382012-12-04 14:04:05 -0800161 static const char kNameString[];
162 Nl80211AttributeDisconnectedByAp() :
Wade Guthrie68da97c2013-02-26 13:09:35 -0800163 NetlinkFlagAttribute(kName, kNameString) {}
Wade Guthrie89e6cb32013-03-07 08:03:45 -0800164
165 private:
166 DISALLOW_COPY_AND_ASSIGN(Nl80211AttributeDisconnectedByAp);
Wade Guthrie25cdb382012-12-04 14:04:05 -0800167};
168
Wade Guthrie68da97c2013-02-26 13:09:35 -0800169class Nl80211AttributeSupportMeshAuth : public NetlinkFlagAttribute {
Wade Guthrie25cdb382012-12-04 14:04:05 -0800170 public:
Wade Guthrie68da97c2013-02-26 13:09:35 -0800171 static const int kName;
Wade Guthrie25cdb382012-12-04 14:04:05 -0800172 static const char kNameString[];
173 Nl80211AttributeSupportMeshAuth() :
Wade Guthrie68da97c2013-02-26 13:09:35 -0800174 NetlinkFlagAttribute(kName, kNameString) {}
Wade Guthrie89e6cb32013-03-07 08:03:45 -0800175
176 private:
177 DISALLOW_COPY_AND_ASSIGN(Nl80211AttributeSupportMeshAuth);
Wade Guthrie25cdb382012-12-04 14:04:05 -0800178};
179
Wade Guthrie68da97c2013-02-26 13:09:35 -0800180class Nl80211AttributeTimedOut : public NetlinkFlagAttribute {
Wade Guthrie25cdb382012-12-04 14:04:05 -0800181 public:
Wade Guthrie68da97c2013-02-26 13:09:35 -0800182 static const int kName;
Wade Guthrie25cdb382012-12-04 14:04:05 -0800183 static const char kNameString[];
Wade Guthrie68da97c2013-02-26 13:09:35 -0800184 Nl80211AttributeTimedOut() : NetlinkFlagAttribute(kName, kNameString) {}
Wade Guthrie89e6cb32013-03-07 08:03:45 -0800185
186 private:
187 DISALLOW_COPY_AND_ASSIGN(Nl80211AttributeTimedOut);
Wade Guthrie25cdb382012-12-04 14:04:05 -0800188};
189
190// String.
191
Wade Guthrie68da97c2013-02-26 13:09:35 -0800192class Nl80211AttributeRegAlpha2 : public NetlinkStringAttribute {
Wade Guthrie25cdb382012-12-04 14:04:05 -0800193 public:
Wade Guthrie68da97c2013-02-26 13:09:35 -0800194 static const int kName;
Wade Guthrie25cdb382012-12-04 14:04:05 -0800195 static const char kNameString[];
Wade Guthrie68da97c2013-02-26 13:09:35 -0800196 Nl80211AttributeRegAlpha2() : NetlinkStringAttribute(kName, kNameString) {}
Wade Guthrie89e6cb32013-03-07 08:03:45 -0800197
198 private:
199 DISALLOW_COPY_AND_ASSIGN(Nl80211AttributeRegAlpha2);
Wade Guthrie25cdb382012-12-04 14:04:05 -0800200};
201
Wade Guthrie68da97c2013-02-26 13:09:35 -0800202class Nl80211AttributeWiphyName : public NetlinkStringAttribute {
Wade Guthrie25cdb382012-12-04 14:04:05 -0800203 public:
Wade Guthrie68da97c2013-02-26 13:09:35 -0800204 static const int kName;
Wade Guthrie25cdb382012-12-04 14:04:05 -0800205 static const char kNameString[];
Wade Guthrie68da97c2013-02-26 13:09:35 -0800206 Nl80211AttributeWiphyName() : NetlinkStringAttribute(kName, kNameString) {}
Wade Guthrie89e6cb32013-03-07 08:03:45 -0800207
208 private:
209 DISALLOW_COPY_AND_ASSIGN(Nl80211AttributeWiphyName);
Wade Guthrie25cdb382012-12-04 14:04:05 -0800210};
211
repo sync12cca802012-12-19 17:34:22 -0800212// Nested.
213
Wade Guthrie68da97c2013-02-26 13:09:35 -0800214class Nl80211AttributeCqm : public NetlinkNestedAttribute {
repo sync12cca802012-12-19 17:34:22 -0800215 public:
Wade Guthrie68da97c2013-02-26 13:09:35 -0800216 static const int kName;
repo sync12cca802012-12-19 17:34:22 -0800217 static const char kNameString[];
218 Nl80211AttributeCqm();
Wade Guthrie89e6cb32013-03-07 08:03:45 -0800219
220 private:
221 DISALLOW_COPY_AND_ASSIGN(Nl80211AttributeCqm);
Wade Guthried3dfd6c2013-02-28 17:40:36 -0800222};
223
224class Nl80211AttributeScanFrequencies : public NetlinkNestedAttribute {
225 public:
226 static const int kName;
227 static const char kNameString[];
228 explicit Nl80211AttributeScanFrequencies();
Wade Guthrie89e6cb32013-03-07 08:03:45 -0800229
230 private:
231 DISALLOW_COPY_AND_ASSIGN(Nl80211AttributeScanFrequencies);
Wade Guthried3dfd6c2013-02-28 17:40:36 -0800232};
233
234class Nl80211AttributeScanSsids : public NetlinkNestedAttribute {
235 public:
236 static const int kName;
237 static const char kNameString[];
238 explicit Nl80211AttributeScanSsids();
Wade Guthrie89e6cb32013-03-07 08:03:45 -0800239
240 private:
241 DISALLOW_COPY_AND_ASSIGN(Nl80211AttributeScanSsids);
repo sync12cca802012-12-19 17:34:22 -0800242};
243
Wade Guthrie68da97c2013-02-26 13:09:35 -0800244class Nl80211AttributeStaInfo : public NetlinkNestedAttribute {
repo sync12cca802012-12-19 17:34:22 -0800245 public:
Wade Guthrie68da97c2013-02-26 13:09:35 -0800246 static const int kName;
repo sync12cca802012-12-19 17:34:22 -0800247 static const char kNameString[];
Wade Guthried3dfd6c2013-02-28 17:40:36 -0800248 Nl80211AttributeStaInfo();
Wade Guthrie89e6cb32013-03-07 08:03:45 -0800249
250 private:
251 DISALLOW_COPY_AND_ASSIGN(Nl80211AttributeStaInfo);
repo sync12cca802012-12-19 17:34:22 -0800252};
253
Wade Guthrie25cdb382012-12-04 14:04:05 -0800254// Raw.
255
Wade Guthrie68da97c2013-02-26 13:09:35 -0800256class Nl80211AttributeFrame : public NetlinkRawAttribute {
Wade Guthrie25cdb382012-12-04 14:04:05 -0800257 public:
Wade Guthrie68da97c2013-02-26 13:09:35 -0800258 static const int kName;
Wade Guthrie25cdb382012-12-04 14:04:05 -0800259 static const char kNameString[];
Wade Guthrie68da97c2013-02-26 13:09:35 -0800260 Nl80211AttributeFrame() : NetlinkRawAttribute(kName, kNameString) {}
Wade Guthrie89e6cb32013-03-07 08:03:45 -0800261
262 private:
263 DISALLOW_COPY_AND_ASSIGN(Nl80211AttributeFrame);
Wade Guthrie16196242012-11-20 15:53:52 -0800264};
265
Wade Guthrie68da97c2013-02-26 13:09:35 -0800266class Nl80211AttributeKeySeq : public NetlinkRawAttribute {
Wade Guthrie25cdb382012-12-04 14:04:05 -0800267 public:
Wade Guthrie68da97c2013-02-26 13:09:35 -0800268 static const int kName;
Wade Guthrie25cdb382012-12-04 14:04:05 -0800269 static const char kNameString[];
Wade Guthrie68da97c2013-02-26 13:09:35 -0800270 Nl80211AttributeKeySeq() : NetlinkRawAttribute(kName, kNameString) {}
Wade Guthrie89e6cb32013-03-07 08:03:45 -0800271
272 private:
273 DISALLOW_COPY_AND_ASSIGN(Nl80211AttributeKeySeq);
Wade Guthrie25cdb382012-12-04 14:04:05 -0800274};
275
Wade Guthrie68da97c2013-02-26 13:09:35 -0800276class Nl80211AttributeMac : public NetlinkRawAttribute {
Wade Guthrie25cdb382012-12-04 14:04:05 -0800277 public:
Wade Guthrie68da97c2013-02-26 13:09:35 -0800278 static const int kName;
Wade Guthrie25cdb382012-12-04 14:04:05 -0800279 static const char kNameString[];
Wade Guthrie68da97c2013-02-26 13:09:35 -0800280 Nl80211AttributeMac() : NetlinkRawAttribute(kName, kNameString) {}
Wade Guthrie89e6cb32013-03-07 08:03:45 -0800281
282 private:
283 DISALLOW_COPY_AND_ASSIGN(Nl80211AttributeMac);
Wade Guthrie25cdb382012-12-04 14:04:05 -0800284};
285
Wade Guthrie68da97c2013-02-26 13:09:35 -0800286class Nl80211AttributeRespIe : public NetlinkRawAttribute {
Wade Guthrie25cdb382012-12-04 14:04:05 -0800287 public:
Wade Guthrie68da97c2013-02-26 13:09:35 -0800288 static const int kName;
Wade Guthrie25cdb382012-12-04 14:04:05 -0800289 static const char kNameString[];
Wade Guthrie68da97c2013-02-26 13:09:35 -0800290 Nl80211AttributeRespIe() : NetlinkRawAttribute(kName, kNameString) {}
Wade Guthrie89e6cb32013-03-07 08:03:45 -0800291
292 private:
293 DISALLOW_COPY_AND_ASSIGN(Nl80211AttributeRespIe);
Wade Guthrie25cdb382012-12-04 14:04:05 -0800294};
295
Wade Guthrie16196242012-11-20 15:53:52 -0800296} // namespace shill
297
Wade Guthriebb9fca22013-04-10 17:21:42 -0700298#endif // SHILL_NL80211_ATTRIBUTE_H_