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
33
namespace
ns3 {
34
39
class
MgtAssocRequestHeader
:
public
Header
40
{
41
public
:
42
MgtAssocRequestHeader
();
43
~MgtAssocRequestHeader
();
44
45
void
SetSsid
(
Ssid
ssid);
46
void
SetSupportedRates
(
SupportedRates
rates);
47
void
SetListenInterval
(uint16_t interval);
48
49
Ssid
GetSsid
(
void
)
const
;
50
SupportedRates
GetSupportedRates
(
void
)
const
;
51
uint16_t
GetListenInterval
(
void
)
const
;
52
53
static
TypeId
GetTypeId
(
void
);
54
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
55
virtual
void
Print
(std::ostream &os)
const
;
56
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
57
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
58
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start);
59
60
private
:
61
Ssid
m_ssid
;
62
SupportedRates
m_rates
;
63
CapabilityInformation
m_capability
;
64
uint16_t
m_listenInterval
;
65
};
66
67
72
class
MgtAssocResponseHeader
:
public
Header
73
{
74
public
:
75
MgtAssocResponseHeader
();
76
~MgtAssocResponseHeader
();
77
78
StatusCode
GetStatusCode
(
void
);
79
SupportedRates
GetSupportedRates
(
void
);
80
81
void
SetSupportedRates
(
SupportedRates
rates);
82
void
SetStatusCode
(
StatusCode
code);
83
84
static
TypeId
GetTypeId
(
void
);
85
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
86
virtual
void
Print
(std::ostream &os)
const
;
87
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
88
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
89
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start);
90
91
private
:
92
SupportedRates
m_rates
;
93
CapabilityInformation
m_capability
;
94
StatusCode
m_code
;
95
uint16_t
m_aid
;
96
};
97
98
103
class
MgtProbeRequestHeader
:
public
Header
104
{
105
public
:
106
~MgtProbeRequestHeader
();
107
108
void
SetSsid
(
Ssid
ssid);
109
void
SetSupportedRates
(
SupportedRates
rates);
110
Ssid
GetSsid
(
void
)
const
;
111
SupportedRates
GetSupportedRates
(
void
)
const
;
112
113
static
TypeId
GetTypeId
(
void
);
114
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
115
virtual
void
Print
(std::ostream &os)
const
;
116
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
117
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
118
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start);
119
private
:
120
Ssid
m_ssid
;
121
SupportedRates
m_rates
;
122
};
123
124
129
class
MgtProbeResponseHeader
:
public
Header
130
{
131
public
:
132
MgtProbeResponseHeader
();
133
~MgtProbeResponseHeader
();
134
135
Ssid
GetSsid
(
void
)
const
;
136
uint64_t
GetBeaconIntervalUs
(
void
)
const
;
137
SupportedRates
GetSupportedRates
(
void
)
const
;
138
139
void
SetSsid
(
Ssid
ssid);
140
void
SetBeaconIntervalUs
(uint64_t us);
141
void
SetSupportedRates
(
SupportedRates
rates);
142
uint64_t
GetTimestamp
();
143
static
TypeId
GetTypeId
(
void
);
144
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
145
virtual
void
Print
(std::ostream &os)
const
;
146
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
147
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
148
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start);
149
150
private
:
151
uint64_t
m_timestamp
;
152
Ssid
m_ssid
;
153
uint64_t
m_beaconInterval
;
154
SupportedRates
m_rates
;
155
CapabilityInformation
m_capability
;
156
};
157
158
163
class
MgtBeaconHeader
:
public
MgtProbeResponseHeader
164
{
165
};
166
167
/****************************
168
* Action frames
169
*****************************/
170
178
class
WifiActionHeader
:
public
Header
179
{
180
public
:
181
WifiActionHeader
();
182
~WifiActionHeader
();
183
184
/* Compatible with open80211s implementation */
185
enum
CategoryValue
//table 7-24 staring from 4
186
{
187
BLOCK_ACK
= 3,
188
MESH_PEERING_MGT
= 30,
189
MESH_LINK_METRIC
= 31,
190
MESH_PATH_SELECTION
= 32,
191
MESH_INTERWORKING
= 33,
192
MESH_RESOURCE_COORDINATION
= 34,
193
MESH_PROXY_FORWARDING
= 35,
194
};
195
/* Compatible with open80211s implementation */
196
enum
PeerLinkMgtActionValue
197
{
198
PEER_LINK_OPEN
= 0,
199
PEER_LINK_CONFIRM
= 1,
200
PEER_LINK_CLOSE
= 2,
201
};
202
enum
LinkMetricActionValue
203
{
204
LINK_METRIC_REQUEST
= 0,
205
LINK_METRIC_REPORT
,
206
};
207
/* Compatible with open80211s implementation */
208
enum
PathSelectionActionValue
209
{
210
PATH_SELECTION
= 0,
211
};
212
enum
InterworkActionValue
213
{
214
PORTAL_ANNOUNCEMENT
= 0,
215
};
216
enum
ResourceCoordinationActionValue
217
{
218
CONGESTION_CONTROL_NOTIFICATION
= 0,
219
MDA_SETUP_REQUEST
,
220
MDA_SETUP_REPLY
,
221
MDAOP_ADVERTISMENT_REQUEST
,
222
MDAOP_ADVERTISMENTS
,
223
MDAOP_SET_TEARDOWN
,
224
BEACON_TIMING_REQUEST
,
225
BEACON_TIMING_RESPONSE
,
226
TBTT_ADJUSTMENT_REQUEST
,
227
MESH_CHANNEL_SWITCH_ANNOUNCEMENT
,
228
};
229
enum
BlockAckActionValue
230
{
231
BLOCK_ACK_ADDBA_REQUEST
= 0,
232
BLOCK_ACK_ADDBA_RESPONSE
= 1,
233
BLOCK_ACK_DELBA
= 2
234
};
235
typedef
union
236
{
237
enum
PeerLinkMgtActionValue
peerLink
;
238
enum
LinkMetricActionValue
linkMetrtic
;
239
enum
PathSelectionActionValue
pathSelection
;
240
enum
InterworkActionValue
interwork
;
241
enum
ResourceCoordinationActionValue
resourceCoordination
;
242
enum
BlockAckActionValue
blockAck
;
243
}
ActionValue
;
244
void
SetAction
(
enum
CategoryValue
type,
ActionValue
action);
245
246
CategoryValue
GetCategory
();
247
ActionValue
GetAction
();
248
static
TypeId
GetTypeId
(
void
);
249
virtual
TypeId
GetInstanceTypeId
()
const
;
250
virtual
void
Print
(std::ostream &os)
const
;
251
virtual
uint32_t
GetSerializedSize
()
const
;
252
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
253
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start
);
254
private
:
255
uint8_t
m_category
;
256
uint8_t
m_actionValue
;
257
};
258
263
class
MgtAddBaRequestHeader
:
public
Header
264
{
265
public
:
266
MgtAddBaRequestHeader
();
267
268
static
TypeId
GetTypeId
(
void
);
269
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
270
virtual
void
Print
(std::ostream &os)
const
;
271
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
272
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
273
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start);
274
275
void
SetDelayedBlockAck
();
276
void
SetImmediateBlockAck
();
277
void
SetTid
(uint8_t tid);
278
void
SetTimeout
(uint16_t
timeout
);
279
void
SetBufferSize
(uint16_t size);
280
void
SetStartingSequence
(uint16_t seq);
281
void
SetAmsduSupport
(
bool
supported);
282
283
uint16_t
GetStartingSequence
(
void
)
const
;
284
uint8_t
GetTid
(
void
)
const
;
285
bool
IsImmediateBlockAck
(
void
)
const
;
286
uint16_t
GetTimeout
(
void
)
const
;
287
uint16_t
GetBufferSize
(
void
)
const
;
288
bool
IsAmsduSupported
(
void
)
const
;
289
290
private
:
291
uint16_t
GetParameterSet
(
void
)
const
;
292
void
SetParameterSet
(uint16_t params);
293
uint16_t
GetStartingSequenceControl
(
void
)
const
;
294
void
SetStartingSequenceControl
(uint16_t seqControl);
295
296
uint8_t
m_dialogToken
;
/* Not used for now */
297
uint8_t
m_amsduSupport
;
298
uint8_t
m_policy
;
299
uint8_t
m_tid
;
300
uint16_t
m_bufferSize
;
301
uint16_t
m_timeoutValue
;
302
uint16_t
m_startingSeq
;
303
};
304
305
310
class
MgtAddBaResponseHeader
:
public
Header
311
{
312
public
:
313
MgtAddBaResponseHeader
();
314
315
static
TypeId
GetTypeId
(
void
);
316
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
317
virtual
void
Print
(std::ostream &os)
const
;
318
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
319
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
320
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start);
321
322
void
SetDelayedBlockAck
();
323
void
SetImmediateBlockAck
();
324
void
SetTid
(uint8_t tid);
325
void
SetTimeout
(uint16_t
timeout
);
326
void
SetBufferSize
(uint16_t size);
327
void
SetStatusCode
(
StatusCode
code);
328
void
SetAmsduSupport
(
bool
supported);
329
330
StatusCode
GetStatusCode
(
void
)
const
;
331
uint8_t
GetTid
(
void
)
const
;
332
bool
IsImmediateBlockAck
(
void
)
const
;
333
uint16_t
GetTimeout
(
void
)
const
;
334
uint16_t
GetBufferSize
(
void
)
const
;
335
bool
IsAmsduSupported
(
void
)
const
;
336
337
private
:
338
uint16_t
GetParameterSet
(
void
)
const
;
339
void
SetParameterSet
(uint16_t params);
340
341
uint8_t
m_dialogToken
;
/* Not used for now */
342
StatusCode
m_code
;
343
uint8_t
m_amsduSupport
;
344
uint8_t
m_policy
;
345
uint8_t
m_tid
;
346
uint16_t
m_bufferSize
;
347
uint16_t
m_timeoutValue
;
348
};
349
350
355
class
MgtDelBaHeader
:
public
Header
356
{
357
public
:
358
MgtDelBaHeader
();
359
360
static
TypeId
GetTypeId
(
void
);
361
virtual
TypeId
GetInstanceTypeId
(
void
)
const
;
362
virtual
void
Print
(std::ostream &os)
const
;
363
virtual
uint32_t
GetSerializedSize
(
void
)
const
;
364
virtual
void
Serialize
(
Buffer::Iterator
start
)
const
;
365
virtual
uint32_t
Deserialize
(
Buffer::Iterator
start);
366
367
bool
IsByOriginator
(
void
)
const
;
368
uint8_t
GetTid
(
void
)
const
;
369
void
SetTid
(uint8_t);
370
void
SetByOriginator
(
void
);
371
void
SetByRecipient
(
void
);
372
373
private
:
374
uint16_t
GetParameterSet
(
void
)
const
;
375
void
SetParameterSet
(uint16_t params);
376
377
uint16_t
m_initiator
;
378
uint16_t
m_tid
;
379
/* Not used for now.
380
Always set to 1: "Unspecified reason" */
381
uint16_t
m_reasonCode
;
382
};
383
384
}
// namespace ns3
385
386
#endif
/* MGT_HEADERS_H */
src
wifi
model
mgt-headers.h
Generated on Tue May 14 2013 11:08:35 for ns-3 by
1.8.1.2