A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ofdm-downlink-frame-prefix.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2007,2008 INRIA
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
18 */
19
20#ifndef DL_FRAME_PREFIX_IE_H
21#define DL_FRAME_PREFIX_IE_H
22
23#include "ns3/header.h"
24
25#include <stdint.h>
26
27namespace ns3
28{
29
30/**
31 * \ingroup wimax
32 * \brief This class implements the DL Frame Prefix IE as described by IEEE-802.16 standard
33 * \brief The DL Frame Prefix IE is contained in DLFP (Downlink Frame Prefix) in OFDM PHY
34 */
36{
37 public:
40
41 /**
42 * Set rate ID field
43 * \param rateId the rate ID
44 */
45 void SetRateId(uint8_t rateId);
46 /**
47 * Set DIUC field
48 * \param diuc the DIUC
49 */
50 void SetDiuc(uint8_t diuc);
51 /**
52 * Set preamble present field
53 * \param preamblePresent the preambel present
54 */
55 void SetPreamblePresent(uint8_t preamblePresent);
56 /**
57 * Set length field
58 * \param length the length
59 */
60 void SetLength(uint16_t length);
61 /**
62 * Set start time field
63 * \param startTime the start time
64 */
65 void SetStartTime(uint16_t startTime);
66
67 /**
68 * Get rate ID field
69 * \returns the rate ID
70 */
71 uint8_t GetRateId() const;
72 /**
73 * Get DIUC field
74 * \returns the DIUC
75 */
76 uint8_t GetDiuc() const;
77 /**
78 * Get preamble present field
79 * \returns the preamble present
80 */
81 uint8_t GetPreamblePresent() const;
82 /**
83 * Get length field
84 * \returns the length
85 */
86 uint16_t GetLength() const;
87 /**
88 * Get start time field
89 * \returns the start time
90 */
91 uint16_t GetStartTime() const;
92
93 /**
94 * Get size field
95 * \returns the size
96 */
97 uint16_t GetSize() const;
98
99 /**
100 * Write item function
101 * \param start the iterator
102 * \returns the updated iterator
103 */
105 /**
106 * Read item function
107 * \param start the iterator
108 * \returns the updated iterator
109 */
111
112 private:
113 uint8_t m_rateId; ///< rate ID
114 uint8_t m_diuc; ///< DIUC
115 uint8_t m_preamblePresent; ///< preamble present
116 uint16_t m_length; ///< length
117 uint16_t m_startTime; ///< start time
118
119 // shall actually contain m_startTime if DIUC is 0. see Table 225, page 452
120};
121
122} // namespace ns3
123
124#endif /* DL_FRAME_PREFIX_IE_H */
125
126#ifndef OFDM_DOWNLINK_FRAME_PREFIX_H
127#define OFDM_DOWNLINK_FRAME_PREFIX_H
128
129#include "ns3/header.h"
130#include "ns3/mac48-address.h"
131
132#include <stdint.h>
133
134namespace ns3
135{
136
137/**
138 * OfdmDownlinkFramePrefix
139 */
141{
142 public:
144 ~OfdmDownlinkFramePrefix() override;
145
146 /**
147 * Register this type.
148 * \return The TypeId.
149 */
150 static TypeId GetTypeId();
151
152 /**
153 * Set base station ID field
154 * \param baseStationId the base station ID
155 */
156 void SetBaseStationId(Mac48Address baseStationId);
157 /**
158 * Set frame number field
159 * \param frameNumber the frame number
160 */
161 void SetFrameNumber(uint32_t frameNumber);
162 /**
163 * Set configuration change count field
164 * \param configurationChangeCount the configuration change count
165 */
166 void SetConfigurationChangeCount(uint8_t configurationChangeCount);
167 /**
168 * Add DL frame prefix element field
169 * \param dlFramePrefixElement the DL frame prefix element
170 */
171 void AddDlFramePrefixElement(DlFramePrefixIe dlFramePrefixElement);
172 /**
173 * Set HCS field
174 * \param hcs the HCS
175 */
176 void SetHcs(uint8_t hcs);
177
178 /**
179 * Get base station ID field
180 * \returns the base station ID
181 */
183 /**
184 * Get frame number field
185 * \returns the frame number
186 */
187 uint32_t GetFrameNumber() const;
188 /**
189 * Get configuration change count field
190 * \returns the configuration change count
191 */
192 uint8_t GetConfigurationChangeCount() const;
193 /**
194 * Get DL frame prefix elements
195 * \returns the DL frame prefix elements
196 */
197 std::vector<DlFramePrefixIe> GetDlFramePrefixElements() const;
198 /**
199 * Get HCS field
200 * \returns the HCS
201 */
202 uint8_t GetHcs() const;
203
204 /**
205 * Get name field
206 * \returns the name
207 */
208 std::string GetName() const;
209 void Print(std::ostream& os) const override;
210 uint32_t GetSerializedSize() const override;
211 void Serialize(Buffer::Iterator start) const override;
212 uint32_t Deserialize(Buffer::Iterator start) override;
213
214 private:
215 Mac48Address m_baseStationId; ///< base station ID
216 uint32_t m_frameNumber; ///< shall actually be only 4 LSB of the same field in OFDM DCD Channel
217 ///< Encodings
218 uint8_t m_configurationChangeCount; ///< shall actually be only 4 LSB of the same field in DCD
219 std::vector<DlFramePrefixIe> m_dlFramePrefixElements; ///< vector of dl frame prefix elements
220 uint8_t m_hcs; ///< Header Check Sequence
221};
222
223} // namespace ns3
224
225#endif /* OFDM_DOWNLINK_FRAME_PREFIX_H */
iterator in a Buffer instance
Definition: buffer.h:100
This class implements the DL Frame Prefix IE as described by IEEE-802.16 standard.
uint8_t GetDiuc() const
Get DIUC field.
uint8_t m_preamblePresent
preamble present
uint16_t GetStartTime() const
Get start time field.
uint8_t GetPreamblePresent() const
Get preamble present field.
uint16_t GetLength() const
Get length field.
uint8_t GetRateId() const
Get rate ID field.
void SetStartTime(uint16_t startTime)
Set start time field.
void SetDiuc(uint8_t diuc)
Set DIUC field.
void SetLength(uint16_t length)
Set length field.
Buffer::Iterator Read(Buffer::Iterator start)
Read item function.
void SetPreamblePresent(uint8_t preamblePresent)
Set preamble present field.
Buffer::Iterator Write(Buffer::Iterator start) const
Write item function.
uint16_t GetSize() const
Get size field.
void SetRateId(uint8_t rateId)
Set rate ID field.
Protocol header serialization and deserialization.
Definition: header.h:44
an EUI-48 address
Definition: mac48-address.h:46
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.