A Discrete-Event Network Simulator
API
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  * Author: 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 60 are reserved in 802.11-2007
87 #define IE_HT_OPERATIONS ((WifiInformationElementId)61)
88 // 62 to 126 are reserved in 802.11-2007
89 #define IE_EXTENDED_CAPABILITIES ((WifiInformationElementId)127)
90 // 128 to 190 are reserved in 802.11-2007
91 #define IE_VHT_CAPABILITIES ((WifiInformationElementId)191)
92 #define IE_VENDOR_SPECIFIC ((WifiInformationElementId)221)
93 // 222 to 255 are reserved in 802.11-2007
94 #define IE11S_LINK_METRIC_REPORT ((WifiInformationElementId)115)
95 #define IE11S_CONGESTION_NOTIFICATION ((WifiInformationElementId)116)
96 #define IE11S_SUPP_MBSS_REG_CLASSES_CHANNELS ((WifiInformationElementId)23)
97 #define IE11S_MESH_CHANNEL_SWITCH_ANNOUNCEMENT ((WifiInformationElementId)24)
98 #define IE11S_MESH_TIM ((WifiInformationElementId)25)
99 #define IE11S_AWAKE_WINDOW ((WifiInformationElementId)119)
100 #define IE11S_BEACON_TIMING ((WifiInformationElementId)120)
101 #define IE11S_MCCAOP_SETUP_REQUEST ((WifiInformationElementId)121)
102 #define IE11S_MCCAOP_SETUP_REPLY ((WifiInformationElementId)122)
103 #define IE11S_MCCAOP_ADVERTISEMENT ((WifiInformationElementId)123)
104 #define IE11S_MCCAOP_RESERVATION_TEARDOWN ((WifiInformationElementId)31)
105 #define IE11S_PORTAL_ANNOUNCEMENT ((WifiInformationElementId)32)
106 #define IE11S_PROXY_UPDATE ((WifiInformationElementId)137)
107 #define IE11S_PROXY_UPDATE_CONFIRMATION ((WifiInformationElementId)138)
108 #define IE11S_ABBREVIATED_HANDSHAKE ((WifiInformationElementId)39)
109 /* begin of open80211s-compatible IDs */
110 #define IE11S_MESH_CONFIGURATION ((WifiInformationElementId)113)
111 #define IE11S_MESH_ID ((WifiInformationElementId)114)
112 #define IE11S_PEERING_MANAGEMENT ((WifiInformationElementId)117)
113 /* end of open80211s-compatible IDs */
114 #define IE11S_RANN ((WifiInformationElementId)126)
115 /* begin of open80211s-compatible IDs */
116 #define IE11S_PREQ ((WifiInformationElementId)130)
117 #define IE11S_PREP ((WifiInformationElementId)131)
118 #define IE11S_PERR ((WifiInformationElementId)132)
119 /* end of open80211s-compatible IDs */
120 #define IE11S_MESH_PEERING_PROTOCOL_VERSION ((WifiInformationElementId)74)
121 
122 
123 
124 
162 class WifiInformationElement : public SimpleRefCount<WifiInformationElement>
163 {
164 public:
165  virtual ~WifiInformationElement ();
202  uint16_t GetSerializedSize () const;
203 
204  // Each subclass must implement these pure virtual functions:
206  virtual WifiInformationElementId ElementId () const = 0;
215  virtual uint8_t GetInformationFieldSize () const = 0;
223  virtual void SerializeInformationField (Buffer::Iterator start) const = 0;
233  virtual uint8_t DeserializeInformationField (Buffer::Iterator start,
234  uint8_t length) = 0;
235 
236  // In addition, a subclass may optionally override the following...
242  virtual void Print (std::ostream &os) const;
251  virtual bool operator< (WifiInformationElement const & a) const;
261  virtual bool operator== (WifiInformationElement const & a) const;
262 
263 };
264 
265 } //namespace ns3
266 
267 #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...
def start()
Definition: core.py:1482
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) ...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual void Print(std::ostream &os) const
Generate human-readable form of IE.
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.