A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
wifi-information-element.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2010 Dean Armstrong
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Authors: Dean Armstrong <deanarm@gmail.com>
19  */
20 
21 #ifndef WIFI_INFORMATION_ELEMENT_H
22 #define WIFI_INFORMATION_ELEMENT_H
23 
24 #include "ns3/header.h"
25 #include "ns3/simple-ref-count.h"
26 
27 namespace ns3 {
28 
41 typedef uint8_t WifiInformationElementId;
42 
43 
49 #define IE_SSID ((WifiInformationElementId)0)
50 #define IE_SUPPORTED_RATES ((WifiInformationElementId)1)
51 #define IE_FH_PARAMETER_SET ((WifiInformationElementId)2)
52 #define IE_DS_PARAMETER_SET ((WifiInformationElementId)3)
53 #define IE_CF_PARAMETER_SET ((WifiInformationElementId)4)
54 #define IE_TIM ((WifiInformationElementId)5)
55 #define IE_IBSS_PARAMETER_SET ((WifiInformationElementId)6)
56 #define IE_COUNTRY ((WifiInformationElementId)7)
57 #define IE_HOPPING_PATTERN_PARAMETERS ((WifiInformationElementId)8)
58 #define IE_HOPPING_PATTERN_TABLE ((WifiInformationElementId)9)
59 #define IE_REQUEST ((WifiInformationElementId)10)
60 #define IE_BSS_LOAD ((WifiInformationElementId)11)
61 #define IE_EDCA_PARAMETER_SET ((WifiInformationElementId)12)
62 #define IE_TSPEC ((WifiInformationElementId)13)
63 #define IE_TCLAS ((WifiInformationElementId)14)
64 #define IE_SCHEDULE ((WifiInformationElementId)15)
65 #define IE_CHALLENGE_TEXT ((WifiInformationElementId)16)
66 // 17 to 31 are reserved in 802.11-2007
67 #define IE_POWER_CONSTRAINT ((WifiInformationElementId)32)
68 #define IE_POWER_CAPABILITY ((WifiInformationElementId)33)
69 #define IE_TPC_REQUEST ((WifiInformationElementId)34)
70 #define IE_TPC_REPORT ((WifiInformationElementId)35)
71 #define IE_SUPPORTED_CHANNELS ((WifiInformationElementId)36)
72 #define IE_CHANNEL_SWITCH_ANNOUNCEMENT ((WifiInformationElementId)37)
73 #define IE_MEASUREMENT_REQUEST ((WifiInformationElementId)38)
74 #define IE_MEASUREMENT_REPORT ((WifiInformationElementId)39)
75 #define IE_QUIET ((WifiInformationElementId)40)
76 #define IE_IBSS_DFS ((WifiInformationElementId)41)
77 #define IE_ERP_INFORMATION ((WifiInformationElementId)42)
78 #define IE_TS_DELAY ((WifiInformationElementId)43)
79 #define IE_TCLAS_PROCESSING ((WifiInformationElementId)44)
80 #define IE_HT_CAPABILITIES ((WifiInformationElementId)45)
81 #define IE_QOS_CAPABILITY ((WifiInformationElementId)46)
82 // 47 is reserved in 802.11-2007
83 #define IE_RSN ((WifiInformationElementId)48)
84 // 49 is reserved in 802.11-2007
85 #define IE_EXTENDED_SUPPORTED_RATES ((WifiInformationElementId)50)
86 // 51 to 126 are reserved in 802.11-2007
87 #define IE_EXTENDED_CAPABILITIES ((WifiInformationElementId)127)
88 // 128 to 220 are reserved in 802.11-2007
89 #define IE_VENDOR_SPECIFIC ((WifiInformationElementId)221)
90 // 222 to 255 are reserved in 802.11-2007
91 
92 
130 class WifiInformationElement : public SimpleRefCount<WifiInformationElement>
131 {
132 public:
133  virtual ~WifiInformationElement ();
168  uint16_t GetSerializedSize () const;
169 
171  //\{
173  virtual WifiInformationElementId ElementId () const = 0;
182  virtual uint8_t GetInformationFieldSize () const = 0;
190  virtual void SerializeInformationField (Buffer::Iterator start) const = 0;
200  virtual uint8_t DeserializeInformationField (Buffer::Iterator start,
201  uint8_t length) = 0;
202  //\}
203 
205  //\{
211  virtual void Print (std::ostream &os) const;
219  virtual bool operator< (WifiInformationElement const & a) const;
227  virtual bool operator== (WifiInformationElement const & a) const;
228  //\}
229 };
230 
231 }
232 #endif /* WIFI_INFORMATION_ELEMENT_H */
virtual uint8_t DeserializeInformationField(Buffer::Iterator start, uint8_t length)=0
Deserialize information (i.e., the body of the IE, not including the Element ID and length octets) ...
virtual uint8_t GetInformationFieldSize() const =0
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
virtual WifiInformationElementId ElementId() const =0
Own unique Element ID.
Buffer::Iterator Deserialize(Buffer::Iterator i)
Deserialize entire IE, which must be present.
uint16_t GetSerializedSize() const
Get the size of the serialized IE including Element ID and length fields.
iterator in a Buffer instance
Definition: buffer.h:98
Information element, as defined in 802.11-2007 standardThe IEEE 802.11 standard includes the notion o...
Buffer::Iterator DeserializeIfPresent(Buffer::Iterator i)
Deserialize entire IE if it is present.
virtual bool operator<(WifiInformationElement const &a) const
Compare information elements using Element ID.
virtual void SerializeInformationField(Buffer::Iterator start) const =0
Serialize information (i.e., the body of the IE, not including the Element ID and length octets) ...
virtual void Print(std::ostream &os) const
In addition, a subclass may optionally override the following...
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
virtual bool operator==(WifiInformationElement const &a) const
Compare two IEs for equality by ID & Length, and then through memcmp of serialised version...
A template-based reference counting class.
Buffer::Iterator Serialize(Buffer::Iterator i) const
Serialize entire IE including Element ID and length fields.