satellite-arq-header.h
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 
21 #ifndef SATELLITE_ARQ_HEADER_H
22 #define SATELLITE_ARQ_HEADER_H
23 
24 #include <ns3/header.h>
25 
26 #include <vector>
27 
28 namespace ns3
29 {
30 
39 class SatArqHeader : public Header
40 {
41  public:
45  SatArqHeader();
46 
50  ~SatArqHeader();
51 
56  static TypeId GetTypeId(void);
57 
62  virtual TypeId GetInstanceTypeId(void) const;
63 
68  virtual uint32_t GetSerializedSize(void) const;
69 
74  virtual void Serialize(Buffer::Iterator start) const;
75 
81  virtual uint32_t Deserialize(Buffer::Iterator start);
82 
87  virtual void Print(std::ostream& os) const;
88 
93  uint8_t GetSeqNo() const;
94 
99  void SetSeqNo(uint8_t seqNo);
100 
101  private:
105  uint8_t m_seqNo;
106 };
107 
108 } // namespace ns3
109 
110 #endif // SATELLITE_ARQ_HEADER_H
ARQ header implementation contains the sequence number related to the packet in question.
virtual uint32_t GetSerializedSize(void) const
Get serialized size of SatArqHeader.
static TypeId GetTypeId(void)
Get the type ID.
~SatArqHeader()
Destructor for SatArqHeader.
virtual void Serialize(Buffer::Iterator start) const
Serializes information to buffer from this instance of SatArqHeader.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
uint8_t GetSeqNo() const
Get sequence number.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserializes information from buffer to this instance of SatArqHeader.
SatArqHeader()
Constructor.
void SetSeqNo(uint8_t seqNo)
Set sequence number.
virtual void Print(std::ostream &os) const
Print time stamp of this instance of SatArqHeader.
uint8_t m_seqNo
Sequence number represented by one Byte.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.