Loading...
Searching...
No Matches
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
27NS_LOG_COMPONENT_DEFINE("SatGroundStationAddressTag");
28
29namespace ns3
30{
31
32NS_OBJECT_ENSURE_REGISTERED(SatGroundStationAddressTag);
33
38
40 : m_groundStationAddress(groundStationAddress)
41{
42 // Nothing to do here
43}
44
45TypeId
47{
48 static TypeId tid = TypeId("ns3::SatGroundStationAddressTag")
49 .SetParent<Tag>()
50 .AddConstructor<SatGroundStationAddressTag>();
51 return tid;
52}
53
54TypeId
59
60uint32_t
65
66void
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
77void
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
88void
89SatGroundStationAddressTag::Print(std::ostream& os) const
90{
92}
93
94Mac48Address
99
100void
102{
103 m_groundStationAddress = groundStationAddress;
104}
105
106} // namespace ns3
Tag to store ground station destination address.
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.