A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
amsdu-subframe-header.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 MIRKO BANCHI
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Mirko Banchi <mk.banchi@gmail.com>
7 */
8
10
11#include "ns3/address-utils.h"
12
13namespace ns3
14{
15
16NS_OBJECT_ENSURE_REGISTERED(AmsduSubframeHeader);
17
18TypeId
20{
21 static TypeId tid = TypeId("ns3::AmsduSubframeHeader")
23 .SetGroupName("Wifi")
24 .AddConstructor<AmsduSubframeHeader>();
25 return tid;
26}
27
33
38
42
45{
46 return (6 + 6 + 2);
47}
48
49void
56
59{
60 Buffer::Iterator i = start;
61 ReadFrom(i, m_da);
62 ReadFrom(i, m_sa);
64 return i.GetDistanceFrom(start);
65}
66
67void
68AmsduSubframeHeader::Print(std::ostream& os) const
69{
70 os << "DA = " << m_da << ", SA = " << m_sa << ", length = " << m_length;
71}
72
73void
78
79void
84
85void
87{
88 m_length = length;
89}
90
96
99{
100 return m_sa;
101}
102
103uint16_t
105{
106 return m_length;
107}
108
109} // namespace ns3
Headers for A-MSDU subframes.
static TypeId GetTypeId()
Get the type ID.
uint32_t GetSerializedSize() const override
void SetSourceAddr(Mac48Address to)
Set source address function.
Mac48Address GetSourceAddr() const
Get source address function.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
void SetDestinationAddr(Mac48Address to)
Set destination address function.
Mac48Address m_sa
source address
void Serialize(Buffer::Iterator start) const override
uint16_t m_length
length in bytes
Mac48Address m_da
destination address
void SetLength(uint16_t length)
Set length function.
Mac48Address GetDestinationAddr() const
Get destination address function.
uint16_t GetLength() const
Get length function.
uint32_t Deserialize(Buffer::Iterator start) override
void Print(std::ostream &os) const override
iterator in a Buffer instance
Definition buffer.h:89
void WriteHtonU16(uint16_t data)
Definition buffer.h:904
uint16_t ReadNtohU16()
Definition buffer.h:943
uint32_t GetDistanceFrom(const Iterator &o) const
Definition buffer.cc:769
Protocol header serialization and deserialization.
Definition header.h:33
an EUI-48 address
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_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void WriteTo(Buffer::Iterator &i, Ipv4Address ad)
Write an Ipv4Address to a Buffer.
void ReadFrom(Buffer::Iterator &i, Ipv4Address &ad)
Read an Ipv4Address from a Buffer.