A Discrete-Event Network Simulator
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
12namespace ns3
13{
14
16
17TypeId
19{
20 static TypeId tid =
21 TypeId("ns3::AmpduTag").SetParent<Tag>().SetGroupName("Wifi").AddConstructor<AmpduTag>();
22 return tid;
23}
24
27{
28 return GetTypeId();
29}
30
32 : m_nbOfMpdus(0),
33 m_duration(Seconds(0))
34{
35}
36
37void
39{
40 m_nbOfMpdus = nbOfMpdus;
41}
42
43void
49
52{
53 return (1 + sizeof(Time));
54}
55
56void
58{
60 int64_t duration = m_duration.GetTimeStep();
61 i.Write((const uint8_t*)&duration, sizeof(int64_t));
62}
63
64void
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
73uint8_t
78
79Time
84
85void
86AmpduTag::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
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
uint32_t GetSerializedSize() const override
Definition ampdu-tag.cc:51
AmpduTag()
Create a AmpduTag with the default =0 no A-MPDU.
Definition ampdu-tag.cc:31
void SetRemainingNbOfMpdus(uint8_t nbOfMpdus)
Definition ampdu-tag.cc:38
Time m_duration
Remaining duration of the A-MPDU.
Definition ampdu-tag.h:72
static TypeId GetTypeId()
Get the type ID.
Definition ampdu-tag.cc:18
Time GetRemainingAmpduDuration() const
Definition ampdu-tag.cc:80
void Deserialize(TagBuffer i) override
Definition ampdu-tag.cc:65
void SetRemainingAmpduDuration(Time duration)
Definition ampdu-tag.cc:44
void Serialize(TagBuffer i) const override
Definition ampdu-tag.cc:57
void Print(std::ostream &os) const override
Definition ampdu-tag.cc:86
uint8_t GetRemainingNbOfMpdus() const
Definition ampdu-tag.cc:74
uint8_t m_nbOfMpdus
Remaining number of MPDUs in the A-MPDU.
Definition ampdu-tag.h:71
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition ampdu-tag.cc:26
read and write tag data
Definition tag-buffer.h:41
void Read(uint8_t *buffer, uint32_t size)
TAG_BUFFER_INLINE void WriteU8(uint8_t v)
Definition tag-buffer.h:161
TAG_BUFFER_INLINE uint8_t ReadU8()
Definition tag-buffer.h:185
void Write(const uint8_t *buffer, uint32_t size)
tag a set of bytes in a packet
Definition tag.h:28
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
int64_t GetTimeStep() const
Get the raw time value, in the current resolution unit.
Definition nstime.h:434
a unique identifier for an interface.
Definition type-id.h:48
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
#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
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1308
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1320
Every class exported by the ns3 library is enclosed in the ns3 namespace.