satellite-ground-station-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) 2013 Magister Solutions Ltd.
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: Bastien TAURAN <bastien.tauran@viveris.fr>
19  */
20 
22 
23 #include <ns3/log.h>
24 
25 #include <ostream>
26 
27 NS_LOG_COMPONENT_DEFINE("SatGroundStationAddressTag");
28 
29 namespace ns3
30 {
31 
32 NS_OBJECT_ENSURE_REGISTERED(SatGroundStationAddressTag);
33 
35 {
36  // Nothing to do here
37 }
38 
40  : m_groundStationAddress(groundStationAddress)
41 {
42  // Nothing to do here
43 }
44 
45 TypeId
47 {
48  static TypeId tid = TypeId("ns3::SatGroundStationAddressTag")
49  .SetParent<Tag>()
50  .AddConstructor<SatGroundStationAddressTag>();
51  return tid;
52 }
53 
54 TypeId
56 {
57  return GetTypeId();
58 }
59 
60 uint32_t
62 {
63  return ADDRESS_LENGHT;
64 }
65 
66 void
68 {
69  NS_LOG_FUNCTION(this << &i);
70 
71  uint8_t buff[ADDRESS_LENGHT];
72 
73  m_groundStationAddress.CopyTo(buff);
74  i.Write(buff, ADDRESS_LENGHT);
75 }
76 
77 void
79 {
80  NS_LOG_FUNCTION(this << &i);
81 
82  uint8_t buff[ADDRESS_LENGHT];
83 
84  i.Read(buff, ADDRESS_LENGHT);
85  m_groundStationAddress.CopyFrom(buff);
86 }
87 
88 void
89 SatGroundStationAddressTag::Print(std::ostream& os) const
90 {
92 }
93 
94 Mac48Address
96 {
98 }
99 
100 void
101 SatGroundStationAddressTag::SetGroundStationAddress(Mac48Address groundStationAddress)
102 {
103  m_groundStationAddress = groundStationAddress;
104 }
105 
106 } // namespace ns3
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
virtual uint32_t GetSerializedSize() const
Get serialized size of SatGroundStationAddressTag.
virtual void Serialize(TagBuffer i) const
Serializes information to buffer from this instance of SatGroundStationAddressTag.
void SetGroundStationAddress(Mac48Address groundStationAddress)
Set the ground station MAC address.
virtual void Print(std::ostream &os) const
Print time stamp of this instance of SatGroundStationAddressTag.
static TypeId GetTypeId(void)
Get the type ID.
virtual void Deserialize(TagBuffer i)
Deserializes information from buffer to this instance of SatGroundStationAddressTag.
Mac48Address GetGroundStationAddress(void) const
Get the ground station MAC address.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.