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 <vector>
27 
28 namespace ns3
29 {
30 
45 class SatPPduHeader : public Header
46 {
47  public:
51  SatPPduHeader();
52 
57 
62  static TypeId GetTypeId(void);
63 
68  virtual TypeId GetInstanceTypeId(void) const;
69 
74  virtual uint32_t GetSerializedSize(void) const;
75 
80  virtual void Serialize(Buffer::Iterator start) const;
81 
87  virtual uint32_t Deserialize(Buffer::Iterator start);
88 
93  virtual void Print(std::ostream& os) const;
94 
99  uint8_t GetStartIndicator() const;
100 
105  uint8_t GetEndIndicator() const;
106 
111  uint16_t GetPPduLength() const;
112 
117  uint8_t GetFragmentId() const;
118 
124  uint16_t GetTotalLength() const;
125 
129  void SetStartIndicator();
130 
134  void SetEndIndicator();
135 
140  void SetPPduLength(uint16_t bytes);
141 
146  void SetFragmentId(uint8_t id);
147 
153  void SetTotalLength(uint16_t bytes);
154 
160  uint32_t GetHeaderSizeInBytes(uint8_t type) const;
161 
166  uint32_t GetMaxHeaderSizeInBytes() const;
167 
168  private:
170  uint8_t m_endIndicator;
172  uint8_t m_fragmentId;
174 
179  const uint32_t m_fullPpduHeaderSize;
180  const uint32_t m_startPpduHeaderSize;
181  const uint32_t m_endPpduHeaderSize;
183 };
184 
185 } // namespace ns3
186 
187 #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.