satellite-gse-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_GSE_HEADERS_H
22 #define SATELLITE_GSE_HEADERS_H
23 
24 #include <ns3/header.h>
25 
26 #include <vector>
27 
28 namespace ns3
29 {
30 
45 class SatGseHeader : public Header
46 {
47  public:
51  SatGseHeader();
52 
56  ~SatGseHeader();
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  uint32_t GetGsePduLength() const;
112 
117  uint32_t GetFragmentId() const;
118 
123  uint32_t GetTotalLength() const;
124 
128  void SetStartIndicator();
129 
133  void SetEndIndicator();
134 
139  void SetGsePduLength(uint32_t bytes);
140 
145  void SetFragmentId(uint32_t id);
146 
152  void SetTotalLength(uint32_t bytes);
153 
158  uint32_t GetGseHeaderSizeInBytes(uint8_t type) const;
159 
164  uint32_t GetMaxGseHeaderSizeInBytes() const;
165 
166  private:
171  uint8_t m_endIndicator;
173  uint8_t m_fragmentId;
175  uint16_t m_protocolType;
176  uint8_t m_labelByte;
177  uint32_t m_crc;
178 
183  const uint32_t m_fullGseHeaderSize;
184  const uint32_t m_startGseHeaderSize;
185  const uint32_t m_endGseHeaderSize;
187 
188  static const uint32_t m_labelFieldLengthInBytes = 3;
189 };
190 
191 } // namespace ns3
192 
193 #endif // SATELLITE_GSE_HEADERS_H
SatGseHeader implementation.
const uint32_t m_continuationGseHeaderSize
const uint32_t m_startGseHeaderSize
uint8_t m_startIndicator
GSE header content.
uint8_t GetEndIndicator() const
Get end indicator of GSE header.
uint32_t GetGsePduLength() const
Get GSE fragment length in bytes.
virtual void Print(std::ostream &os) const
Print time stamp of this instance of SatGseHeader.
static TypeId GetTypeId(void)
Get the type ID.
uint32_t GetTotalLength() const
Get total length of higher layer PDU.
uint32_t GetGseHeaderSizeInBytes(uint8_t type) const
Get the maximum GSE header size.
virtual uint32_t GetSerializedSize(void) const
Get serialized size of SatGseHeader.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserializes information from buffer to this instance of SatGseHeader.
void SetStartIndicator()
Set start indicator to GSE header.
uint8_t GetStartIndicator() const
Get start indicator of GSE header.
uint32_t GetMaxGseHeaderSizeInBytes() const
Get the maximum GSE header size.
const uint32_t m_fullGseHeaderSize
Constant variables for determining the header sizes of different GSE fragments.
const uint32_t m_endGseHeaderSize
uint32_t GetFragmentId() const
Get GSE fragment id.
~SatGseHeader()
Destructor for SatGseHeader.
virtual void Serialize(Buffer::Iterator start) const
Serializes information to buffer from this instance of SatGseHeader.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
SatGseHeader()
Constructor.
void SetTotalLength(uint32_t bytes)
Set total length of higher layer PDU.
void SetGsePduLength(uint32_t bytes)
Set GSE fragment length to PPDU header.
static const uint32_t m_labelFieldLengthInBytes
void SetEndIndicator()
Set end indicator to GSE header.
void SetFragmentId(uint32_t id)
Set fragment id to GSE header.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.