A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
mgt-headers.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2006 INRIA
4
* Copyright (c) 2009 MIRKO BANCHI
5
*
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
8
* published by the Free Software Foundation;
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
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
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
*
19
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
20
* Author: Mirko Banchi <mk.banchi@gmail.com>
21
*/
22
#ifndef MGT_HEADERS_H
23
#define MGT_HEADERS_H
24
25
#include <stdint.h>
26
27
#include "ns3/header.h"
28
#include "
status-code.h
"
29
#include "
capability-information.h
"
30
#include "
supported-rates.h
"
31
#include "
ssid.h
"
32
#include "
ht-capabilities.h
"
33
34
namespace
ns3 {
35
40
class
MgtAssocRequestHeader
:
public
Header
41
{
42
public
:
43
MgtAssocRequestHeader
();
44
~MgtAssocRequestHeader
();
45
46
void
SetSsid
(
Ssid
ssid);
47
void
SetSupportedRates
(
SupportedRates
rates);
48
void
SetListenInterval
(uint16_t interval);
49
void
SetHtCapabilities
(
HtCapabilities
htcapabilities);
50
51
HtCapabilities
GetHtCapabilities
(
void
)
const
;
52
Ssid
GetSsid
(
void
)
const
;
53
SupportedRates
GetSupportedRates
(
void
)
const
;
54
uint16_t
GetListenInterval
(
void
)
const
;
55
56
static
TypeId
GetTypeId
(
void
);
57
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
58
virtual
void
Print
(std::ostream &os)
const
;
59
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
60
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
61
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start);
62
63
private
:
64
Ssid
m_ssid
;
65
SupportedRates
m_rates
;
66
CapabilityInformation
m_capability
;
67
HtCapabilities
m_htCapability
;
68
uint16_t
m_listenInterval
;
69
};
70
71
76
class
MgtAssocResponseHeader
:
public
Header
77
{
78
public
:
79
MgtAssocResponseHeader
();
80
~MgtAssocResponseHeader
();
81
82
StatusCode
GetStatusCode
(
void
);
83
SupportedRates
GetSupportedRates
(
void
);
84
HtCapabilities
GetHtCapabilities
(
void
)
const
;
85
86
void
SetHtCapabilities
(
HtCapabilities
htcapabilities);
87
void
SetSupportedRates
(
SupportedRates
rates);
88
void
SetStatusCode
(
StatusCode
code);
89
90
static
TypeId
GetTypeId
(
void
);
91
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
92
virtual
void
Print
(std::ostream &os)
const
;
93
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
94
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
95
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start);
96
97
private
:
98
SupportedRates
m_rates
;
99
CapabilityInformation
m_capability
;
100
StatusCode
m_code
;
101
uint16_t
m_aid
;
102
HtCapabilities
m_htCapability
;
103
};
104
105
110
class
MgtProbeRequestHeader
:
public
Header
111
{
112
public
:
113
~MgtProbeRequestHeader
();
114
115
void
SetSsid
(
Ssid
ssid);
116
void
SetSupportedRates
(
SupportedRates
rates);
117
Ssid
GetSsid
(
void
)
const
;
118
SupportedRates
GetSupportedRates
(
void
)
const
;
119
HtCapabilities
GetHtCapabilities
(
void
)
const
;
120
121
void
SetHtCapabilities
(
HtCapabilities
htcapabilities);
122
static
TypeId
GetTypeId
(
void
);
123
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
124
virtual
void
Print
(std::ostream &os)
const
;
125
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
126
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
127
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start);
128
private
:
129
Ssid
m_ssid
;
130
SupportedRates
m_rates
;
131
HtCapabilities
m_htCapability
;
132
};
133
134
139
class
MgtProbeResponseHeader
:
public
Header
140
{
141
public
:
142
MgtProbeResponseHeader
();
143
~MgtProbeResponseHeader
();
144
145
Ssid
GetSsid
(
void
)
const
;
146
uint64_t
GetBeaconIntervalUs
(
void
)
const
;
147
SupportedRates
GetSupportedRates
(
void
)
const
;
148
HtCapabilities
GetHtCapabilities
(
void
)
const
;
149
150
void
SetHtCapabilities
(
HtCapabilities
htcapabilities);
151
void
SetSsid
(
Ssid
ssid);
152
void
SetBeaconIntervalUs
(uint64_t us);
153
void
SetSupportedRates
(
SupportedRates
rates);
154
uint64_t
GetTimestamp
();
155
static
TypeId
GetTypeId
(
void
);
156
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
157
virtual
void
Print
(std::ostream &os)
const
;
158
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
159
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
160
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start);
161
162
private
:
163
uint64_t
m_timestamp
;
164
Ssid
m_ssid
;
165
uint64_t
m_beaconInterval
;
166
SupportedRates
m_rates
;
167
CapabilityInformation
m_capability
;
168
HtCapabilities
m_htCapability
;
169
};
170
171
176
class
MgtBeaconHeader
:
public
MgtProbeResponseHeader
177
{
178
};
179
180
/****************************
181
* Action frames
182
*****************************/
183
191
class
WifiActionHeader
:
public
Header
192
{
193
public
:
194
WifiActionHeader
();
195
~WifiActionHeader
();
196
197
/* Compatible with open80211s implementation */
198
enum
CategoryValue
//table 7-24 staring from 4
199
{
200
BLOCK_ACK
= 3,
201
MESH_PEERING_MGT
= 30,
202
MESH_LINK_METRIC
= 31,
203
MESH_PATH_SELECTION
= 32,
204
MESH_INTERWORKING
= 33,
205
MESH_RESOURCE_COORDINATION
= 34,
206
MESH_PROXY_FORWARDING
= 35,
207
};
208
/* Compatible with open80211s implementation */
209
enum
PeerLinkMgtActionValue
210
{
211
PEER_LINK_OPEN
= 0,
212
PEER_LINK_CONFIRM
= 1,
213
PEER_LINK_CLOSE
= 2,
214
};
215
enum
LinkMetricActionValue
216
{
217
LINK_METRIC_REQUEST
= 0,
218
LINK_METRIC_REPORT
,
219
};
220
/* Compatible with open80211s implementation */
221
enum
PathSelectionActionValue
222
{
223
PATH_SELECTION
= 0,
224
};
225
enum
InterworkActionValue
226
{
227
PORTAL_ANNOUNCEMENT
= 0,
228
};
229
enum
ResourceCoordinationActionValue
230
{
231
CONGESTION_CONTROL_NOTIFICATION
= 0,
232
MDA_SETUP_REQUEST
,
233
MDA_SETUP_REPLY
,
234
MDAOP_ADVERTISMENT_REQUEST
,
235
MDAOP_ADVERTISMENTS
,
236
MDAOP_SET_TEARDOWN
,
237
BEACON_TIMING_REQUEST
,
238
BEACON_TIMING_RESPONSE
,
239
TBTT_ADJUSTMENT_REQUEST
,
240
MESH_CHANNEL_SWITCH_ANNOUNCEMENT
,
241
};
242
enum
BlockAckActionValue
243
{
244
BLOCK_ACK_ADDBA_REQUEST
= 0,
245
BLOCK_ACK_ADDBA_RESPONSE
= 1,
246
BLOCK_ACK_DELBA
= 2
247
};
248
typedef
union
249
{
250
enum
PeerLinkMgtActionValue
peerLink
;
251
enum
LinkMetricActionValue
linkMetrtic
;
252
enum
PathSelectionActionValue
pathSelection
;
253
enum
InterworkActionValue
interwork
;
254
enum
ResourceCoordinationActionValue
resourceCoordination
;
255
enum
BlockAckActionValue
blockAck
;
256
}
ActionValue
;
257
void
SetAction
(
enum
CategoryValue
type,
ActionValue
action);
258
259
CategoryValue
GetCategory
();
260
ActionValue
GetAction
();
261
static
TypeId
GetTypeId
(
void
);
262
virtual
TypeId
GetInstanceTypeId
()
const
;
263
virtual
void
Print
(std::ostream &os)
const
;
264
virtual
uint32_t
GetSerializedSize
()
const
;
265
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
266
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start
);
267
private
:
268
uint8_t
m_category
;
269
uint8_t
m_actionValue
;
270
};
271
276
class
MgtAddBaRequestHeader
:
public
Header
277
{
278
public
:
279
MgtAddBaRequestHeader
();
280
281
static
TypeId
GetTypeId
(
void
);
282
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
283
virtual
void
Print
(std::ostream &os)
const
;
284
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
285
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
286
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start);
287
288
void
SetDelayedBlockAck
();
289
void
SetImmediateBlockAck
();
290
void
SetTid
(uint8_t tid);
291
void
SetTimeout
(uint16_t
timeout
);
292
void
SetBufferSize
(uint16_t size);
293
void
SetStartingSequence
(uint16_t seq);
294
void
SetAmsduSupport
(
bool
supported);
295
296
uint16_t
GetStartingSequence
(
void
)
const
;
297
uint8_t
GetTid
(
void
)
const
;
298
bool
IsImmediateBlockAck
(
void
)
const
;
299
uint16_t
GetTimeout
(
void
)
const
;
300
uint16_t
GetBufferSize
(
void
)
const
;
301
bool
IsAmsduSupported
(
void
)
const
;
302
303
private
:
304
uint16_t
GetParameterSet
(
void
)
const
;
305
void
SetParameterSet
(uint16_t params);
306
uint16_t
GetStartingSequenceControl
(
void
)
const
;
307
void
SetStartingSequenceControl
(uint16_t seqControl);
308
309
uint8_t
m_dialogToken
;
/* Not used for now */
310
uint8_t
m_amsduSupport
;
311
uint8_t
m_policy
;
312
uint8_t
m_tid
;
313
uint16_t
m_bufferSize
;
314
uint16_t
m_timeoutValue
;
315
uint16_t
m_startingSeq
;
316
};
317
318
323
class
MgtAddBaResponseHeader
:
public
Header
324
{
325
public
:
326
MgtAddBaResponseHeader
();
327
328
static
TypeId
GetTypeId
(
void
);
329
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
330
virtual
void
Print
(std::ostream &os)
const
;
331
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
332
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
333
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start);
334
335
void
SetDelayedBlockAck
();
336
void
SetImmediateBlockAck
();
337
void
SetTid
(uint8_t tid);
338
void
SetTimeout
(uint16_t
timeout
);
339
void
SetBufferSize
(uint16_t size);
340
void
SetStatusCode
(
StatusCode
code);
341
void
SetAmsduSupport
(
bool
supported);
342
343
StatusCode
GetStatusCode
(
void
)
const
;
344
uint8_t
GetTid
(
void
)
const
;
345
bool
IsImmediateBlockAck
(
void
)
const
;
346
uint16_t
GetTimeout
(
void
)
const
;
347
uint16_t
GetBufferSize
(
void
)
const
;
348
bool
IsAmsduSupported
(
void
)
const
;
349
350
private
:
351
uint16_t
GetParameterSet
(
void
)
const
;
352
void
SetParameterSet
(uint16_t params);
353
354
uint8_t
m_dialogToken
;
/* Not used for now */
355
StatusCode
m_code
;
356
uint8_t
m_amsduSupport
;
357
uint8_t
m_policy
;
358
uint8_t
m_tid
;
359
uint16_t
m_bufferSize
;
360
uint16_t
m_timeoutValue
;
361
};
362
363
368
class
MgtDelBaHeader
:
public
Header
369
{
370
public
:
371
MgtDelBaHeader
();
372
373
static
TypeId
GetTypeId
(
void
);
374
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
375
virtual
void
Print
(std::ostream &os)
const
;
376
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
377
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
378
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start);
379
380
bool
IsByOriginator
(
void
)
const
;
381
uint8_t
GetTid
(
void
)
const
;
382
void
SetTid
(uint8_t);
383
void
SetByOriginator
(
void
);
384
void
SetByRecipient
(
void
);
385
386
private
:
387
uint16_t
GetParameterSet
(
void
)
const
;
388
void
SetParameterSet
(uint16_t params);
389
390
uint16_t
m_initiator
;
391
uint16_t
m_tid
;
392
/* Not used for now.
393
Always set to 1: "Unspecified reason" */
394
uint16_t
m_reasonCode
;
395
};
396
397
}
// namespace ns3
398
399
#endif
/* MGT_HEADERS_H */
src
wifi
model
mgt-headers.h
Generated on Fri Aug 30 2013 01:43:05 for ns-3 by
1.8.1.2