Loading...
Searching...
No Matches
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 <ostream>
27#include <stdint.h>
28#include <vector>
29
30namespace ns3
31{
32
47class SatGseHeader : public Header
48{
49 public:
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 uint32_t GetGsePduLength() const;
114
119 uint32_t GetFragmentId() const;
120
125 uint32_t GetTotalLength() const;
126
130 void SetStartIndicator();
131
135 void SetEndIndicator();
136
141 void SetGsePduLength(uint32_t bytes);
142
147 void SetFragmentId(uint32_t id);
148
154 void SetTotalLength(uint32_t bytes);
155
160 uint32_t GetGseHeaderSizeInBytes(uint8_t type) const;
161
166 uint32_t GetMaxGseHeaderSizeInBytes() const;
167
168 private:
178 uint8_t m_labelByte;
179 uint32_t m_crc;
180
185 const uint32_t m_fullGseHeaderSize;
186 const uint32_t m_startGseHeaderSize;
187 const uint32_t m_endGseHeaderSize;
189
190 static const uint32_t m_labelFieldLengthInBytes = 3;
191};
192
193} // namespace ns3
194
195#endif // SATELLITE_GSE_HEADERS_H
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.
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.