LEFT | RIGHT |
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2006 INRIA | 3 * Copyright (c) 2006 INRIA |
4 * Copyright (c) 2009 MIRKO BANCHI | 4 * Copyright (c) 2009 MIRKO BANCHI |
5 * | 5 * |
6 * This program is free software; you can redistribute it and/or modify | 6 * This program is free software; you can redistribute it and/or modify |
7 * it under the terms of the GNU General Public License version 2 as· | 7 * it under the terms of the GNU General Public License version 2 as· |
8 * published by the Free Software Foundation; | 8 * published by the Free Software Foundation; |
9 * | 9 * |
10 * This program is distributed in the hope that it will be useful, | 10 * This program is distributed in the hope that it will be useful, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 * GNU General Public License for more details. | 13 * GNU General Public License for more details. |
14 * | 14 * |
15 * You should have received a copy of the GNU General Public License | 15 * You should have received a copy of the GNU General Public License |
16 * along with this program; if not, write to the Free Software | 16 * along with this program; if not, write to the Free Software |
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 * | 18 * |
19 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> | 19 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
20 * Author: Mirko Banchi <mk.banchi@gmail.com> | 20 * Author: Mirko Banchi <mk.banchi@gmail.com> |
21 */ | 21 */ |
22 #ifndef MGT_HEADERS_H | 22 #ifndef MGT_HEADERS_H |
23 #define MGT_HEADERS_H | 23 #define MGT_HEADERS_H |
24 | 24 |
25 #include <stdint.h> | 25 #include <stdint.h> |
26 | 26 |
27 #include "ns3/header.h" | 27 #include "ns3/header.h" |
28 #include "status-code.h" | 28 #include "status-code.h" |
29 #include "capability-information.h" | 29 #include "capability-information.h" |
30 #include "supported-rates.h" | 30 #include "supported-rates.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 SupportedRates m_rates; | 133 SupportedRates m_rates; |
134 CapabilityInformation m_capability; | 134 CapabilityInformation m_capability; |
135 }; | 135 }; |
136 | 136 |
137 class MgtBeaconHeader : public MgtProbeResponseHeader {}; | 137 class MgtBeaconHeader : public MgtProbeResponseHeader {}; |
138 | 138 |
139 /**************************** | 139 /**************************** |
140 * Action frames | 140 * Action frames |
141 *****************************/ | 141 *****************************/ |
142 | 142 |
143 enum ActionFrameType { | 143 /** |
| 144 * \brief See IEEE 802.11 chapter 7.3.1.11 |
| 145 * |
| 146 * Header format: | category: 1 | action value: 1 | |
| 147 */ |
| 148 class WifiActionHeader : public Header |
| 149 { |
| 150 public: |
| 151 WifiActionHeader (); |
| 152 ~WifiActionHeader (); |
| 153 |
| 154 /* Compatible with open80211s implementation */ |
| 155 enum CategoryValue //table 7-24 staring from 4 |
| 156 { |
| 157 BLOCK_ACK = 3, |
| 158 MESH_PEERING_MGT = 30, |
| 159 MESH_LINK_METRIC = 31, |
| 160 MESH_PATH_SELECTION = 32, |
| 161 MESH_INTERWORKING = 33, |
| 162 MESH_RESOURCE_COORDINATION = 34, |
| 163 MESH_PROXY_FORWARDING = 35, |
| 164 }; |
| 165 /* Compatible with open80211s implementation */ |
| 166 enum PeerLinkMgtActionValue |
| 167 { |
| 168 PEER_LINK_OPEN = 0, |
| 169 PEER_LINK_CONFIRM = 1, |
| 170 PEER_LINK_CLOSE = 2, |
| 171 }; |
| 172 enum LinkMetricActionValue |
| 173 { |
| 174 LINK_METRIC_REQUEST = 0, |
| 175 LINK_METRIC_REPORT, |
| 176 }; |
| 177 /* Compatible with open80211s implementation */ |
| 178 enum PathSelectionActionValue |
| 179 { |
| 180 PATH_SELECTION = 0, |
| 181 }; |
| 182 enum InterworkActionValue |
| 183 { |
| 184 PORTAL_ANNOUNCEMENT = 0, |
| 185 }; |
| 186 enum ResourceCoordinationActionValue |
| 187 { |
| 188 CONGESTION_CONTROL_NOTIFICATION = 0, |
| 189 MDA_SETUP_REQUEST, |
| 190 MDA_SETUP_REPLY, |
| 191 MDAOP_ADVERTISMENT_REQUEST, |
| 192 MDAOP_ADVERTISMENTS, |
| 193 MDAOP_SET_TEARDOWN, |
| 194 BEACON_TIMING_REQUEST, |
| 195 BEACON_TIMING_RESPONSE, |
| 196 TBTT_ADJUSTMENT_REQUEST, |
| 197 MESH_CHANNEL_SWITCH_ANNOUNCEMENT, |
| 198 }; |
| 199 enum BlockAckActionValue |
| 200 { |
144 BLOCK_ACK_ADDBA_REQUEST = 0, | 201 BLOCK_ACK_ADDBA_REQUEST = 0, |
145 BLOCK_ACK_ADDBA_RESPONSE, | 202 BLOCK_ACK_ADDBA_RESPONSE = 1, |
146 BLOCK_ACK_DELBA | 203 BLOCK_ACK_DELBA = 2 |
147 }; | 204 }; |
148 | 205 typedef union |
149 /** | 206 { |
150 * This header id used only to know what type of action frame we have received. | 207 enum PeerLinkMgtActionValue peerLink; |
151 * This is needed because every action frame has a variable action details field
. | 208 enum LinkMetricActionValue linkMetrtic; |
152 * This header never should be removed from packet but it must be only peeked. | 209 enum PathSelectionActionValue pathSelection; |
153 * This header is already serialized with serialization of all Action frames. | 210 enum InterworkActionValue interwork; |
154 */ | 211 enum ResourceCoordinationActionValue resourceCoordination; |
155 class MgtActionFrameHeader : public Header { | 212 enum BlockAckActionValue blockAck; |
156 private: | 213 } ActionValue; |
157 enum Category { | 214 void SetAction (enum CategoryValue type,ActionValue action); |
158 SPECTRUM_MANAGEMENT = 0, | 215 |
159 QOS = 1, | 216 CategoryValue GetCategory (); |
160 DLS = 2, | 217 ActionValue GetAction (); |
161 BLOCK_ACK = 3 | 218 static TypeId GetTypeId (); |
162 }; | 219 virtual TypeId GetInstanceTypeId () const; |
163 public: | 220 virtual void Print (std::ostream &os) const; |
164 ·· | 221 virtual uint32_t GetSerializedSize () const; |
165 static TypeId GetTypeId (void); | 222 virtual void Serialize (Buffer::Iterator start) const; |
166 virtual TypeId GetInstanceTypeId (void) const; | 223 virtual uint32_t Deserialize (Buffer::Iterator start); |
167 virtual void Print (std::ostream &os) const; | |
168 virtual uint32_t GetSerializedSize (void) const; | |
169 virtual void Serialize (Buffer::Iterator start) const; | |
170 virtual uint32_t Deserialize (Buffer::Iterator start); | |
171 | |
172 /* For now only actions for BLOCK_ACK category are implemented */ | |
173 ActionFrameType GetType (void) const; | |
174 bool IsAddBaRequest (void) const; | |
175 bool IsAddBaResponse (void) const; | |
176 bool IsDelBa (void) const; | |
177 | |
178 private: | 224 private: |
179 uint8_t m_category; | 225 uint8_t m_category; |
180 uint8_t m_action; | 226 uint8_t m_actionValue; |
181 }; | 227 }; |
182 | 228 |
183 class MgtAddBaRequestHeader : public Header { | 229 class MgtAddBaRequestHeader : public Header { |
184 public: | 230 public: |
185 ·· | 231 ·· |
186 MgtAddBaRequestHeader (); | 232 MgtAddBaRequestHeader (); |
187 | 233 |
188 static TypeId GetTypeId (void); | 234 static TypeId GetTypeId (void); |
189 virtual TypeId GetInstanceTypeId (void) const; | 235 virtual TypeId GetInstanceTypeId (void) const; |
190 virtual void Print (std::ostream &os) const; | 236 virtual void Print (std::ostream &os) const; |
(...skipping 15 matching lines...) Expand all Loading... |
206 uint16_t GetTimeout (void) const; | 252 uint16_t GetTimeout (void) const; |
207 uint16_t GetBufferSize (void) const; | 253 uint16_t GetBufferSize (void) const; |
208 bool IsAmsduSupported (void) const; | 254 bool IsAmsduSupported (void) const; |
209 ·· | 255 ·· |
210 private: | 256 private: |
211 uint16_t GetParameterSet (void) const; | 257 uint16_t GetParameterSet (void) const; |
212 void SetParameterSet (uint16_t params); | 258 void SetParameterSet (uint16_t params); |
213 uint16_t GetStartingSequenceControl (void) const; | 259 uint16_t GetStartingSequenceControl (void) const; |
214 void SetStartingSequenceControl (uint16_t seqControl); | 260 void SetStartingSequenceControl (uint16_t seqControl); |
215 ·· | 261 ·· |
216 static const uint8_t M_CATEGORY = 3; | |
217 static const uint8_t M_ACTION = 0; | |
218 | |
219 uint8_t m_dialogToken; /* Not used for now */ | 262 uint8_t m_dialogToken; /* Not used for now */ |
220 uint8_t m_amsduSupport; | 263 uint8_t m_amsduSupport; |
221 uint8_t m_policy; | 264 uint8_t m_policy; |
222 uint8_t m_tid; | 265 uint8_t m_tid; |
223 uint16_t m_bufferSize; | 266 uint16_t m_bufferSize; |
224 uint16_t m_timeoutValue; | 267 uint16_t m_timeoutValue; |
225 uint16_t m_startingSeq; | 268 uint16_t m_startingSeq; |
226 }; | 269 }; |
227 · | 270 · |
228 class MgtAddBaResponseHeader : public Header { | 271 class MgtAddBaResponseHeader : public Header { |
(...skipping 19 matching lines...) Expand all Loading... |
248 StatusCode GetStatusCode (void) const; | 291 StatusCode GetStatusCode (void) const; |
249 uint8_t GetTid (void) const; | 292 uint8_t GetTid (void) const; |
250 bool IsImmediateBlockAck (void) const; | 293 bool IsImmediateBlockAck (void) const; |
251 uint16_t GetTimeout (void) const; | 294 uint16_t GetTimeout (void) const; |
252 uint16_t GetBufferSize (void) const; | 295 uint16_t GetBufferSize (void) const; |
253 bool IsAmsduSupported (void) const; | 296 bool IsAmsduSupported (void) const; |
254 | 297 |
255 private: | 298 private: |
256 uint16_t GetParameterSet (void) const; | 299 uint16_t GetParameterSet (void) const; |
257 void SetParameterSet (uint16_t params); | 300 void SetParameterSet (uint16_t params); |
258 | |
259 static const uint8_t M_CATEGORY = 3; | |
260 static const uint8_t M_ACTION = 1; | |
261 ·· | 301 ·· |
262 uint8_t m_dialogToken; /* Not used for now */ | 302 uint8_t m_dialogToken; /* Not used for now */ |
263 StatusCode m_code; | 303 StatusCode m_code; |
264 uint8_t m_amsduSupport; | 304 uint8_t m_amsduSupport; |
265 uint8_t m_policy; | 305 uint8_t m_policy; |
266 uint8_t m_tid; | 306 uint8_t m_tid; |
267 uint16_t m_bufferSize; | 307 uint16_t m_bufferSize; |
268 uint16_t m_timeoutValue; | 308 uint16_t m_timeoutValue; |
269 }; | 309 }; |
270 | 310 |
(...skipping 11 matching lines...) Expand all Loading... |
282 bool IsByOriginator (void) const; | 322 bool IsByOriginator (void) const; |
283 uint8_t GetTid (void) const; | 323 uint8_t GetTid (void) const; |
284 void SetTid (uint8_t); | 324 void SetTid (uint8_t); |
285 void SetByOriginator (void); | 325 void SetByOriginator (void); |
286 void SetByRecipient (void); | 326 void SetByRecipient (void); |
287 | 327 |
288 private: | 328 private: |
289 uint16_t GetParameterSet (void) const; | 329 uint16_t GetParameterSet (void) const; |
290 void SetParameterSet (uint16_t params); | 330 void SetParameterSet (uint16_t params); |
291 | 331 |
292 static const uint8_t M_CATEGORY = 3; | |
293 static const uint8_t M_ACTION = 2; | |
294 uint16_t m_initiator; | 332 uint16_t m_initiator; |
295 uint16_t m_tid; | 333 uint16_t m_tid; |
296 /* Not used for now. | 334 /* Not used for now. |
297 Always set to 1: "Unspecified reason" */ | 335 Always set to 1: "Unspecified reason" */ |
298 uint16_t m_reasonCode; | 336 uint16_t m_reasonCode; |
299 }; | 337 }; |
300 | 338 |
301 } // namespace ns3 | 339 } // namespace ns3 |
302 | 340 |
303 #endif /* MGT_HEADERS_H */ | 341 #endif /* MGT_HEADERS_H */ |
LEFT | RIGHT |