satellite-rle-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_RLE_HEADER_H
22 #define SATELLITE_RLE_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 
47 class SatPPduHeader : public Header
48 {
49  public:
53  SatPPduHeader();
54 
59 
64  static TypeId GetTypeId(void);
65 
70  virtual TypeId GetInstanceTypeId(void) const;
71 
76  virtual uint32_t GetSerializedSize(void) const;
77 
82  virtual void Serialize(Buffer::Iterator start) const;
83 
89  virtual uint32_t Deserialize(Buffer::Iterator start);
90 
95  virtual void Print(std::ostream& os) const;
96 
101  uint8_t GetStartIndicator() const;
102 
107  uint8_t GetEndIndicator() const;
108 
113  uint16_t GetPPduLength() const;
114 
119  uint8_t GetFragmentId() const;
120 
126  uint16_t GetTotalLength() const;
127 
131  void SetStartIndicator();
132 
136  void SetEndIndicator();
137 
142  void SetPPduLength(uint16_t bytes);
143 
148  void SetFragmentId(uint8_t id);
149 
155  void SetTotalLength(uint16_t bytes);
156 
162  uint32_t GetHeaderSizeInBytes(uint8_t type) const;
163 
168  uint32_t GetMaxHeaderSizeInBytes() const;
169 
170  private:
172  uint8_t m_endIndicator;
174  uint8_t m_fragmentId;
176 
181  const uint32_t m_fullPpduHeaderSize;
182  const uint32_t m_startPpduHeaderSize;
183  const uint32_t m_endPpduHeaderSize;
185 };
186 
187 } // namespace ns3
188 
189 #endif // SATELLITE_RLE_HEADER_H
SatPPduHeader implementation.
uint32_t GetMaxHeaderSizeInBytes() const
Get maximum RLE header size.
void SetPPduLength(uint16_t bytes)
Set PPDU fragment length to PPDU header.
const uint32_t m_continuationPpduHeaderSize
uint16_t GetPPduLength() const
Get PPDU fragment length in bytes.
virtual void Print(std::ostream &os) const
Print time stamp of this instance of SatPPduHeader.
const uint32_t m_startPpduHeaderSize
void SetEndIndicator()
Set end indicator to PPDU header.
virtual void Serialize(Buffer::Iterator start) const
Serializes information to buffer from this instance of SatPPduHeader.
const uint32_t m_fullPpduHeaderSize
Constant variables for determining the header sizes of different RLE PPDU fragments.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserializes information from buffer to this instance of SatPPduHeader.
void SetTotalLength(uint16_t bytes)
Set total length of higher layer PDU.
uint32_t GetHeaderSizeInBytes(uint8_t type) const
Get the maximum RLE header size.
uint8_t GetEndIndicator() const
Get end indicator of PPDU header.
void SetStartIndicator()
Set start indicator to PPDU header.
uint8_t GetFragmentId() const
Get PPDU fragment id.
void SetFragmentId(uint8_t id)
Set fragment id to PPDU header.
const uint32_t m_endPpduHeaderSize
virtual uint32_t GetSerializedSize(void) const
Get serialized size of SatPPduHeader.
uint16_t GetTotalLength() const
Get total length of higher layer PDU.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
static TypeId GetTypeId(void)
Get the type ID.
uint8_t GetStartIndicator() const
Get start indicator of PPDU header.
~SatPPduHeader()
Destructor for SatPPduHeader.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.