A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
wifi
model
ctrl-headers.h
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
21
#ifndef CTRL_HEADERS_H
22
#define CTRL_HEADERS_H
23
24
#include "ns3/header.h"
25
#include "
block-ack-type.h
"
26
27
namespace
ns3
{
28
41
class
CtrlBAckRequestHeader
:
public
Header
42
{
43
public
:
44
CtrlBAckRequestHeader
();
45
~CtrlBAckRequestHeader
();
50
static
TypeId
GetTypeId
(
void
);
51
TypeId
GetInstanceTypeId
(
void
)
const
;
52
void
Print
(std::ostream &os)
const
;
53
uint32_t
GetSerializedSize
(
void
)
const
;
54
void
Serialize
(
Buffer::Iterator
start
)
const
;
55
uint32_t
Deserialize
(
Buffer::Iterator
start
);
56
62
void
SetHtImmediateAck
(
bool
immediateAck);
68
void
SetType
(
BlockAckType
type);
74
void
SetTidInfo
(uint8_t tid);
81
void
SetStartingSequence
(uint16_t seq);
82
89
bool
MustSendHtImmediateAck
(
void
)
const
;
95
uint8_t
GetTidInfo
(
void
)
const
;
101
uint16_t
GetStartingSequence
(
void
)
const
;
109
bool
IsBasic
(
void
)
const
;
117
bool
IsCompressed
(
void
)
const
;
124
bool
IsMultiTid
(
void
)
const
;
125
131
uint16_t
GetStartingSequenceControl
(
void
)
const
;
132
133
134
private
:
141
void
SetStartingSequenceControl
(uint16_t seqControl);
147
uint16_t
GetBarControl
(
void
)
const
;
153
void
SetBarControl
(uint16_t bar);
154
161
bool
m_barAckPolicy
;
162
bool
m_multiTid
;
163
bool
m_compressed
;
164
uint16_t
m_tidInfo
;
165
uint16_t
m_startingSeq
;
166
};
167
168
181
class
CtrlBAckResponseHeader
:
public
Header
182
{
183
public
:
184
CtrlBAckResponseHeader
();
185
~CtrlBAckResponseHeader
();
190
static
TypeId
GetTypeId
(
void
);
191
TypeId
GetInstanceTypeId
(
void
)
const
;
192
void
Print
(std::ostream &os)
const
;
193
uint32_t
GetSerializedSize
(
void
)
const
;
194
void
Serialize
(
Buffer::Iterator
start
)
const
;
195
uint32_t
Deserialize
(
Buffer::Iterator
start
);
196
202
void
SetHtImmediateAck
(
bool
immediateAck);
208
void
SetType
(
BlockAckType
type);
214
void
SetTidInfo
(uint8_t tid);
221
void
SetStartingSequence
(uint16_t seq);
222
229
bool
MustSendHtImmediateAck
(
void
)
const
;
235
uint8_t
GetTidInfo
(
void
)
const
;
241
uint16_t
GetStartingSequence
(
void
)
const
;
249
bool
IsBasic
(
void
)
const
;
257
bool
IsCompressed
(
void
)
const
;
264
bool
IsMultiTid
(
void
)
const
;
265
272
void
SetReceivedPacket
(uint16_t seq);
280
void
SetReceivedFragment
(uint16_t seq, uint8_t frag);
289
bool
IsPacketReceived
(uint16_t seq)
const
;
300
bool
IsFragmentReceived
(uint16_t seq, uint8_t frag)
const
;
301
307
uint16_t
GetStartingSequenceControl
(
void
)
const
;
314
void
SetStartingSequenceControl
(uint16_t seqControl);
320
const
uint16_t*
GetBitmap
(
void
)
const
;
326
uint64_t
GetCompressedBitmap
(
void
)
const
;
327
331
void
ResetBitmap
(
void
);
332
333
334
private
:
340
uint16_t
GetBaControl
(
void
)
const
;
346
void
SetBaControl
(uint16_t bar);
347
354
Buffer::Iterator
SerializeBitmap
(
Buffer::Iterator
start
)
const
;
361
Buffer::Iterator
DeserializeBitmap
(
Buffer::Iterator
start
);
362
377
uint16_t
IndexInBitmap
(uint16_t seq)
const
;
378
386
bool
IsInBitmap
(uint16_t seq)
const
;
387
394
bool
m_baAckPolicy
;
395
bool
m_multiTid
;
396
bool
m_compressed
;
397
uint16_t
m_tidInfo
;
398
uint16_t
m_startingSeq
;
399
400
union
401
{
402
uint16_t
m_bitmap
[64];
403
uint64_t
m_compressedBitmap
;
404
}
bitmap
;
405
};
406
407
}
//namespace ns3
408
409
#endif
/* CTRL_HEADERS_H */
ns3::Header
Protocol header serialization and deserialization.
Definition:
header.h:42
ns3::CtrlBAckRequestHeader::GetInstanceTypeId
TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Definition:
ctrl-headers.cc:55
ns3::CtrlBAckResponseHeader::GetTidInfo
uint8_t GetTidInfo(void) const
Return the Traffic ID (TID).
Definition:
ctrl-headers.cc:405
ns3::CtrlBAckResponseHeader::SerializeBitmap
Buffer::Iterator SerializeBitmap(Buffer::Iterator start) const
Serialize bitmap to the given buffer.
Definition:
ctrl-headers.cc:477
ns3::CtrlBAckResponseHeader::GetBaControl
uint16_t GetBaControl(void) const
Return the block ACK control.
Definition:
ctrl-headers.cc:436
ns3::CtrlBAckRequestHeader::m_compressed
bool m_compressed
compressed
Definition:
ctrl-headers.h:163
ns3::CtrlBAckRequestHeader::CtrlBAckRequestHeader
CtrlBAckRequestHeader()
Definition:
ctrl-headers.cc:32
visualizer.core.start
def start()
Definition:
core.py:1844
ns3::CtrlBAckResponseHeader::GetSerializedSize
uint32_t GetSerializedSize(void) const
Definition:
ctrl-headers.cc:287
ns3::CtrlBAckResponseHeader::SetStartingSequenceControl
void SetStartingSequenceControl(uint16_t seqControl)
Set the starting sequence control with the given sequence control value.
Definition:
ctrl-headers.cc:471
ns3::CtrlBAckRequestHeader::SetBarControl
void SetBarControl(uint16_t bar)
Set the Block ACK control.
Definition:
ctrl-headers.cc:146
ns3::CtrlBAckRequestHeader::SetHtImmediateAck
void SetHtImmediateAck(bool immediateAck)
Enable or disable HT immediate ACK.
Definition:
ctrl-headers.cc:167
block-ack-type.h
ns3::CtrlBAckResponseHeader::m_baAckPolicy
bool m_baAckPolicy
The lsb bit of the BA control field is used only for the HT (High Throughput) delayed block ack confi...
Definition:
ctrl-headers.h:394
ns3::CtrlBAckResponseHeader::SetStartingSequence
void SetStartingSequence(uint16_t seq)
Set the starting sequence number from the given raw sequence control field.
Definition:
ctrl-headers.cc:393
ns3::CtrlBAckResponseHeader::Serialize
void Serialize(Buffer::Iterator start) const
Definition:
ctrl-headers.cc:317
ns3::CtrlBAckResponseHeader::SetTidInfo
void SetTidInfo(uint8_t tid)
Set Traffic ID (TID).
Definition:
ctrl-headers.cc:387
ns3::CtrlBAckResponseHeader::IsBasic
bool IsBasic(void) const
Check if the current ACK policy is basic (i.e.
Definition:
ctrl-headers.cc:418
ns3::CtrlBAckRequestHeader::SetType
void SetType(BlockAckType type)
Set the block ACK type.
Definition:
ctrl-headers.cc:173
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition:
buffer.h:98
ns3::CtrlBAckRequestHeader::GetTidInfo
uint8_t GetTidInfo(void) const
Return the Traffic ID (TID).
Definition:
ctrl-headers.cc:214
ns3::CtrlBAckResponseHeader::bitmap
union ns3::CtrlBAckResponseHeader::@72 bitmap
bitmap union type
ns3::CtrlBAckResponseHeader::IsCompressed
bool IsCompressed(void) const
Check if the current ACK policy is compressed ACK and not multiple TID.
Definition:
ctrl-headers.cc:424
ns3::CtrlBAckRequestHeader::MustSendHtImmediateAck
bool MustSendHtImmediateAck(void) const
Check if the current ACK policy is immediate.
Definition:
ctrl-headers.cc:208
ns3::CtrlBAckResponseHeader::~CtrlBAckResponseHeader
~CtrlBAckResponseHeader()
Definition:
ctrl-headers.cc:259
ns3::CtrlBAckResponseHeader::SetBaControl
void SetBaControl(uint16_t bar)
Set the block ACK control.
Definition:
ctrl-headers.cc:456
ns3::CtrlBAckRequestHeader::m_multiTid
bool m_multiTid
multi TID
Definition:
ctrl-headers.h:162
ns3::CtrlBAckRequestHeader::m_barAckPolicy
bool m_barAckPolicy
The lsb bit of the BAR control field is used only for the HT (High Throughput) delayed block ack conf...
Definition:
ctrl-headers.h:161
ns3::CtrlBAckResponseHeader::GetStartingSequenceControl
uint16_t GetStartingSequenceControl(void) const
Return the starting sequence control.
Definition:
ctrl-headers.cc:465
ns3::CtrlBAckRequestHeader::Print
void Print(std::ostream &os) const
Definition:
ctrl-headers.cc:61
ns3::CtrlBAckResponseHeader::GetCompressedBitmap
uint64_t GetCompressedBitmap(void) const
Return the compressed bitmap from the block ACK response header.
Definition:
ctrl-headers.cc:706
ns3::CtrlBAckRequestHeader::m_startingSeq
uint16_t m_startingSeq
starting seq
Definition:
ctrl-headers.h:165
ns3::CtrlBAckResponseHeader::IsPacketReceived
bool IsPacketReceived(uint16_t seq) const
Check if the packet with the given sequence number was ACKed in this Block ACK response.
Definition:
ctrl-headers.cc:607
ns3::CtrlBAckResponseHeader
Headers for Block ack response.
Definition:
ctrl-headers.h:181
ns3::CtrlBAckRequestHeader::GetSerializedSize
uint32_t GetSerializedSize(void) const
Definition:
ctrl-headers.cc:67
ns3::CtrlBAckRequestHeader::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
ctrl-headers.cc:44
ns3::CtrlBAckResponseHeader::m_tidInfo
uint16_t m_tidInfo
TID info.
Definition:
ctrl-headers.h:397
ns3::CtrlBAckRequestHeader::IsCompressed
bool IsCompressed(void) const
Check if the current ACK policy is compressed ACK and not multiple TID.
Definition:
ctrl-headers.cc:233
ns3::CtrlBAckResponseHeader::GetStartingSequence
uint16_t GetStartingSequence(void) const
Return the starting sequence number.
Definition:
ctrl-headers.cc:412
ns3::CtrlBAckResponseHeader::IndexInBitmap
uint16_t IndexInBitmap(uint16_t seq) const
This function is used to correctly index in both bitmap and compressed bitmap, one bit or one block o...
Definition:
ctrl-headers.cc:678
ns3::CtrlBAckResponseHeader::GetBitmap
const uint16_t * GetBitmap(void) const
Return the bitmap from the block ACK response header.
Definition:
ctrl-headers.cc:700
ns3::CtrlBAckResponseHeader::CtrlBAckResponseHeader
CtrlBAckResponseHeader()
Definition:
ctrl-headers.cc:251
ns3::CtrlBAckRequestHeader::Deserialize
uint32_t Deserialize(Buffer::Iterator start)
Definition:
ctrl-headers.cc:106
ns3::CtrlBAckRequestHeader::SetTidInfo
void SetTidInfo(uint8_t tid)
Set Traffic ID (TID).
Definition:
ctrl-headers.cc:196
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::CtrlBAckResponseHeader::DeserializeBitmap
Buffer::Iterator DeserializeBitmap(Buffer::Iterator start)
Deserialize bitmap from the given buffer.
Definition:
ctrl-headers.cc:509
ns3::CtrlBAckResponseHeader::m_multiTid
bool m_multiTid
multi TID
Definition:
ctrl-headers.h:395
ns3::CtrlBAckResponseHeader::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
ctrl-headers.cc:264
ns3::CtrlBAckResponseHeader::SetType
void SetType(BlockAckType type)
Set the block ACK type.
Definition:
ctrl-headers.cc:364
ns3::CtrlBAckRequestHeader::IsMultiTid
bool IsMultiTid(void) const
Check if the current ACK policy has multiple TID.
Definition:
ctrl-headers.cc:239
ns3::CtrlBAckRequestHeader::IsBasic
bool IsBasic(void) const
Check if the current ACK policy is basic (i.e.
Definition:
ctrl-headers.cc:227
ns3::CtrlBAckRequestHeader::GetStartingSequence
uint16_t GetStartingSequence(void) const
Return the starting sequence number.
Definition:
ctrl-headers.cc:221
ns3::CtrlBAckResponseHeader::ResetBitmap
void ResetBitmap(void)
Reset the bitmap to 0.
Definition:
ctrl-headers.cc:712
ns3::CtrlBAckResponseHeader::m_compressed
bool m_compressed
compressed
Definition:
ctrl-headers.h:396
ns3::CtrlBAckResponseHeader::IsFragmentReceived
bool IsFragmentReceived(uint16_t seq, uint8_t frag) const
Check if the packet with the given sequence number and fragment number was ACKed in this Block ACK re...
Definition:
ctrl-headers.cc:641
ns3::CtrlBAckRequestHeader::~CtrlBAckRequestHeader
~CtrlBAckRequestHeader()
Definition:
ctrl-headers.cc:39
ns3::CtrlBAckResponseHeader::m_startingSeq
uint16_t m_startingSeq
starting seq
Definition:
ctrl-headers.h:398
ns3::CtrlBAckResponseHeader::SetReceivedFragment
void SetReceivedFragment(uint16_t seq, uint8_t frag)
Set the bitmap that the packet with the given sequence number and fragment number was received...
Definition:
ctrl-headers.cc:574
ns3::CtrlBAckResponseHeader::m_bitmap
uint16_t m_bitmap[64]
the block ack bitmap
Definition:
ctrl-headers.h:402
ns3::CtrlBAckResponseHeader::GetInstanceTypeId
TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Definition:
ctrl-headers.cc:275
ns3::CtrlBAckResponseHeader::m_compressedBitmap
uint64_t m_compressedBitmap
the compressed block ack bitmap
Definition:
ctrl-headers.h:403
ns3::CtrlBAckRequestHeader::SetStartingSequenceControl
void SetStartingSequenceControl(uint16_t seqControl)
Set the starting sequence control with the given sequence control value.
Definition:
ctrl-headers.cc:161
ns3::CtrlBAckResponseHeader::SetReceivedPacket
void SetReceivedPacket(uint16_t seq)
Set the bitmap that the packet with the given sequence number was received.
Definition:
ctrl-headers.cc:541
ns3::CtrlBAckRequestHeader::GetBarControl
uint16_t GetBarControl(void) const
Return the Block ACK control.
Definition:
ctrl-headers.cc:126
ns3::CtrlBAckResponseHeader::IsInBitmap
bool IsInBitmap(uint16_t seq) const
Checks if sequence number seq can be acknowledged in the bitmap.
Definition:
ctrl-headers.cc:694
ns3::CtrlBAckResponseHeader::Deserialize
uint32_t Deserialize(Buffer::Iterator start)
Definition:
ctrl-headers.cc:337
ns3::CtrlBAckRequestHeader::m_tidInfo
uint16_t m_tidInfo
TID info.
Definition:
ctrl-headers.h:164
ns3::CtrlBAckResponseHeader::IsMultiTid
bool IsMultiTid(void) const
Check if the current ACK policy has multiple TID.
Definition:
ctrl-headers.cc:430
ns3::CtrlBAckResponseHeader::SetHtImmediateAck
void SetHtImmediateAck(bool immediateAck)
Enable or disable HT immediate ACK.
Definition:
ctrl-headers.cc:358
ns3::CtrlBAckResponseHeader::Print
void Print(std::ostream &os) const
Definition:
ctrl-headers.cc:281
ns3::CtrlBAckRequestHeader::Serialize
void Serialize(Buffer::Iterator start) const
Definition:
ctrl-headers.cc:87
ns3::CtrlBAckRequestHeader
Headers for Block ack request.
Definition:
ctrl-headers.h:41
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:58
ns3::CtrlBAckRequestHeader::SetStartingSequence
void SetStartingSequence(uint16_t seq)
Set the starting sequence number from the given raw sequence control field.
Definition:
ctrl-headers.cc:202
ns3::CtrlBAckRequestHeader::GetStartingSequenceControl
uint16_t GetStartingSequenceControl(void) const
Return the starting sequence control.
Definition:
ctrl-headers.cc:155
ns3::CtrlBAckResponseHeader::MustSendHtImmediateAck
bool MustSendHtImmediateAck(void) const
Check if the current ACK policy is immediate.
Definition:
ctrl-headers.cc:399
ns3::BlockAckType
BlockAckType
The different block ACK policies.
Definition:
block-ack-type.h:30
Generated on Wed Nov 7 2018 10:02:13 for ns-3 by
1.8.14