A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
ampdu-tag.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2013
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Authors: Ghada Badawy <gbadawy@gmail.com>
7
* Sébastien Deronne <sebastien.deronne@gmail.com>
8
*/
9
10
#include "
ampdu-tag.h
"
11
12
namespace
ns3
13
{
14
15
NS_OBJECT_ENSURE_REGISTERED
(AmpduTag);
16
17
TypeId
18
AmpduTag::GetTypeId
()
19
{
20
static
TypeId
tid =
21
TypeId
(
"ns3::AmpduTag"
).
SetParent
<
Tag
>().SetGroupName(
"Wifi"
).AddConstructor<
AmpduTag
>();
22
return
tid;
23
}
24
25
TypeId
26
AmpduTag::GetInstanceTypeId
()
const
27
{
28
return
GetTypeId
();
29
}
30
31
AmpduTag::AmpduTag
()
32
: m_nbOfMpdus(0),
33
m_duration()
34
{
35
}
36
37
void
38
AmpduTag::SetRemainingNbOfMpdus
(uint8_t nbOfMpdus)
39
{
40
m_nbOfMpdus
= nbOfMpdus;
41
}
42
43
void
44
AmpduTag::SetRemainingAmpduDuration
(
Time
duration)
45
{
46
NS_ASSERT
(
m_duration
<=
MilliSeconds
(10));
47
m_duration
= duration;
48
}
49
50
uint32_t
51
AmpduTag::GetSerializedSize
()
const
52
{
53
return
(1 +
sizeof
(
Time
));
54
}
55
56
void
57
AmpduTag::Serialize
(
TagBuffer
i)
const
58
{
59
i.
WriteU8
(
m_nbOfMpdus
);
60
int64_t duration =
m_duration
.
GetTimeStep
();
61
i.
Write
((
const
uint8_t*)&duration,
sizeof
(int64_t));
62
}
63
64
void
65
AmpduTag::Deserialize
(
TagBuffer
i)
66
{
67
m_nbOfMpdus
= i.
ReadU8
();
68
int64_t duration;
69
i.
Read
((uint8_t*)&duration,
sizeof
(int64_t));
70
m_duration
=
Time
(duration);
71
}
72
73
uint8_t
74
AmpduTag::GetRemainingNbOfMpdus
()
const
75
{
76
return
m_nbOfMpdus
;
77
}
78
79
Time
80
AmpduTag::GetRemainingAmpduDuration
()
const
81
{
82
return
m_duration
;
83
}
84
85
void
86
AmpduTag::Print
(std::ostream& os)
const
87
{
88
os <<
"Remaining number of MPDUs="
<<
m_nbOfMpdus
89
<<
" Remaining A-MPDU duration="
<<
m_duration
;
90
}
91
92
}
// namespace ns3
ampdu-tag.h
ns3::AmpduTag
The aim of the AmpduTag is to provide means for a MAC to specify that a packet includes A-MPDU since ...
Definition
ampdu-tag.h:26
ns3::AmpduTag::GetSerializedSize
uint32_t GetSerializedSize() const override
Definition
ampdu-tag.cc:51
ns3::AmpduTag::AmpduTag
AmpduTag()
Create a AmpduTag with the default =0 no A-MPDU.
Definition
ampdu-tag.cc:31
ns3::AmpduTag::SetRemainingNbOfMpdus
void SetRemainingNbOfMpdus(uint8_t nbOfMpdus)
Definition
ampdu-tag.cc:38
ns3::AmpduTag::m_duration
Time m_duration
Remaining duration of the A-MPDU.
Definition
ampdu-tag.h:72
ns3::AmpduTag::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
ampdu-tag.cc:18
ns3::AmpduTag::GetRemainingAmpduDuration
Time GetRemainingAmpduDuration() const
Definition
ampdu-tag.cc:80
ns3::AmpduTag::Deserialize
void Deserialize(TagBuffer i) override
Definition
ampdu-tag.cc:65
ns3::AmpduTag::SetRemainingAmpduDuration
void SetRemainingAmpduDuration(Time duration)
Definition
ampdu-tag.cc:44
ns3::AmpduTag::Serialize
void Serialize(TagBuffer i) const override
Definition
ampdu-tag.cc:57
ns3::AmpduTag::Print
void Print(std::ostream &os) const override
Definition
ampdu-tag.cc:86
ns3::AmpduTag::GetRemainingNbOfMpdus
uint8_t GetRemainingNbOfMpdus() const
Definition
ampdu-tag.cc:74
ns3::AmpduTag::m_nbOfMpdus
uint8_t m_nbOfMpdus
Remaining number of MPDUs in the A-MPDU.
Definition
ampdu-tag.h:71
ns3::AmpduTag::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition
ampdu-tag.cc:26
ns3::TagBuffer
read and write tag data
Definition
tag-buffer.h:41
ns3::TagBuffer::Read
void Read(uint8_t *buffer, uint32_t size)
Definition
tag-buffer.cc:172
ns3::TagBuffer::WriteU8
TAG_BUFFER_INLINE void WriteU8(uint8_t v)
Definition
tag-buffer.h:161
ns3::TagBuffer::ReadU8
TAG_BUFFER_INLINE uint8_t ReadU8()
Definition
tag-buffer.h:185
ns3::TagBuffer::Write
void Write(const uint8_t *buffer, uint32_t size)
Definition
tag-buffer.cc:118
ns3::Tag
tag a set of bytes in a packet
Definition
tag.h:28
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:94
ns3::Time::GetTimeStep
int64_t GetTimeStep() const
Get the raw time value, in the current resolution unit.
Definition
nstime.h:434
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:49
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition
type-id.cc:1001
uint32_t
NS_ASSERT
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition
assert.h:55
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition
object-base.h:35
ns3::MilliSeconds
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition
nstime.h:1357
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
wifi
model
ampdu-tag.cc
Generated on Wed Mar 26 2025 11:06:51 for ns-3 by
1.11.0