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 NS_LOG_COMPONENT_DEFINE("SatGroundStationAddressTag");
26 
27 namespace ns3
28 {
29 
30 NS_OBJECT_ENSURE_REGISTERED(SatGroundStationAddressTag);
31 
33 {
34  // Nothing to do here
35 }
36 
38  : m_groundStationAddress(groundStationAddress)
39 {
40  // Nothing to do here
41 }
42 
43 TypeId
45 {
46  static TypeId tid = TypeId("ns3::SatGroundStationAddressTag")
47  .SetParent<Tag>()
48  .AddConstructor<SatGroundStationAddressTag>();
49  return tid;
50 }
51 
52 TypeId
54 {
55  return GetTypeId();
56 }
57 
58 uint32_t
60 {
61  return ADDRESS_LENGHT;
62 }
63 
64 void
66 {
67  NS_LOG_FUNCTION(this << &i);
68 
69  uint8_t buff[ADDRESS_LENGHT];
70 
71  m_groundStationAddress.CopyTo(buff);
72  i.Write(buff, ADDRESS_LENGHT);
73 }
74 
75 void
77 {
78  NS_LOG_FUNCTION(this << &i);
79 
80  uint8_t buff[ADDRESS_LENGHT];
81 
82  i.Read(buff, ADDRESS_LENGHT);
83  m_groundStationAddress.CopyFrom(buff);
84 }
85 
86 void
87 SatGroundStationAddressTag::Print(std::ostream& os) const
88 {
90 }
91 
92 Mac48Address
94 {
96 }
97 
98 void
99 SatGroundStationAddressTag::SetGroundStationAddress(Mac48Address groundStationAddress)
100 {
101  m_groundStationAddress = groundStationAddress;
102 }
103 
104 } // 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.