Loading...
Searching...
No Matches
satellite-address-tag.cc
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2014 Magister Solutions
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: Budiarto Herman <budiarto.herman@magister.fi>
19 */
20
22
23#include "ns3/log.h"
24
25#include <ostream>
26
27NS_LOG_COMPONENT_DEFINE("SatAddressTag");
28
29namespace ns3
30{
31
32NS_OBJECT_ENSURE_REGISTERED(SatAddressTag);
33
35 : Tag()
36{
37 NS_LOG_FUNCTION(this);
38}
39
41 : Tag(),
42 m_sourceAddress(addr)
43{
44 NS_LOG_FUNCTION(this);
45}
46
47TypeId
49{
50 static TypeId tid =
51 TypeId("ns3::SatAddressTag").SetParent<Tag>().AddConstructor<SatAddressTag>();
52 return tid;
53}
54
55TypeId
57{
58 return GetTypeId();
59}
60
61uint32_t
63{
64 return m_sourceAddress.GetSerializedSize();
65}
66
67void
68SatAddressTag::Serialize(TagBuffer i) const
69{
70 NS_LOG_FUNCTION(this << &i);
71
72 m_sourceAddress.Serialize(i);
73}
74
75void
77{
78 NS_LOG_FUNCTION(this << &i);
79
80 m_sourceAddress.Deserialize(i);
81}
82
83void
84SatAddressTag::Print(std::ostream& os) const
85{
86 NS_LOG_FUNCTION(this << &os);
87 os << "(SourceAddress=" << m_sourceAddress << ")";
88}
89
90void
92{
93 NS_LOG_FUNCTION(this << addr);
94 m_sourceAddress = addr;
95}
96
97Address
102
103} // namespace ns3
This class implements a tag that carries the MAC address of the sender of the packet.
virtual void Serialize(TagBuffer buf) const
Serializes information to buffer from this instance of Inherited.
virtual uint32_t GetSerializedSize() const
Inherited from Tag base class.
static TypeId GetTypeId()
Inherited from ObjectBase base class.
void SetSourceAddress(Address addr)
Set the source address.
Address GetSourceAddress() const
Get the source address.
virtual void Print(std::ostream &os) const
Print time stamp of this instance of Inherited.
virtual void Deserialize(TagBuffer buf)
Deserializes information from buffer to this instance of Inherited.
virtual TypeId GetInstanceTypeId() const
Get the type ID of instance.
SatAddressTag()
/ Creates a SatAddressTag instance with an invalid source address.
Address m_sourceAddress
The source address.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.