satellite-encap-pdu-status-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: Jani Puttonen <jani.puttonen@magister.fi>
19  */
20 
22 
23 #include <ns3/log.h>
24 
25 NS_LOG_COMPONENT_DEFINE("SatEncapPduStatusTag");
26 
27 namespace ns3
28 {
29 
30 NS_OBJECT_ENSURE_REGISTERED(SatEncapPduStatusTag);
31 
33  : m_pduStatus(FULL_PDU)
34 {
35 }
36 
37 void
39 {
40  NS_LOG_FUNCTION(this << (uint32_t)status);
41  m_pduStatus = status;
42 }
43 
44 uint8_t
46 {
47  NS_LOG_FUNCTION(this);
48  return m_pduStatus;
49 }
50 
51 TypeId
53 {
54  static TypeId tid =
55  TypeId("ns3::SatEncapPduStatusTag").SetParent<Tag>().AddConstructor<SatEncapPduStatusTag>();
56  return tid;
57 }
58 
59 TypeId
61 {
62  return GetTypeId();
63 }
64 
65 uint32_t
67 {
68  NS_LOG_FUNCTION(this);
69  return 1;
70 }
71 
72 void
74 {
75  NS_LOG_FUNCTION(this);
76  i.WriteU8(m_pduStatus);
77 }
78 
79 void
81 {
82  NS_LOG_FUNCTION(this);
83  m_pduStatus = i.ReadU8();
84 }
85 
86 void
87 SatEncapPduStatusTag::Print(std::ostream& os) const
88 {
89  NS_LOG_FUNCTION(this);
90  os << "PPDU Status=" << (uint32_t)m_pduStatus;
91 }
92 
93 } // namespace ns3
virtual void Deserialize(TagBuffer i)
Deserializes information from buffer to this instance of SatEncapPduStatusTag.
virtual uint32_t GetSerializedSize(void) const
Get serialized size of SatEncapPduStatusTag.
static TypeId GetTypeId(void)
Get the type ID.
void SetStatus(uint8_t status)
Set PDU status.
uint8_t GetStatus(void) const
Get PDU status.
virtual void Serialize(TagBuffer i) const
Serializes information to buffer from this instance of SatEncapPduStatusTag.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
virtual void Print(std::ostream &os) const
Print time stamp of this instance of SatEncapPduStatusTag.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.