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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
7 */
8
9#ifndef DL_FRAME_PREFIX_IE_H
10#define DL_FRAME_PREFIX_IE_H
11
12#include "ns3/header.h"
13
14#include <stdint.h>
15
16namespace ns3
17{
18
19/**
20 * \ingroup wimax
21 * \brief This class implements the DL Frame Prefix IE as described by IEEE-802.16 standard
22 * \brief The DL Frame Prefix IE is contained in DLFP (Downlink Frame Prefix) in OFDM PHY
23 */
25{
26 public:
29
30 /**
31 * Set rate ID field
32 * \param rateId the rate ID
33 */
34 void SetRateId(uint8_t rateId);
35 /**
36 * Set DIUC field
37 * \param diuc the DIUC
38 */
39 void SetDiuc(uint8_t diuc);
40 /**
41 * Set preamble present field
42 * \param preamblePresent the preambel present
43 */
44 void SetPreamblePresent(uint8_t preamblePresent);
45 /**
46 * Set length field
47 * \param length the length
48 */
49 void SetLength(uint16_t length);
50 /**
51 * Set start time field
52 * \param startTime the start time
53 */
54 void SetStartTime(uint16_t startTime);
55
56 /**
57 * Get rate ID field
58 * \returns the rate ID
59 */
60 uint8_t GetRateId() const;
61 /**
62 * Get DIUC field
63 * \returns the DIUC
64 */
65 uint8_t GetDiuc() const;
66 /**
67 * Get preamble present field
68 * \returns the preamble present
69 */
70 uint8_t GetPreamblePresent() const;
71 /**
72 * Get length field
73 * \returns the length
74 */
75 uint16_t GetLength() const;
76 /**
77 * Get start time field
78 * \returns the start time
79 */
80 uint16_t GetStartTime() const;
81
82 /**
83 * Get size field
84 * \returns the size
85 */
86 uint16_t GetSize() const;
87
88 /**
89 * Write item function
90 * \param start the iterator
91 * \returns the updated iterator
92 */
94 /**
95 * Read item function
96 * \param start the iterator
97 * \returns the updated iterator
98 */
100
101 private:
102 uint8_t m_rateId; ///< rate ID
103 uint8_t m_diuc; ///< DIUC
104 uint8_t m_preamblePresent; ///< preamble present
105 uint16_t m_length; ///< length
106 uint16_t m_startTime; ///< start time
107
108 // shall actually contain m_startTime if DIUC is 0. see Table 225, page 452
109};
110
111} // namespace ns3
112
113#endif /* DL_FRAME_PREFIX_IE_H */
114
115#ifndef OFDM_DOWNLINK_FRAME_PREFIX_H
116#define OFDM_DOWNLINK_FRAME_PREFIX_H
117
118#include "ns3/header.h"
119#include "ns3/mac48-address.h"
120
121#include <stdint.h>
122
123namespace ns3
124{
125
126/**
127 * OfdmDownlinkFramePrefix
128 */
130{
131 public:
133 ~OfdmDownlinkFramePrefix() override;
134
135 /**
136 * Register this type.
137 * \return The TypeId.
138 */
139 static TypeId GetTypeId();
140
141 /**
142 * Set base station ID field
143 * \param baseStationId the base station ID
144 */
145 void SetBaseStationId(Mac48Address baseStationId);
146 /**
147 * Set frame number field
148 * \param frameNumber the frame number
149 */
150 void SetFrameNumber(uint32_t frameNumber);
151 /**
152 * Set configuration change count field
153 * \param configurationChangeCount the configuration change count
154 */
155 void SetConfigurationChangeCount(uint8_t configurationChangeCount);
156 /**
157 * Add DL frame prefix element field
158 * \param dlFramePrefixElement the DL frame prefix element
159 */
160 void AddDlFramePrefixElement(DlFramePrefixIe dlFramePrefixElement);
161 /**
162 * Set HCS field
163 * \param hcs the HCS
164 */
165 void SetHcs(uint8_t hcs);
166
167 /**
168 * Get base station ID field
169 * \returns the base station ID
170 */
172 /**
173 * Get frame number field
174 * \returns the frame number
175 */
176 uint32_t GetFrameNumber() const;
177 /**
178 * Get configuration change count field
179 * \returns the configuration change count
180 */
181 uint8_t GetConfigurationChangeCount() const;
182 /**
183 * Get DL frame prefix elements
184 * \returns the DL frame prefix elements
185 */
186 std::vector<DlFramePrefixIe> GetDlFramePrefixElements() const;
187 /**
188 * Get HCS field
189 * \returns the HCS
190 */
191 uint8_t GetHcs() const;
192
193 /**
194 * Get name field
195 * \returns the name
196 */
197 std::string GetName() const;
198 void Print(std::ostream& os) const override;
199 uint32_t GetSerializedSize() const override;
200 void Serialize(Buffer::Iterator start) const override;
201 uint32_t Deserialize(Buffer::Iterator start) override;
202
203 private:
204 Mac48Address m_baseStationId; ///< base station ID
205 uint32_t m_frameNumber; ///< shall actually be only 4 LSB of the same field in OFDM DCD Channel
206 ///< Encodings
207 uint8_t m_configurationChangeCount; ///< shall actually be only 4 LSB of the same field in DCD
208 std::vector<DlFramePrefixIe> m_dlFramePrefixElements; ///< vector of dl frame prefix elements
209 uint8_t m_hcs; ///< Header Check Sequence
210};
211
212} // namespace ns3
213
214#endif /* OFDM_DOWNLINK_FRAME_PREFIX_H */
iterator in a Buffer instance
Definition buffer.h:89
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:33
an EUI-48 address
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.