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