A Discrete-Event Network Simulator
API
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 
27 namespace 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 
48 void
50 {
51  m_basicCid = Cid();
52  m_primaryCid = Cid();
53 
58  m_pollForRanging = false;
60  m_pollMeBit = false;
61 
63  m_dsaRspRetries = 0;
64 
65  m_serviceFlows = new std::vector<ServiceFlow*>();
66  m_dsaRsp = DsaRsp();
67  m_broadcast = 0;
68 }
69 
71 {
72  delete m_serviceFlows;
73  m_serviceFlows = nullptr;
74 }
75 
76 void
78 {
79  m_IPAddress = IPAddress;
80 }
81 
84 {
85  return m_IPAddress;
86 }
87 
88 void
90 {
91  m_basicCid = basicCid;
92 }
93 
94 Cid
96 {
97  return m_basicCid;
98 }
99 
100 void
102 {
103  m_primaryCid = primaryCid;
104 }
105 
106 Cid
108 {
109  return m_primaryCid;
110 }
111 
112 void
114 {
115  m_macAddress = macAddress;
116 }
117 
120 {
121  return m_macAddress;
122 }
123 
124 uint8_t
126 {
128 }
129 
130 void
132 {
134 }
135 
136 void
138 {
140 }
141 
142 uint8_t
144 {
146 }
147 
148 void
150 {
152 }
153 
154 void
156 {
158 }
159 
160 void
162 {
163  m_modulationType = modulationType;
164 }
165 
168 {
169  return m_modulationType;
170 }
171 
172 void
174 {
175  m_rangingStatus = rangingStatus;
176 }
177 
180 {
181  return m_rangingStatus;
182 }
183 
184 void
186 {
187  m_pollForRanging = true;
188 }
189 
190 void
192 {
193  m_pollForRanging = false;
194 }
195 
196 bool
198 {
199  return m_pollForRanging;
200 }
201 
202 void
204 {
206 }
207 
208 bool
210 {
212 }
213 
214 void
215 SSRecord::SetPollMeBit(bool pollMeBit)
216 {
217  m_pollMeBit = pollMeBit;
218 }
219 
220 bool
222 {
223  return m_pollMeBit;
224 }
225 
226 void
228 {
229  m_serviceFlows->push_back(serviceFlow);
230 }
231 
232 std::vector<ServiceFlow*>
234 {
235  std::vector<ServiceFlow*> tmpServiceFlows;
236  for (std::vector<ServiceFlow*>::iterator iter = m_serviceFlows->begin();
237  iter != m_serviceFlows->end();
238  ++iter)
239  {
240  if (((*iter)->GetSchedulingType() == schedulingType) ||
241  (schedulingType == ServiceFlow::SF_TYPE_ALL))
242  {
243  tmpServiceFlows.push_back((*iter));
244  }
245  }
246  return tmpServiceFlows;
247 }
248 
249 void
250 SSRecord::SetIsBroadcastSS(bool broadcast_enable)
251 {
252  m_broadcast = broadcast_enable;
253 }
254 
255 bool
257 {
258  return m_broadcast;
259 }
260 
261 bool
263 {
264  for (std::vector<ServiceFlow*>::iterator iter = m_serviceFlows->begin();
265  iter != m_serviceFlows->end();
266  ++iter)
267  {
268  if ((*iter)->GetSchedulingType() == ServiceFlow::SF_TYPE_UGS)
269  {
270  return true;
271  }
272  }
273  return false;
274 }
275 
276 bool
278 {
279  for (std::vector<ServiceFlow*>::iterator iter = m_serviceFlows->begin();
280  iter != m_serviceFlows->end();
281  ++iter)
282  {
283  if ((*iter)->GetSchedulingType() == ServiceFlow::SF_TYPE_RTPS)
284  {
285  return true;
286  }
287  }
288  return false;
289 }
290 
291 bool
293 {
294  for (std::vector<ServiceFlow*>::iterator iter = m_serviceFlows->begin();
295  iter != m_serviceFlows->end();
296  ++iter)
297  {
298  if ((*iter)->GetSchedulingType() == ServiceFlow::SF_TYPE_NRTPS)
299  {
300  return true;
301  }
302  }
303  return false;
304 }
305 
306 bool
308 {
309  for (std::vector<ServiceFlow*>::iterator iter = m_serviceFlows->begin();
310  iter != m_serviceFlows->end();
311  ++iter)
312  {
313  if ((*iter)->GetSchedulingType() == ServiceFlow::SF_TYPE_BE)
314  {
315  return true;
316  }
317  }
318  return false;
319 }
320 
321 void
322 SSRecord::SetSfTransactionId(uint16_t sfTransactionId)
323 {
324  m_sfTransactionId = sfTransactionId;
325 }
326 
327 uint16_t
329 {
330  return m_sfTransactionId;
331 }
332 
333 void
334 SSRecord::SetDsaRspRetries(uint8_t dsaRspRetries)
335 {
336  m_dsaRspRetries = dsaRspRetries;
337 }
338 
339 void
341 {
342  m_dsaRspRetries++;
343 }
344 
345 uint8_t
347 {
348  return m_dsaRspRetries;
349 }
350 
351 void
353 {
354  m_dsaRsp = dsaRsp;
355 }
356 
357 DsaRsp
359 {
360  return m_dsaRsp;
361 }
362 
363 } // namespace ns3
Cid class.
Definition: cid.h:37
This class implements the DSA-RSP message described by "IEEE Standard for Local and metropolitan area...
Definition: mac-messages.h:490
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:43
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:262
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:273
void SetDsaRspRetries(uint8_t dsaRspRetries)
Set DSA response retries.
Definition: ss-record.cc:334
void AddServiceFlow(ServiceFlow *serviceFlow)
Add service flow.
Definition: ss-record.cc:227
Ipv4Address m_IPAddress
IP address.
Definition: ss-record.h:263
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:262
void IncrementRangingCorrectionRetries()
Increment ranging correction retries.
Definition: ss-record.cc:137
void IncrementDsaRspRetries()
Increment DAS response retries.
Definition: ss-record.cc:340
bool GetPollForRanging() const
Get poll for ranging.
Definition: ss-record.cc:197
DsaRsp GetDsaRsp() const
Get DSA response.
Definition: ss-record.cc:358
uint16_t GetSfTransactionId() const
Get SF transaction ID.
Definition: ss-record.cc:328
void SetDsaRsp(DsaRsp dsaRsp)
Set DSA response.
Definition: ss-record.cc:352
Cid m_basicCid
basic CID
Definition: ss-record.h:265
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:250
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:277
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:283
std::vector< ServiceFlow * > GetServiceFlows(enum ServiceFlow::SchedulingType schedulingType) const
Get service flows.
Definition: ss-record.cc:233
void DisablePollForRanging()
Disable poll for ranging.
Definition: ss-record.cc:191
uint8_t GetDsaRspRetries() const
Get DSA response retries.
Definition: ss-record.cc:346
bool GetPollMeBit() const
Get poll ME bit.
Definition: ss-record.cc:221
bool m_pollForRanging
poll for ranging
Definition: ss-record.h:274
std::vector< ServiceFlow * > * m_serviceFlows
service flows
Definition: ss-record.h:279
bool m_broadcast
broadcast?
Definition: ss-record.h:277
bool m_pollMeBit
if PM (poll me) bit set for this SS
Definition: ss-record.h:276
uint8_t m_invitedRangingRetries
invited ranging retries
Definition: ss-record.h:269
WimaxPhy::ModulationType m_modulationType
least robust burst profile (modulation type) for this SS
Definition: ss-record.h:272
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:266
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:256
Ipv4Address GetIPAddress()
Get IP address.
Definition: ss-record.cc:83
bool m_areServiceFlowsAllocated
are service floes allowed
Definition: ss-record.h:275
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:322
bool GetHasServiceFlowNrtps() const
Check if at least one flow has scheduling type SF_TYPE_NRTPS.
Definition: ss-record.cc:292
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:282
bool GetHasServiceFlowBe() const
Check if at least one flow has scheduling type SF_TYPE_BE.
Definition: ss-record.cc:307
uint8_t m_rangingCorrectionRetries
ranging correction retries
Definition: ss-record.h:268
DsaRsp m_dsaRsp
DSA response.
Definition: ss-record.h:284
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.