A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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)
Definition: ss-record.cc:224
Doxygen introspection did not find any typical Config paths.
Definition: mac-messages.h:344
~SSRecord(void)
Definition: ss-record.cc:68
void IncrementRangingCorrectionRetries(void)
Definition: ss-record.cc:134
Mac48Address GetMacAddress(void) const
Definition: ss-record.cc:116
void SetIsBroadcastSS(bool)
Definition: ss-record.cc:243
bool GetHasServiceFlowBe(void) const
Definition: ss-record.cc:294
WimaxPhy::ModulationType m_modulationType
Definition: ss-record.h:115
Cid GetBasicCid(void) const
Definition: ss-record.cc:92
void SetPrimaryCid(Cid primaryCid)
Definition: ss-record.cc:98
void IncrementDsaRspRetries(void)
Definition: ss-record.cc:324
Ipv4Address m_IPAddress
Definition: ss-record.h:107
Ipv4Address GetIPAddress(void)
Definition: ss-record.cc:80
bool m_pollForRanging
Definition: ss-record.h:117
bool GetAreServiceFlowsAllocated(void) const
Definition: ss-record.cc:206
void SetDsaRspRetries(uint8_t dsaRspRetries)
Definition: ss-record.cc:318
WimaxNetDevice::RangingStatus GetRangingStatus(void) const
Definition: ss-record.cc:176
void DisablePollForRanging(void)
Definition: ss-record.cc:188
Cid m_primaryCid
Definition: ss-record.h:110
uint8_t m_rangingCorrectionRetries
Definition: ss-record.h:112
void SetDsaRsp(DsaRsp dsaRsp)
Definition: ss-record.cc:336
std::vector< ServiceFlow * > * m_serviceFlows
Definition: ss-record.h:122
void SetModulationType(WimaxPhy::ModulationType modulationType)
Definition: ss-record.cc:158
void SetRangingStatus(WimaxNetDevice::RangingStatus rangingStatus)
Definition: ss-record.cc:170
void Initialize(void)
Definition: ss-record.cc:47
void ResetInvitedRangingRetries(void)
Definition: ss-record.cc:146
SSRecord(void)
Definition: ss-record.cc:28
void SetSfTransactionId(uint16_t sfTransactionId)
Definition: ss-record.cc:307
uint8_t GetDsaRspRetries(void) const
Definition: ss-record.cc:330
void ResetRangingCorrectionRetries(void)
Definition: ss-record.cc:128
void SetBasicCid(Cid basicCid)
Definition: ss-record.cc:86
void EnablePollForRanging(void)
Definition: ss-record.cc:182
bool m_broadcast
Definition: ss-record.h:120
bool GetHasServiceFlowRtps(void) const
Definition: ss-record.cc:268
void SetPollMeBit(bool pollMeBit)
Definition: ss-record.cc:212
std::vector< ServiceFlow * > GetServiceFlows(enum ServiceFlow::SchedulingType schedulingType) const
Definition: ss-record.cc:229
DsaRsp m_dsaRsp
Definition: ss-record.h:127
uint8_t GetRangingCorrectionRetries(void) const
Definition: ss-record.cc:122
WimaxNetDevice::RangingStatus m_rangingStatus
Definition: ss-record.h:116
bool GetHasServiceFlowUgs(void) const
Definition: ss-record.cc:255
bool GetPollMeBit(void) const
Definition: ss-record.cc:218
void IncrementInvitedRangingRetries(void)
Definition: ss-record.cc:152
void SetAreServiceFlowsAllocated(bool val)
Definition: ss-record.cc:200
Definition: cid.h:35
uint8_t m_dsaRspRetries
Definition: ss-record.h:126
an EUI-48 address
Definition: mac48-address.h:41
This class implements service flows as described by the IEEE-802.16 standard.
Definition: service-flow.h:39
bool m_pollMeBit
Definition: ss-record.h:119
bool GetHasServiceFlowNrtps(void) const
Definition: ss-record.cc:281
uint16_t GetSfTransactionId(void) const
Definition: ss-record.cc:312
Cid GetPrimaryCid(void) const
Definition: ss-record.cc:104
bool GetPollForRanging(void) const
Definition: ss-record.cc:194
uint8_t GetInvitedRangRetries(void) const
Definition: ss-record.cc:140
DsaRsp GetDsaRsp(void) const
Definition: ss-record.cc:342
bool m_areServiceFlowsAllocated
Definition: ss-record.h:118
bool GetIsBroadcastSS(void)
Definition: ss-record.cc:249
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:38
Mac48Address m_macAddress
Definition: ss-record.h:106
void SetIPAddress(Ipv4Address IPaddress)
Definition: ss-record.cc:75
uint8_t m_invitedRangingRetries
Definition: ss-record.h:113
void SetMacAddress(Mac48Address macAddress)
Definition: ss-record.cc:110
WimaxPhy::ModulationType GetModulationType(void) const
Definition: ss-record.cc:164
uint16_t m_sfTransactionId
Definition: ss-record.h:125