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
ctrl-headers.cc
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2009 MIRKO BANCHI
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: Mirko Banchi <mk.banchi@gmail.com>
19
*/
20
#include "ns3/fatal-error.h"
21
#include "ns3/log.h"
22
23
#include "
ctrl-headers.h
"
24
25
NS_LOG_COMPONENT_DEFINE
(
"CtrlHeaders"
);
26
27
namespace
ns3 {
28
29
/***********************************
30
* Block ack request
31
***********************************/
32
33
NS_OBJECT_ENSURE_REGISTERED
(CtrlBAckRequestHeader);
34
35
CtrlBAckRequestHeader::CtrlBAckRequestHeader
()
36
: m_barAckPolicy (false),
37
m_multiTid (false),
38
m_compressed (false)
39
{
40
NS_LOG_FUNCTION
(
this
);
41
}
42
43
CtrlBAckRequestHeader::~CtrlBAckRequestHeader
()
44
{
45
NS_LOG_FUNCTION
(
this
);
46
}
47
48
TypeId
49
CtrlBAckRequestHeader::GetTypeId
(
void
)
50
{
51
NS_LOG_FUNCTION_NOARGS
();
52
static
TypeId
tid =
TypeId
(
"ns3::CtrlBAckRequestHeader"
)
53
.
SetParent
<
Header
> ()
54
.AddConstructor<CtrlBAckRequestHeader> ()
55
;
56
return
tid;
57
}
58
59
TypeId
60
CtrlBAckRequestHeader::GetInstanceTypeId
(
void
)
const
61
{
62
NS_LOG_FUNCTION
(
this
);
63
return
GetTypeId
();
64
}
65
66
void
67
CtrlBAckRequestHeader::Print
(std::ostream &os)
const
68
{
69
NS_LOG_FUNCTION
(
this
<< &os);
70
os <<
"TID_INFO="
<<
m_tidInfo
<<
", StartingSeq="
<< std::hex <<
m_startingSeq
<< std::dec;
71
}
72
73
uint32_t
74
CtrlBAckRequestHeader::GetSerializedSize
()
const
75
{
76
NS_LOG_FUNCTION
(
this
);
77
uint32_t size = 0;
78
size += 2;
//Bar control
79
if
(!
m_multiTid
)
80
{
81
size += 2;
//Starting sequence control
82
}
83
else
84
{
85
if
(
m_compressed
)
86
{
87
size += (2 + 2) * (
m_tidInfo
+ 1);
//Multi-tid block ack
88
}
89
else
90
{
91
NS_FATAL_ERROR
(
"Reserved configuration."
);
92
}
93
}
94
return
size;
95
}
96
97
void
98
CtrlBAckRequestHeader::Serialize
(
Buffer::Iterator
start
)
const
99
{
100
NS_LOG_FUNCTION
(
this
<< &start);
101
Buffer::Iterator
i =
start
;
102
i.
WriteHtolsbU16
(
GetBarControl
());
103
if
(!
m_multiTid
)
104
{
105
i.
WriteHtolsbU16
(
GetStartingSequenceControl
());
106
}
107
else
108
{
109
if
(
m_compressed
)
110
{
111
NS_FATAL_ERROR
(
"Multi-tid block ack is not supported."
);
112
}
113
else
114
{
115
NS_FATAL_ERROR
(
"Reserved configuration."
);
116
}
117
}
118
}
119
120
uint32_t
121
CtrlBAckRequestHeader::Deserialize
(
Buffer::Iterator
start
)
122
{
123
NS_LOG_FUNCTION
(
this
<< &start);
124
Buffer::Iterator
i =
start
;
125
SetBarControl
(i.
ReadLsbtohU16
());
126
if
(!
m_multiTid
)
127
{
128
SetStartingSequenceControl
(i.
ReadLsbtohU16
());
129
}
130
else
131
{
132
if
(
m_compressed
)
133
{
134
NS_FATAL_ERROR
(
"Multi-tid block ack is not supported."
);
135
}
136
else
137
{
138
NS_FATAL_ERROR
(
"Reserved configuration."
);
139
}
140
}
141
return
i.
GetDistanceFrom
(start);
142
}
143
144
uint16_t
145
CtrlBAckRequestHeader::GetBarControl
(
void
)
const
146
{
147
NS_LOG_FUNCTION
(
this
);
148
uint16_t res = 0;
149
if
(
m_barAckPolicy
)
150
{
151
res |= 0x1;
152
}
153
if
(
m_multiTid
)
154
{
155
res |= (0x1 << 1);
156
}
157
if
(
m_compressed
)
158
{
159
res |= (0x1 << 2);
160
}
161
res |= (
m_tidInfo
<< 12) & (0xf << 12);
162
return
res;
163
}
164
165
void
166
CtrlBAckRequestHeader::SetBarControl
(uint16_t bar)
167
{
168
NS_LOG_FUNCTION
(
this
<< bar);
169
m_barAckPolicy
= ((bar & 0x01) == 1) ?
true
:
false
;
170
m_multiTid
= (((bar >> 1) & 0x01) == 1) ?
true
:
false
;
171
m_compressed
= (((bar >> 2) & 0x01) == 1) ?
true
:
false
;
172
m_tidInfo
= (bar >> 12) & 0x0f;
173
}
174
175
uint16_t
176
CtrlBAckRequestHeader::GetStartingSequenceControl
(
void
)
const
177
{
178
NS_LOG_FUNCTION
(
this
);
179
return
(
m_startingSeq
<< 4) & 0xfff0;
180
}
181
182
void
183
CtrlBAckRequestHeader::SetStartingSequenceControl
(uint16_t seqControl)
184
{
185
NS_LOG_FUNCTION
(
this
<< seqControl);
186
m_startingSeq
= (seqControl >> 4) & 0x0fff;
187
}
188
189
void
190
CtrlBAckRequestHeader::SetHtImmediateAck
(
bool
immediateAck)
191
{
192
NS_LOG_FUNCTION
(
this
<< immediateAck);
193
m_barAckPolicy
= immediateAck;
194
}
195
196
void
197
CtrlBAckRequestHeader::SetType
(
enum
BlockAckType
type)
198
{
199
NS_LOG_FUNCTION
(
this
<< type);
200
switch
(type)
201
{
202
case
BASIC_BLOCK_ACK
:
203
m_multiTid
=
false
;
204
m_compressed
=
false
;
205
break
;
206
case
COMPRESSED_BLOCK_ACK
:
207
m_multiTid
=
false
;
208
m_compressed
=
true
;
209
break
;
210
case
MULTI_TID_BLOCK_ACK
:
211
m_multiTid
=
true
;
212
m_compressed
=
true
;
213
break
;
214
default
:
215
NS_FATAL_ERROR
(
"Invalid variant type"
);
216
break
;
217
}
218
}
219
220
void
221
CtrlBAckRequestHeader::SetTidInfo
(uint8_t tid)
222
{
223
NS_LOG_FUNCTION
(
this
<< static_cast<uint32_t> (tid));
224
m_tidInfo
=
static_cast<
uint16_t
>
(tid);
225
}
226
227
void
228
CtrlBAckRequestHeader::SetStartingSequence
(uint16_t seq)
229
{
230
NS_LOG_FUNCTION
(
this
<< seq);
231
m_startingSeq
= seq;
232
}
233
234
bool
235
CtrlBAckRequestHeader::MustSendHtImmediateAck
(
void
)
const
236
{
237
NS_LOG_FUNCTION
(
this
);
238
return
m_barAckPolicy
;
239
}
240
241
uint8_t
242
CtrlBAckRequestHeader::GetTidInfo
(
void
)
const
243
{
244
NS_LOG_FUNCTION
(
this
);
245
uint8_t tid =
static_cast<
uint8_t
>
(
m_tidInfo
);
246
return
tid;
247
}
248
249
uint16_t
250
CtrlBAckRequestHeader::GetStartingSequence
(
void
)
const
251
{
252
NS_LOG_FUNCTION
(
this
);
253
return
m_startingSeq
;
254
}
255
256
bool
257
CtrlBAckRequestHeader::IsBasic
(
void
)
const
258
{
259
NS_LOG_FUNCTION
(
this
);
260
return
(!
m_multiTid
&& !
m_compressed
) ?
true
:
false
;
261
}
262
263
bool
264
CtrlBAckRequestHeader::IsCompressed
(
void
)
const
265
{
266
NS_LOG_FUNCTION
(
this
);
267
return
(!
m_multiTid
&&
m_compressed
) ?
true
:
false
;
268
}
269
270
bool
271
CtrlBAckRequestHeader::IsMultiTid
(
void
)
const
272
{
273
NS_LOG_FUNCTION
(
this
);
274
return
(
m_multiTid
&&
m_compressed
) ?
true
:
false
;
275
}
276
277
/***********************************
278
* Block ack response
279
***********************************/
280
281
NS_OBJECT_ENSURE_REGISTERED
(
CtrlBAckResponseHeader
);
282
283
CtrlBAckResponseHeader::CtrlBAckResponseHeader
()
284
: m_baAckPolicy (false),
285
m_multiTid (false),
286
m_compressed (false)
287
{
288
NS_LOG_FUNCTION
(
this
);
289
memset (&
bitmap
, 0,
sizeof
(
bitmap
));
290
}
291
292
CtrlBAckResponseHeader::~CtrlBAckResponseHeader
()
293
{
294
NS_LOG_FUNCTION
(
this
);
295
}
296
297
TypeId
298
CtrlBAckResponseHeader::GetTypeId
(
void
)
299
{
300
static
TypeId
tid =
TypeId
(
"ns3::CtrlBAckResponseHeader"
)
301
.
SetParent
<
Header
> ()
302
.AddConstructor<CtrlBAckResponseHeader> ()
303
;
304
return
tid;
305
}
306
307
TypeId
308
CtrlBAckResponseHeader::GetInstanceTypeId
(
void
)
const
309
{
310
return
GetTypeId
();
311
}
312
313
void
314
CtrlBAckResponseHeader::Print
(std::ostream &os)
const
315
{
316
NS_LOG_FUNCTION
(
this
<< &os);
317
os <<
"TID_INFO="
<<
m_tidInfo
<<
", StartingSeq="
<< std::hex <<
m_startingSeq
<< std::dec;
318
}
319
320
uint32_t
321
CtrlBAckResponseHeader::GetSerializedSize
(
void
)
const
322
{
323
NS_LOG_FUNCTION
(
this
);
324
uint32_t size = 0;
325
size += 2;
//Bar control
326
if
(!
m_multiTid
)
327
{
328
if
(!
m_compressed
)
329
{
330
size += (2 + 128);
//Basic block ack
331
}
332
else
333
{
334
size += (2 + 8);
//Compressed block ack
335
}
336
}
337
else
338
{
339
if
(
m_compressed
)
340
{
341
size += (2 + 2 + 8) * (
m_tidInfo
+ 1);
//Multi-tid block ack
342
}
343
else
344
{
345
NS_FATAL_ERROR
(
"Reserved configuration."
);
346
}
347
}
348
return
size;
349
}
350
351
void
352
CtrlBAckResponseHeader::Serialize
(
Buffer::Iterator
start
)
const
353
{
354
NS_LOG_FUNCTION
(
this
<< &start);
355
Buffer::Iterator
i =
start
;
356
i.
WriteHtolsbU16
(
GetBaControl
());
357
if
(!
m_multiTid
)
358
{
359
i.
WriteHtolsbU16
(
GetStartingSequenceControl
());
360
i =
SerializeBitmap
(i);
361
}
362
else
363
{
364
if
(
m_compressed
)
365
{
366
NS_FATAL_ERROR
(
"Multi-tid block ack is not supported."
);
367
}
368
else
369
{
370
NS_FATAL_ERROR
(
"Reserved configuration."
);
371
}
372
}
373
}
374
375
uint32_t
376
CtrlBAckResponseHeader::Deserialize
(
Buffer::Iterator
start
)
377
{
378
NS_LOG_FUNCTION
(
this
<< &start);
379
Buffer::Iterator
i =
start
;
380
SetBaControl
(i.
ReadLsbtohU16
());
381
if
(!
m_multiTid
)
382
{
383
SetStartingSequenceControl
(i.
ReadLsbtohU16
());
384
i =
DeserializeBitmap
(i);
385
}
386
else
387
{
388
if
(
m_compressed
)
389
{
390
NS_FATAL_ERROR
(
"Multi-tid block ack is not supported."
);
391
}
392
else
393
{
394
NS_FATAL_ERROR
(
"Reserved configuration."
);
395
}
396
}
397
return
i.
GetDistanceFrom
(start);
398
}
399
400
void
401
CtrlBAckResponseHeader::SetHtImmediateAck
(
bool
immediateAck)
402
{
403
NS_LOG_FUNCTION
(
this
<< immediateAck);
404
m_baAckPolicy
= immediateAck;
405
}
406
407
void
408
CtrlBAckResponseHeader::SetType
(
enum
BlockAckType
type)
409
{
410
NS_LOG_FUNCTION
(
this
<< type);
411
switch
(type)
412
{
413
case
BASIC_BLOCK_ACK
:
414
m_multiTid
=
false
;
415
m_compressed
=
false
;
416
break
;
417
case
COMPRESSED_BLOCK_ACK
:
418
m_multiTid
=
false
;
419
m_compressed
=
true
;
420
break
;
421
case
MULTI_TID_BLOCK_ACK
:
422
m_multiTid
=
true
;
423
m_compressed
=
true
;
424
break
;
425
default
:
426
NS_FATAL_ERROR
(
"Invalid variant type"
);
427
break
;
428
}
429
}
430
431
void
432
CtrlBAckResponseHeader::SetTidInfo
(uint8_t tid)
433
{
434
NS_LOG_FUNCTION
(
this
<< static_cast<uint32_t> (tid));
435
m_tidInfo
=
static_cast<
uint16_t
>
(tid);
436
}
437
438
void
439
CtrlBAckResponseHeader::SetStartingSequence
(uint16_t seq)
440
{
441
NS_LOG_FUNCTION
(
this
<< seq);
442
m_startingSeq
= seq;
443
}
444
445
bool
446
CtrlBAckResponseHeader::MustSendHtImmediateAck
(
void
)
const
447
{
448
NS_LOG_FUNCTION
(
this
);
449
return
(
m_baAckPolicy
) ?
true
:
false
;
450
}
451
452
uint8_t
453
CtrlBAckResponseHeader::GetTidInfo
(
void
)
const
454
{
455
NS_LOG_FUNCTION
(
this
);
456
uint8_t tid =
static_cast<
uint8_t
>
(
m_tidInfo
);
457
return
tid;
458
}
459
460
uint16_t
461
CtrlBAckResponseHeader::GetStartingSequence
(
void
)
const
462
{
463
NS_LOG_FUNCTION
(
this
);
464
return
m_startingSeq
;
465
}
466
467
bool
468
CtrlBAckResponseHeader::IsBasic
(
void
)
const
469
{
470
NS_LOG_FUNCTION
(
this
);
471
return
(!
m_multiTid
&& !
m_compressed
) ?
true
:
false
;
472
}
473
474
bool
475
CtrlBAckResponseHeader::IsCompressed
(
void
)
const
476
{
477
NS_LOG_FUNCTION
(
this
);
478
return
(!
m_multiTid
&&
m_compressed
) ?
true
:
false
;
479
}
480
481
bool
482
CtrlBAckResponseHeader::IsMultiTid
(
void
)
const
483
{
484
NS_LOG_FUNCTION
(
this
);
485
return
(
m_multiTid
&&
m_compressed
) ?
true
:
false
;
486
}
487
488
uint16_t
489
CtrlBAckResponseHeader::GetBaControl
(
void
)
const
490
{
491
NS_LOG_FUNCTION
(
this
);
492
uint16_t res = 0;
493
if
(
m_baAckPolicy
)
494
{
495
res |= 0x1;
496
}
497
if
(
m_multiTid
)
498
{
499
res |= (0x1 << 1);
500
}
501
if
(
m_compressed
)
502
{
503
res |= (0x1 << 2);
504
}
505
res |= (
m_tidInfo
<< 12) & (0xf << 12);
506
return
res;
507
}
508
509
void
510
CtrlBAckResponseHeader::SetBaControl
(uint16_t ba)
511
{
512
NS_LOG_FUNCTION
(
this
<< ba);
513
m_baAckPolicy
= ((ba & 0x01) == 1) ?
true
:
false
;
514
m_multiTid
= (((ba >> 1) & 0x01) == 1) ?
true
:
false
;
515
m_compressed
= (((ba >> 2) & 0x01) == 1) ?
true
:
false
;
516
m_tidInfo
= (ba >> 12) & 0x0f;
517
}
518
519
uint16_t
520
CtrlBAckResponseHeader::GetStartingSequenceControl
(
void
)
const
521
{
522
NS_LOG_FUNCTION
(
this
);
523
return
(
m_startingSeq
<< 4) & 0xfff0;
524
}
525
526
void
527
CtrlBAckResponseHeader::SetStartingSequenceControl
(uint16_t seqControl)
528
{
529
NS_LOG_FUNCTION
(
this
<< seqControl);
530
m_startingSeq
= (seqControl >> 4) & 0x0fff;
531
}
532
533
Buffer::Iterator
534
CtrlBAckResponseHeader::SerializeBitmap
(
Buffer::Iterator
start
)
const
535
{
536
NS_LOG_FUNCTION
(
this
<< &start);
537
Buffer::Iterator
i =
start
;
538
if
(!
m_multiTid
)
539
{
540
if
(!
m_compressed
)
541
{
542
for
(uint32_t j = 0; j < 64; j++)
543
{
544
i.
WriteHtolsbU16
(
bitmap
.m_bitmap[j]);
545
}
546
}
547
else
548
{
549
i.
WriteHtolsbU64
(
bitmap
.m_compressedBitmap);
550
}
551
}
552
else
553
{
554
if
(
m_compressed
)
555
{
556
NS_FATAL_ERROR
(
"Multi-tid block ack is not supported."
);
557
}
558
else
559
{
560
NS_FATAL_ERROR
(
"Reserved configuration."
);
561
}
562
}
563
return
i;
564
}
565
566
Buffer::Iterator
567
CtrlBAckResponseHeader::DeserializeBitmap
(
Buffer::Iterator
start
)
568
{
569
NS_LOG_FUNCTION
(
this
<< &start);
570
Buffer::Iterator
i =
start
;
571
if
(!
m_multiTid
)
572
{
573
if
(!
m_compressed
)
574
{
575
for
(uint32_t j = 0; j < 64; j++)
576
{
577
bitmap
.m_bitmap[j] = i.
ReadLsbtohU16
();
578
}
579
}
580
else
581
{
582
bitmap
.m_compressedBitmap = i.
ReadLsbtohU64
();
583
}
584
}
585
else
586
{
587
if
(
m_compressed
)
588
{
589
NS_FATAL_ERROR
(
"Multi-tid block ack is not supported."
);
590
}
591
else
592
{
593
NS_FATAL_ERROR
(
"Reserved configuration."
);
594
}
595
}
596
return
i;
597
}
598
599
void
600
CtrlBAckResponseHeader::SetReceivedPacket
(uint16_t seq)
601
{
602
NS_LOG_FUNCTION
(
this
<< seq);
603
if
(!
IsInBitmap
(seq))
604
{
605
return
;
606
}
607
if
(!
m_multiTid
)
608
{
609
if
(!
m_compressed
)
610
{
611
/* To set correctly basic block ack bitmap we need fragment number too.
612
So if it's not specified, we consider packet not fragmented. */
613
bitmap
.m_bitmap[
IndexInBitmap
(seq)] |= 0x0001;
614
}
615
else
616
{
617
bitmap
.m_compressedBitmap |= (uint64_t (0x0000000000000001) <<
IndexInBitmap
(seq));
618
}
619
}
620
else
621
{
622
if
(
m_compressed
)
623
{
624
NS_FATAL_ERROR
(
"Multi-tid block ack is not supported."
);
625
}
626
else
627
{
628
NS_FATAL_ERROR
(
"Reserved configuration."
);
629
}
630
}
631
}
632
633
void
634
CtrlBAckResponseHeader::SetReceivedFragment
(uint16_t seq, uint8_t frag)
635
{
636
NS_LOG_FUNCTION
(
this
<< seq << static_cast<uint32_t> (frag));
637
NS_ASSERT
(frag < 16);
638
if
(!
IsInBitmap
(seq))
639
{
640
return
;
641
}
642
if
(!
m_multiTid
)
643
{
644
if
(!
m_compressed
)
645
{
646
bitmap
.m_bitmap[
IndexInBitmap
(seq)] |= (0x0001 << frag);
647
}
648
else
649
{
650
/* We can ignore this...compressed block ack doesn't support
651
acknowledgement of single fragments */
652
}
653
}
654
else
655
{
656
if
(
m_compressed
)
657
{
658
NS_FATAL_ERROR
(
"Multi-tid block ack is not supported."
);
659
}
660
else
661
{
662
NS_FATAL_ERROR
(
"Reserved configuration."
);
663
}
664
}
665
}
666
667
bool
668
CtrlBAckResponseHeader::IsPacketReceived
(uint16_t seq)
const
669
{
670
NS_LOG_FUNCTION
(
this
<< seq);
671
if
(!
IsInBitmap
(seq))
672
{
673
return
false
;
674
}
675
if
(!
m_multiTid
)
676
{
677
if
(!
m_compressed
)
678
{
679
/*It's impossible to say if an entire packet was correctly received. */
680
return
false
;
681
}
682
else
683
{
684
uint64_t mask = uint64_t (0x0000000000000001);
685
return
(((
bitmap
.m_compressedBitmap >>
IndexInBitmap
(seq)) & mask) == 1) ?
true
:
false
;
686
}
687
}
688
else
689
{
690
if
(
m_compressed
)
691
{
692
NS_FATAL_ERROR
(
"Multi-tid block ack is not supported."
);
693
}
694
else
695
{
696
NS_FATAL_ERROR
(
"Reserved configuration."
);
697
}
698
}
699
return
false
;
700
}
701
702
bool
703
CtrlBAckResponseHeader::IsFragmentReceived
(uint16_t seq, uint8_t frag)
const
704
{
705
NS_LOG_FUNCTION
(
this
<< seq << static_cast<uint32_t> (frag));
706
NS_ASSERT
(frag < 16);
707
if
(!
IsInBitmap
(seq))
708
{
709
return
false
;
710
}
711
if
(!
m_multiTid
)
712
{
713
if
(!
m_compressed
)
714
{
715
return
((
bitmap
.m_bitmap[
IndexInBitmap
(seq)] & (0x0001 << frag)) != 0x0000) ?
true
:
false
;
716
}
717
else
718
{
719
/* Although this could make no sense, if packet with sequence number
720
equal to <i>seq</i> was correctly received, also all of its fragments
721
were correctly received. */
722
uint64_t mask = uint64_t (0x0000000000000001);
723
return
(((
bitmap
.m_compressedBitmap >>
IndexInBitmap
(seq)) & mask) == 1) ?
true
:
false
;
724
}
725
}
726
else
727
{
728
if
(
m_compressed
)
729
{
730
NS_FATAL_ERROR
(
"Multi-tid block ack is not supported."
);
731
}
732
else
733
{
734
NS_FATAL_ERROR
(
"Reserved configuration."
);
735
}
736
}
737
return
false
;
738
}
739
740
uint8_t
741
CtrlBAckResponseHeader::IndexInBitmap
(uint16_t seq)
const
742
{
743
NS_LOG_FUNCTION
(
this
<< seq);
744
uint8_t index;
745
if
(seq >=
m_startingSeq
)
746
{
747
index = seq -
m_startingSeq
;
748
}
749
else
750
{
751
index = 4096 -
m_startingSeq
+ seq;
752
}
753
NS_ASSERT
(index <= 63);
754
return
index;
755
}
756
757
bool
758
CtrlBAckResponseHeader::IsInBitmap
(uint16_t seq)
const
759
{
760
NS_LOG_FUNCTION
(
this
<< seq);
761
return
(seq -
m_startingSeq
+ 4096) % 4096 < 64;
762
}
763
764
const
uint16_t*
765
CtrlBAckResponseHeader::GetBitmap
(
void
)
const
766
{
767
NS_LOG_FUNCTION
(
this
);
768
return
bitmap
.m_bitmap;
769
}
770
771
uint64_t
772
CtrlBAckResponseHeader::GetCompressedBitmap
(
void
)
const
773
{
774
NS_LOG_FUNCTION
(
this
);
775
return
bitmap
.m_compressedBitmap;
776
}
777
778
void
779
CtrlBAckResponseHeader::ResetBitmap
(
void
)
780
{
781
NS_LOG_FUNCTION
(
this
);
782
memset (&
bitmap
, 0,
sizeof
(
bitmap
));
783
}
784
785
}
// namespace ns3
ns3::Header
Protocol header serialization and deserialization.
Definition:
header.h:42
ns3::CtrlBAckRequestHeader::SetType
void SetType(enum BlockAckType type)
Definition:
ctrl-headers.cc:197
ns3::CtrlBAckResponseHeader::bitmap
union ns3::CtrlBAckResponseHeader::@86 bitmap
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
Definition:
log.h:311
ns3::CtrlBAckRequestHeader::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Definition:
ctrl-headers.cc:60
ns3::CtrlBAckRequestHeader::m_compressed
bool m_compressed
Definition:
ctrl-headers.h:85
ns3::CtrlBAckRequestHeader::IsBasic
bool IsBasic(void) const
Definition:
ctrl-headers.cc:257
ns3::CtrlBAckResponseHeader::GetStartingSequence
uint16_t GetStartingSequence(void) const
Definition:
ctrl-headers.cc:461
ns3::CtrlBAckRequestHeader::CtrlBAckRequestHeader
CtrlBAckRequestHeader()
Definition:
ctrl-headers.cc:35
ns3::CtrlBAckResponseHeader::SetStartingSequenceControl
void SetStartingSequenceControl(uint16_t seqControl)
Definition:
ctrl-headers.cc:527
NS_ASSERT
#define NS_ASSERT(condition)
Definition:
assert.h:64
ns3::CtrlBAckRequestHeader::IsMultiTid
bool IsMultiTid(void) const
Definition:
ctrl-headers.cc:271
ns3::CtrlBAckRequestHeader::SetBarControl
void SetBarControl(uint16_t bar)
Definition:
ctrl-headers.cc:166
ns3::CtrlBAckResponseHeader::IsPacketReceived
bool IsPacketReceived(uint16_t seq) const
Definition:
ctrl-headers.cc:668
ns3::MULTI_TID_BLOCK_ACK
Definition:
ctrl-headers.h:31
ns3::CtrlBAckResponseHeader::IsCompressed
bool IsCompressed(void) const
Definition:
ctrl-headers.cc:475
ns3::CtrlBAckRequestHeader::SetHtImmediateAck
void SetHtImmediateAck(bool immediateAck)
Definition:
ctrl-headers.cc:190
NS_LOG_FUNCTION_NOARGS
#define NS_LOG_FUNCTION_NOARGS()
Definition:
log.h:275
visualizer.core.start
def start
Definition:
core.py:1482
ns3::BlockAckType
BlockAckType
Definition:
ctrl-headers.h:27
ns3::CtrlBAckResponseHeader::m_baAckPolicy
bool m_baAckPolicy
Definition:
ctrl-headers.h:176
ns3::CtrlBAckResponseHeader::SetStartingSequence
void SetStartingSequence(uint16_t seq)
Definition:
ctrl-headers.cc:439
ns3::CtrlBAckResponseHeader::SetTidInfo
void SetTidInfo(uint8_t tid)
Definition:
ctrl-headers.cc:432
NS_LOG_COMPONENT_DEFINE
NS_LOG_COMPONENT_DEFINE("CtrlHeaders")
ns3::Buffer::Iterator::GetDistanceFrom
uint32_t GetDistanceFrom(Iterator const &o) const
Definition:
buffer.cc:807
NS_FATAL_ERROR
#define NS_FATAL_ERROR(msg)
fatal error handling
Definition:
fatal-error.h:72
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition:
buffer.h:98
ctrl-headers.h
ns3::CtrlBAckResponseHeader::GetTidInfo
uint8_t GetTidInfo(void) const
Definition:
ctrl-headers.cc:453
ns3::CtrlBAckRequestHeader::Print
virtual void Print(std::ostream &os) const
Definition:
ctrl-headers.cc:67
ns3::CtrlBAckResponseHeader::~CtrlBAckResponseHeader
~CtrlBAckResponseHeader()
Definition:
ctrl-headers.cc:292
ns3::CtrlBAckResponseHeader::SetBaControl
void SetBaControl(uint16_t bar)
Definition:
ctrl-headers.cc:510
ns3::CtrlBAckRequestHeader::m_multiTid
bool m_multiTid
Definition:
ctrl-headers.h:84
ns3::CtrlBAckResponseHeader::GetBaControl
uint16_t GetBaControl(void) const
Definition:
ctrl-headers.cc:489
ns3::CtrlBAckRequestHeader::m_barAckPolicy
bool m_barAckPolicy
Definition:
ctrl-headers.h:83
ns3::NS_OBJECT_ENSURE_REGISTERED
NS_OBJECT_ENSURE_REGISTERED(AntennaModel)
ns3::CtrlBAckRequestHeader::GetSerializedSize
virtual uint32_t GetSerializedSize(void) const
Definition:
ctrl-headers.cc:74
ns3::CtrlBAckRequestHeader::m_startingSeq
uint16_t m_startingSeq
Definition:
ctrl-headers.h:87
ns3::CtrlBAckResponseHeader::SetHtImmediateAck
void SetHtImmediateAck(bool immeadiateAck)
Definition:
ctrl-headers.cc:401
ns3::CtrlBAckResponseHeader::IndexInBitmap
uint8_t IndexInBitmap(uint16_t seq) const
Definition:
ctrl-headers.cc:741
ns3::CtrlBAckResponseHeader
Headers for Block ack response.
Definition:
ctrl-headers.h:102
ns3::CtrlBAckRequestHeader::GetTypeId
static TypeId GetTypeId(void)
Definition:
ctrl-headers.cc:49
ns3::CtrlBAckRequestHeader::GetStartingSequenceControl
uint16_t GetStartingSequenceControl(void) const
Definition:
ctrl-headers.cc:176
ns3::CtrlBAckResponseHeader::m_tidInfo
uint16_t m_tidInfo
Definition:
ctrl-headers.h:179
ns3::CtrlBAckResponseHeader::IsFragmentReceived
bool IsFragmentReceived(uint16_t seq, uint8_t frag) const
Definition:
ctrl-headers.cc:703
ns3::CtrlBAckResponseHeader::GetSerializedSize
virtual uint32_t GetSerializedSize(void) const
Definition:
ctrl-headers.cc:321
ns3::CtrlBAckResponseHeader::CtrlBAckResponseHeader
CtrlBAckResponseHeader()
Definition:
ctrl-headers.cc:283
ns3::CtrlBAckResponseHeader::SerializeBitmap
Buffer::Iterator SerializeBitmap(Buffer::Iterator start) const
Definition:
ctrl-headers.cc:534
ns3::CtrlBAckRequestHeader::Deserialize
virtual uint32_t Deserialize(Buffer::Iterator start)
Definition:
ctrl-headers.cc:121
ns3::CtrlBAckRequestHeader::SetTidInfo
void SetTidInfo(uint8_t tid)
Definition:
ctrl-headers.cc:221
ns3::CtrlBAckRequestHeader::GetStartingSequence
uint16_t GetStartingSequence(void) const
Definition:
ctrl-headers.cc:250
ns3::CtrlBAckResponseHeader::DeserializeBitmap
Buffer::Iterator DeserializeBitmap(Buffer::Iterator start)
Definition:
ctrl-headers.cc:567
ns3::CtrlBAckResponseHeader::m_multiTid
bool m_multiTid
Definition:
ctrl-headers.h:177
ns3::CtrlBAckResponseHeader::GetTypeId
static TypeId GetTypeId(void)
Definition:
ctrl-headers.cc:298
ns3::CtrlBAckResponseHeader::SetType
void SetType(enum BlockAckType type)
Definition:
ctrl-headers.cc:408
ns3::CtrlBAckResponseHeader::IsBasic
bool IsBasic(void) const
Definition:
ctrl-headers.cc:468
ns3::CtrlBAckResponseHeader::GetStartingSequenceControl
uint16_t GetStartingSequenceControl(void) const
Definition:
ctrl-headers.cc:520
ns3::CtrlBAckResponseHeader::Serialize
virtual void Serialize(Buffer::Iterator start) const
Definition:
ctrl-headers.cc:352
ns3::CtrlBAckResponseHeader::ResetBitmap
void ResetBitmap(void)
Definition:
ctrl-headers.cc:779
ns3::CtrlBAckResponseHeader::IsInBitmap
bool IsInBitmap(uint16_t seq) const
Definition:
ctrl-headers.cc:758
ns3::CtrlBAckResponseHeader::m_compressed
bool m_compressed
Definition:
ctrl-headers.h:178
ns3::CtrlBAckRequestHeader::GetTidInfo
uint8_t GetTidInfo(void) const
Definition:
ctrl-headers.cc:242
ns3::CtrlBAckRequestHeader::~CtrlBAckRequestHeader
~CtrlBAckRequestHeader()
Definition:
ctrl-headers.cc:43
ns3::Buffer::Iterator::WriteHtolsbU16
void WriteHtolsbU16(uint16_t data)
Definition:
buffer.cc:935
ns3::CtrlBAckResponseHeader::m_startingSeq
uint16_t m_startingSeq
Definition:
ctrl-headers.h:180
ns3::CtrlBAckResponseHeader::SetReceivedFragment
void SetReceivedFragment(uint16_t seq, uint8_t frag)
Definition:
ctrl-headers.cc:634
ns3::CtrlBAckRequestHeader::Serialize
virtual void Serialize(Buffer::Iterator start) const
Definition:
ctrl-headers.cc:98
ns3::CtrlBAckRequestHeader::SetStartingSequenceControl
void SetStartingSequenceControl(uint16_t seqControl)
Definition:
ctrl-headers.cc:183
ns3::CtrlBAckResponseHeader::SetReceivedPacket
void SetReceivedPacket(uint16_t seq)
Definition:
ctrl-headers.cc:600
ns3::CtrlBAckRequestHeader::GetBarControl
uint16_t GetBarControl(void) const
Definition:
ctrl-headers.cc:145
ns3::CtrlBAckRequestHeader::MustSendHtImmediateAck
bool MustSendHtImmediateAck(void) const
Definition:
ctrl-headers.cc:235
ns3::COMPRESSED_BLOCK_ACK
Definition:
ctrl-headers.h:30
ns3::Buffer::Iterator::WriteHtolsbU64
void WriteHtolsbU64(uint64_t data)
Definition:
buffer.cc:951
ns3::CtrlBAckResponseHeader::GetBitmap
const uint16_t * GetBitmap(void) const
Definition:
ctrl-headers.cc:765
ns3::CtrlBAckResponseHeader::Deserialize
virtual uint32_t Deserialize(Buffer::Iterator start)
Definition:
ctrl-headers.cc:376
ns3::CtrlBAckRequestHeader::m_tidInfo
uint16_t m_tidInfo
Definition:
ctrl-headers.h:86
ns3::Buffer::Iterator::ReadLsbtohU16
uint16_t ReadLsbtohU16(void)
Definition:
buffer.cc:1090
ns3::CtrlBAckResponseHeader::Print
virtual void Print(std::ostream &os) const
Definition:
ctrl-headers.cc:314
ns3::CtrlBAckRequestHeader::IsCompressed
bool IsCompressed(void) const
Definition:
ctrl-headers.cc:264
ns3::CtrlBAckResponseHeader::MustSendHtImmediateAck
bool MustSendHtImmediateAck(void) const
Definition:
ctrl-headers.cc:446
ns3::Buffer::Iterator::ReadLsbtohU64
uint64_t ReadLsbtohU64(void)
Definition:
buffer.cc:1118
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:49
ns3::CtrlBAckRequestHeader::SetStartingSequence
void SetStartingSequence(uint16_t seq)
Definition:
ctrl-headers.cc:228
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Definition:
type-id.cc:610
ns3::CtrlBAckResponseHeader::IsMultiTid
bool IsMultiTid(void) const
Definition:
ctrl-headers.cc:482
ns3::BASIC_BLOCK_ACK
Definition:
ctrl-headers.h:29
ns3::CtrlBAckResponseHeader::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Definition:
ctrl-headers.cc:308
ns3::CtrlBAckResponseHeader::GetCompressedBitmap
uint64_t GetCompressedBitmap(void) const
Definition:
ctrl-headers.cc:772
src
wifi
model
ctrl-headers.cc
Generated on Sun Apr 20 2014 11:15:04 for ns-3 by
1.8.6