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
Cid class.
Definition: cid.h:38
This class implements the DSA-RSP message described by "IEEE Standard for Local and metropolitan ar...
Definition: mac-messages.h:475
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:41
an EUI-48 address
Definition: mac48-address.h:44
void SetModulationType(WimaxPhy::ModulationType modulationType)
Set modulation type.
Definition: ss-record.cc:158
void SetMacAddress(Mac48Address macAddress)
Set MAC address.
Definition: ss-record.cc:110
WimaxNetDevice::RangingStatus m_rangingStatus
ranging status
Definition: ss-record.h:268
void SetDsaRspRetries(uint8_t dsaRspRetries)
Set DSA response retries.
Definition: ss-record.cc:318
void AddServiceFlow(ServiceFlow *serviceFlow)
Add service flow.
Definition: ss-record.cc:224
Ipv4Address m_IPAddress
IP address.
Definition: ss-record.h:259
void SetRangingStatus(WimaxNetDevice::RangingStatus rangingStatus)
Set ranging status.
Definition: ss-record.cc:170
void SetPollMeBit(bool pollMeBit)
Set poll ME bit.
Definition: ss-record.cc:212
Mac48Address m_macAddress
MAC address.
Definition: ss-record.h:258
bool GetHasServiceFlowBe(void) const
Check if at least one flow has scheduling type SF_TYPE_BE.
Definition: ss-record.cc:294
void EnablePollForRanging(void)
Enable poll for ranging function.
Definition: ss-record.cc:182
Ipv4Address GetIPAddress(void)
Get IP address.
Definition: ss-record.cc:80
bool GetHasServiceFlowNrtps(void) const
Check if at least one flow has scheduling type SF_TYPE_NRTPS.
Definition: ss-record.cc:281
SSRecord(void)
Definition: ss-record.cc:28
void SetDsaRsp(DsaRsp dsaRsp)
Set DSA response.
Definition: ss-record.cc:336
bool GetPollForRanging(void) const
Get poll for ranging.
Definition: ss-record.cc:194
Cid m_basicCid
basic CID
Definition: ss-record.h:261
WimaxNetDevice::RangingStatus GetRangingStatus(void) const
Get ranging status.
Definition: ss-record.cc:176
void SetIsBroadcastSS(bool broadcast_enable)
Set is broadcast SS.
Definition: ss-record.cc:243
DsaRsp GetDsaRsp(void) const
Get DSA response.
Definition: ss-record.cc:342
void SetPrimaryCid(Cid primaryCid)
Set primary CID.
Definition: ss-record.cc:98
void SetBasicCid(Cid basicCid)
Set basic CID.
Definition: ss-record.cc:86
void DisablePollForRanging(void)
Disable poll for ranging.
Definition: ss-record.cc:188
uint8_t m_dsaRspRetries
DAS response retries.
Definition: ss-record.h:278
WimaxPhy::ModulationType GetModulationType(void) const
Get modulation type.
Definition: ss-record.cc:164
std::vector< ServiceFlow * > GetServiceFlows(enum ServiceFlow::SchedulingType schedulingType) const
Get service flows.
Definition: ss-record.cc:229
bool GetHasServiceFlowRtps(void) const
Check if at least one flow has scheduling type SF_TYPE_RTPS.
Definition: ss-record.cc:268
uint8_t GetRangingCorrectionRetries(void) const
Get ranging correction retries.
Definition: ss-record.cc:122
void IncrementDsaRspRetries(void)
Increment DAS response retries.
Definition: ss-record.cc:324
bool m_pollForRanging
poll for ranging
Definition: ss-record.h:269
std::vector< ServiceFlow * > * m_serviceFlows
service flows
Definition: ss-record.h:274
bool m_broadcast
broadcast?
Definition: ss-record.h:272
bool GetPollMeBit(void) const
Get poll ME bit.
Definition: ss-record.cc:218
bool m_pollMeBit
if PM (poll me) bit set for this SS
Definition: ss-record.h:271
Mac48Address GetMacAddress(void) const
Get MAC address.
Definition: ss-record.cc:116
void Initialize(void)
Initialize.
Definition: ss-record.cc:47
bool GetAreServiceFlowsAllocated(void) const
Check if service flows are allocated.
Definition: ss-record.cc:206
uint8_t m_invitedRangingRetries
invited ranging retries
Definition: ss-record.h:265
WimaxPhy::ModulationType m_modulationType
least robust burst profile (modulation type) for this SS
Definition: ss-record.h:267
bool GetHasServiceFlowUgs(void) const
Check if at least one flow has scheduling type SF_TYPE_UGS.
Definition: ss-record.cc:255
~SSRecord(void)
Definition: ss-record.cc:68
void SetIPAddress(Ipv4Address IPaddress)
Set IP address.
Definition: ss-record.cc:75
void IncrementInvitedRangingRetries(void)
Increment invited ranging retries.
Definition: ss-record.cc:152
Cid m_primaryCid
primary CID
Definition: ss-record.h:262
Cid GetPrimaryCid(void) const
Get primary CID.
Definition: ss-record.cc:104
bool GetIsBroadcastSS(void)
Get is broadcast SS.
Definition: ss-record.cc:249
Cid GetBasicCid(void) const
Get basic CID.
Definition: ss-record.cc:92
void SetAreServiceFlowsAllocated(bool val)
Set are service flows allocated.
Definition: ss-record.cc:200
void IncrementRangingCorrectionRetries(void)
Increment ranging correction retries.
Definition: ss-record.cc:134
bool m_areServiceFlowsAllocated
are service floes allowed
Definition: ss-record.h:270
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 SetSfTransactionId(uint16_t sfTransactionId)
Set SF transaction ID.
Definition: ss-record.cc:307
uint16_t m_sfTransactionId
SF transaction ID.
Definition: ss-record.h:277
uint8_t m_rangingCorrectionRetries
ranging correction retries
Definition: ss-record.h:264
uint8_t GetInvitedRangRetries(void) const
Get invited range retries.
Definition: ss-record.cc:140
void ResetInvitedRangingRetries(void)
Reset invited ranging retries.
Definition: ss-record.cc:146
DsaRsp m_dsaRsp
DSA response.
Definition: ss-record.h:279
uint16_t GetSfTransactionId(void) const
Get SF transaction ID.
Definition: ss-record.cc:312
This class implements service flows as described by the IEEE-802.16 standard.
Definition: service-flow.h:40
SchedulingType
section 11.13.11 Service flow scheduling type, page 701
Definition: service-flow.h:59
RangingStatus
RangingStatus enumeration.
ModulationType
ModulationType enumeration.
Definition: wimax-phy.h:52
@ MODULATION_TYPE_BPSK_12
Definition: wimax-phy.h:53
Every class exported by the ns3 library is enclosed in the ns3 namespace.