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 <ostream>
27 #include <stdint.h>
28 #include <vector>
29 
30 namespace ns3
31 {
32 
41 class SatArqHeader : public Header
42 {
43  public:
47  SatArqHeader();
48 
52  ~SatArqHeader();
53 
58  static TypeId GetTypeId(void);
59 
64  virtual TypeId GetInstanceTypeId(void) const;
65 
70  virtual uint32_t GetSerializedSize(void) const;
71 
76  virtual void Serialize(Buffer::Iterator start) const;
77 
83  virtual uint32_t Deserialize(Buffer::Iterator start);
84 
89  virtual void Print(std::ostream& os) const;
90 
95  uint8_t GetSeqNo() const;
96 
101  void SetSeqNo(uint8_t seqNo);
102 
103  private:
107  uint8_t m_seqNo;
108 };
109 
110 } // namespace ns3
111 
112 #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.