Loading...
Searching...
No Matches
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#include <ostream>
26
27NS_LOG_COMPONENT_DEFINE("SatEncapPduStatusTag");
28
29namespace ns3
30{
31
32NS_OBJECT_ENSURE_REGISTERED(SatEncapPduStatusTag);
33
38
39void
41{
42 NS_LOG_FUNCTION(this << (uint32_t)status);
43 m_pduStatus = status;
44}
45
46uint8_t
48{
49 NS_LOG_FUNCTION(this);
50 return m_pduStatus;
51}
52
53TypeId
55{
56 static TypeId tid =
57 TypeId("ns3::SatEncapPduStatusTag").SetParent<Tag>().AddConstructor<SatEncapPduStatusTag>();
58 return tid;
59}
60
61TypeId
66
67uint32_t
69{
70 NS_LOG_FUNCTION(this);
71 return 1;
72}
73
74void
76{
77 NS_LOG_FUNCTION(this);
78 i.WriteU8(m_pduStatus);
79}
80
81void
83{
84 NS_LOG_FUNCTION(this);
85 m_pduStatus = i.ReadU8();
86}
87
88void
89SatEncapPduStatusTag::Print(std::ostream& os) const
90{
91 NS_LOG_FUNCTION(this);
92 os << "PPDU Status=" << (uint32_t)m_pduStatus;
93}
94
95} // namespace ns3
SatEncapPduStatusTag is used temporarily to tag packets with the fragmentation status in the encapsul...
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.