A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
aloha-noack-mac-header.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 CTTC
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Nicola Baldo <nbaldo@cttc.es>
7 */
8
10
11#include <ns3/log.h>
12
13namespace ns3
14{
15
16NS_LOG_COMPONENT_DEFINE("AlohaNoackMacHeader");
17
18NS_OBJECT_ENSURE_REGISTERED(AlohaNoackMacHeader);
19
20TypeId
22{
23 static TypeId tid = TypeId("ns3::AlohaNoackMacHeader")
25 .SetGroupName("Spectrum")
26 .AddConstructor<AlohaNoackMacHeader>();
27 return tid;
28}
29
35
38{
39 return 12;
40}
41
42void
48
56
57void
58AlohaNoackMacHeader::Print(std::ostream& os) const
59{
60 os << "src=" << m_source << "dst=" << m_destination;
61}
62
63void
68
71{
72 return m_source;
73}
74
75void
80
86
87} // namespace ns3
Header for the AlohaNoack NetDevice.
Mac48Address GetSource() const
Get the source address.
Mac48Address m_source
source address
void Serialize(Buffer::Iterator start) const override
void SetDestination(Mac48Address destination)
Set the destination address.
uint32_t Deserialize(Buffer::Iterator start) override
void Print(std::ostream &os) const override
uint32_t GetSerializedSize() const override
static TypeId GetTypeId()
Get the type ID.
Mac48Address GetDestination() const
Get the destination address.
Mac48Address m_destination
destination address
void SetSource(Mac48Address source)
Set the source address.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
iterator in a Buffer instance
Definition buffer.h:89
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_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#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.