A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ss-record.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2007,2008, 2009 INRIA, UDcast
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 * Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
19 */
20
21#include "ss-record.h"
22
23#include "service-flow.h"
24
25#include <stdint.h>
26
27namespace ns3
28{
29
31{
32 Initialize();
33}
34
36{
37 m_macAddress = macAddress;
38 Initialize();
39}
40
42{
43 m_macAddress = macAddress;
44 m_IPAddress = IPaddress;
45 Initialize();
46}
47
48void
50{
51 m_basicCid = Cid();
52 m_primaryCid = Cid();
53
58 m_pollForRanging = false;
60 m_pollMeBit = false;
61
64
65 m_serviceFlows = new std::vector<ServiceFlow*>();
66 m_dsaRsp = DsaRsp();
67 m_broadcast = false;
68}
69
71{
72 delete m_serviceFlows;
73 m_serviceFlows = nullptr;
74}
75
76void
78{
79 m_IPAddress = IPAddress;
80}
81
84{
85 return m_IPAddress;
86}
87
88void
90{
91 m_basicCid = basicCid;
92}
93
94Cid
96{
97 return m_basicCid;
98}
99
100void
102{
103 m_primaryCid = primaryCid;
104}
105
106Cid
108{
109 return m_primaryCid;
110}
111
112void
114{
115 m_macAddress = macAddress;
116}
117
120{
121 return m_macAddress;
122}
123
124uint8_t
126{
128}
129
130void
132{
134}
135
136void
138{
140}
141
142uint8_t
144{
146}
147
148void
150{
152}
153
154void
156{
158}
159
160void
162{
163 m_modulationType = modulationType;
164}
165
168{
169 return m_modulationType;
170}
171
172void
174{
175 m_rangingStatus = rangingStatus;
176}
177
180{
181 return m_rangingStatus;
182}
183
184void
186{
187 m_pollForRanging = true;
188}
189
190void
192{
193 m_pollForRanging = false;
194}
195
196bool
198{
199 return m_pollForRanging;
200}
201
202void
204{
206}
207
208bool
210{
212}
213
214void
216{
217 m_pollMeBit = pollMeBit;
218}
219
220bool
222{
223 return m_pollMeBit;
224}
225
226void
228{
229 m_serviceFlows->push_back(serviceFlow);
230}
231
232std::vector<ServiceFlow*>
234{
235 std::vector<ServiceFlow*> tmpServiceFlows;
236 for (auto iter = m_serviceFlows->begin(); iter != m_serviceFlows->end(); ++iter)
237 {
238 if (((*iter)->GetSchedulingType() == schedulingType) ||
239 (schedulingType == ServiceFlow::SF_TYPE_ALL))
240 {
241 tmpServiceFlows.push_back(*iter);
242 }
243 }
244 return tmpServiceFlows;
245}
246
247void
248SSRecord::SetIsBroadcastSS(bool broadcast_enable)
249{
250 m_broadcast = broadcast_enable;
251}
252
253bool
255{
256 return m_broadcast;
257}
258
259bool
261{
262 for (auto iter = m_serviceFlows->begin(); iter != m_serviceFlows->end(); ++iter)
263 {
264 if ((*iter)->GetSchedulingType() == ServiceFlow::SF_TYPE_UGS)
265 {
266 return true;
267 }
268 }
269 return false;
270}
271
272bool
274{
275 for (auto iter = m_serviceFlows->begin(); iter != m_serviceFlows->end(); ++iter)
276 {
277 if ((*iter)->GetSchedulingType() == ServiceFlow::SF_TYPE_RTPS)
278 {
279 return true;
280 }
281 }
282 return false;
283}
284
285bool
287{
288 for (auto iter = m_serviceFlows->begin(); iter != m_serviceFlows->end(); ++iter)
289 {
290 if ((*iter)->GetSchedulingType() == ServiceFlow::SF_TYPE_NRTPS)
291 {
292 return true;
293 }
294 }
295 return false;
296}
297
298bool
300{
301 for (auto iter = m_serviceFlows->begin(); iter != m_serviceFlows->end(); ++iter)
302 {
303 if ((*iter)->GetSchedulingType() == ServiceFlow::SF_TYPE_BE)
304 {
305 return true;
306 }
307 }
308 return false;
309}
310
311void
312SSRecord::SetSfTransactionId(uint16_t sfTransactionId)
313{
314 m_sfTransactionId = sfTransactionId;
315}
316
317uint16_t
319{
320 return m_sfTransactionId;
321}
322
323void
324SSRecord::SetDsaRspRetries(uint8_t dsaRspRetries)
325{
326 m_dsaRspRetries = dsaRspRetries;
327}
328
329void
331{
333}
334
335uint8_t
337{
338 return m_dsaRspRetries;
339}
340
341void
343{
344 m_dsaRsp = dsaRsp;
345}
346
347DsaRsp
349{
350 return m_dsaRsp;
351}
352
353} // namespace ns3
Cid class.
Definition: cid.h:37
This class implements the DSA-RSP message described by "IEEE Standard for Local and metropolitan ar...
Definition: mac-messages.h:490
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:42
an EUI-48 address
Definition: mac48-address.h:46
void SetModulationType(WimaxPhy::ModulationType modulationType)
Set modulation type.
Definition: ss-record.cc:161
bool GetHasServiceFlowUgs() const
Check if at least one flow has scheduling type SF_TYPE_UGS.
Definition: ss-record.cc:260
Cid GetBasicCid() const
Get basic CID.
Definition: ss-record.cc:95
WimaxNetDevice::RangingStatus GetRangingStatus() const
Get ranging status.
Definition: ss-record.cc:179
void SetMacAddress(Mac48Address macAddress)
Set MAC address.
Definition: ss-record.cc:113
WimaxNetDevice::RangingStatus m_rangingStatus
ranging status
Definition: ss-record.h:272
void SetDsaRspRetries(uint8_t dsaRspRetries)
Set DSA response retries.
Definition: ss-record.cc:324
void AddServiceFlow(ServiceFlow *serviceFlow)
Add service flow.
Definition: ss-record.cc:227
Ipv4Address m_IPAddress
IP address.
Definition: ss-record.h:262
void SetRangingStatus(WimaxNetDevice::RangingStatus rangingStatus)
Set ranging status.
Definition: ss-record.cc:173
void SetPollMeBit(bool pollMeBit)
Set poll ME bit.
Definition: ss-record.cc:215
uint8_t GetInvitedRangRetries() const
Get invited range retries.
Definition: ss-record.cc:143
Mac48Address m_macAddress
MAC address.
Definition: ss-record.h:261
void IncrementRangingCorrectionRetries()
Increment ranging correction retries.
Definition: ss-record.cc:137
void IncrementDsaRspRetries()
Increment DAS response retries.
Definition: ss-record.cc:330
bool GetPollForRanging() const
Get poll for ranging.
Definition: ss-record.cc:197
DsaRsp GetDsaRsp() const
Get DSA response.
Definition: ss-record.cc:348
uint16_t GetSfTransactionId() const
Get SF transaction ID.
Definition: ss-record.cc:318
void SetDsaRsp(DsaRsp dsaRsp)
Set DSA response.
Definition: ss-record.cc:342
Cid m_basicCid
basic CID
Definition: ss-record.h:264
uint8_t GetRangingCorrectionRetries() const
Get ranging correction retries.
Definition: ss-record.cc:125
void SetIsBroadcastSS(bool broadcast_enable)
Set is broadcast SS.
Definition: ss-record.cc:248
void Initialize()
Initialize.
Definition: ss-record.cc:49
bool GetHasServiceFlowRtps() const
Check if at least one flow has scheduling type SF_TYPE_RTPS.
Definition: ss-record.cc:273
void EnablePollForRanging()
Enable poll for ranging function.
Definition: ss-record.cc:185
void ResetRangingCorrectionRetries()
Reset ranging correction retries.
Definition: ss-record.cc:131
void ResetInvitedRangingRetries()
Reset invited ranging retries.
Definition: ss-record.cc:149
void SetPrimaryCid(Cid primaryCid)
Set primary CID.
Definition: ss-record.cc:101
void SetBasicCid(Cid basicCid)
Set basic CID.
Definition: ss-record.cc:89
uint8_t m_dsaRspRetries
DAS response retries.
Definition: ss-record.h:282
void DisablePollForRanging()
Disable poll for ranging.
Definition: ss-record.cc:191
uint8_t GetDsaRspRetries() const
Get DSA response retries.
Definition: ss-record.cc:336
bool GetPollMeBit() const
Get poll ME bit.
Definition: ss-record.cc:221
bool m_pollForRanging
poll for ranging
Definition: ss-record.h:273
std::vector< ServiceFlow * > * m_serviceFlows
service flows
Definition: ss-record.h:278
bool m_broadcast
broadcast?
Definition: ss-record.h:276
bool m_pollMeBit
if PM (poll me) bit set for this SS
Definition: ss-record.h:275
std::vector< ServiceFlow * > GetServiceFlows(ServiceFlow::SchedulingType schedulingType) const
Get service flows.
Definition: ss-record.cc:233
uint8_t m_invitedRangingRetries
invited ranging retries
Definition: ss-record.h:268
WimaxPhy::ModulationType m_modulationType
least robust burst profile (modulation type) for this SS
Definition: ss-record.h:271
void SetIPAddress(Ipv4Address IPaddress)
Set IP address.
Definition: ss-record.cc:77
bool GetAreServiceFlowsAllocated() const
Check if service flows are allocated.
Definition: ss-record.cc:209
Cid m_primaryCid
primary CID
Definition: ss-record.h:265
Mac48Address GetMacAddress() const
Get MAC address.
Definition: ss-record.cc:119
void SetAreServiceFlowsAllocated(bool val)
Set are service flows allocated.
Definition: ss-record.cc:203
bool GetIsBroadcastSS() const
Get is broadcast SS.
Definition: ss-record.cc:254
Ipv4Address GetIPAddress()
Get IP address.
Definition: ss-record.cc:83
bool m_areServiceFlowsAllocated
are service floes allowed
Definition: ss-record.h:274
WimaxPhy::ModulationType GetModulationType() const
Get modulation type.
Definition: ss-record.cc:167
void SetSfTransactionId(uint16_t sfTransactionId)
Set SF transaction ID.
Definition: ss-record.cc:312
bool GetHasServiceFlowNrtps() const
Check if at least one flow has scheduling type SF_TYPE_NRTPS.
Definition: ss-record.cc:286
void IncrementInvitedRangingRetries()
Increment invited ranging retries.
Definition: ss-record.cc:155
Cid GetPrimaryCid() const
Get primary CID.
Definition: ss-record.cc:107
uint16_t m_sfTransactionId
SF transaction ID.
Definition: ss-record.h:281
bool GetHasServiceFlowBe() const
Check if at least one flow has scheduling type SF_TYPE_BE.
Definition: ss-record.cc:299
uint8_t m_rangingCorrectionRetries
ranging correction retries
Definition: ss-record.h:267
DsaRsp m_dsaRsp
DSA response.
Definition: ss-record.h:283
This class implements service flows as described by the IEEE-802.16 standard.
Definition: service-flow.h:43
SchedulingType
section 11.13.11 Service flow scheduling type, page 701
Definition: service-flow.h:62
RangingStatus
RangingStatus enumeration.
ModulationType
ModulationType enumeration.
Definition: wimax-phy.h:54
@ MODULATION_TYPE_BPSK_12
Definition: wimax-phy.h:55
Every class exported by the ns3 library is enclosed in the ns3 namespace.