Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2008,2009 IITP RAS | 3 * Copyright (c) 2008,2009 IITP RAS |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 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 | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 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 | 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 | 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 * | 17 * |
18 * Author: Kirill Andreev <andreev@iitp.ru> | 18 * Author: Kirill Andreev <andreev@iitp.ru> |
19 */ | 19 */ |
20 | 20 |
21 #include "ns3/mesh-wifi-interface-mac.h" | 21 #include "ns3/mesh-wifi-interface-mac.h" |
22 #include "ns3/packet.h" | 22 #include "ns3/packet.h" |
23 #include "ns3/simulator.h" | 23 #include "ns3/simulator.h" |
24 #include "ns3/nstime.h" | 24 #include "ns3/nstime.h" |
25 #include "ns3/log.h" | 25 #include "ns3/log.h" |
26 #include "dot11s-mac-header.h" | 26 #include "dot11s-mac-header.h" |
27 #include "hwmp-protocol.h" | |
28 #include "hwmp-protocol-mac.h" | 27 #include "hwmp-protocol-mac.h" |
29 #include "hwmp-tag.h" | 28 #include "hwmp-tag.h" |
30 #include "ie-dot11s-preq.h" | 29 #include "ie-dot11s-preq.h" |
31 #include "ie-dot11s-prep.h" | 30 #include "ie-dot11s-prep.h" |
32 #include "ie-dot11s-rann.h" | 31 #include "ie-dot11s-rann.h" |
32 #include "ie-dot11s-perr.h" | |
33 | 33 |
34 namespace ns3 { | 34 namespace ns3 { |
35 namespace dot11s { | 35 namespace dot11s { |
36 | 36 |
37 NS_LOG_COMPONENT_DEFINE ("HwmpProtocolMac"); | 37 NS_LOG_COMPONENT_DEFINE ("HwmpProtocolMac"); |
38 HwmpProtocolMac::HwmpProtocolMac (uint32_t ifIndex, Ptr<HwmpProtocol> protocol) : | 38 HwmpProtocolMac::HwmpProtocolMac (uint32_t ifIndex, Ptr<HwmpProtocol> protocol) : |
39 m_ifIndex (ifIndex), m_protocol (protocol) | 39 m_ifIndex (ifIndex), m_protocol (protocol) |
40 { | 40 { |
41 } | 41 } |
42 HwmpProtocolMac::~HwmpProtocolMac () | 42 HwmpProtocolMac::~HwmpProtocolMac () |
(...skipping 26 matching lines...) Expand all Loading... | |
69 Mac48Address source; | 69 Mac48Address source; |
70 switch (meshHdr.GetAddressExt ()) | 70 switch (meshHdr.GetAddressExt ()) |
71 { | 71 { |
72 case 0: | 72 case 0: |
73 source = header.GetAddr4 (); | 73 source = header.GetAddr4 (); |
74 destination = header.GetAddr3 (); | 74 destination = header.GetAddr3 (); |
75 break; | 75 break; |
76 default: | 76 default: |
77 NS_FATAL_ERROR ( | 77 NS_FATAL_ERROR ( |
78 "6-address scheme is not yet supported and 4-address extension is not su pposed to be used for data frames."); | 78 "6-address scheme is not yet supported and 4-address extension is not su pposed to be used for data frames."); |
79 }; | 79 } |
80 tag.SetSeqno (meshHdr.GetMeshSeqno ()); | 80 tag.SetSeqno (meshHdr.GetMeshSeqno ()); |
81 tag.SetTtl (meshHdr.GetMeshTtl ()); | 81 tag.SetTtl (meshHdr.GetMeshTtl ()); |
82 packet->AddPacketTag (tag); | 82 packet->AddPacketTag (tag); |
83 | 83 |
84 if ((destination == Mac48Address::GetBroadcast ()) && (m_protocol->DropDataFra me (meshHdr.GetMeshSeqno (), | 84 if ((destination == Mac48Address::GetBroadcast ()) && (m_protocol->DropDataFra me (meshHdr.GetMeshSeqno (), |
85 source))) | 85 source))) |
86 { | 86 { |
87 return false; | 87 return false; |
88 } | 88 } |
89 return true; | 89 return true; |
90 } | 90 } |
91 | 91 |
92 bool | 92 bool |
93 HwmpProtocolMac::ReceiveAction (Ptr<Packet> packet, const WifiMacHeader & header ) | 93 HwmpProtocolMac::ReceiveAction (Ptr<Packet> packet, const WifiMacHeader & header ) |
94 { | 94 { |
95 m_stats.rxMgt++; | 95 m_stats.rxMgt++; |
96 m_stats.rxMgtBytes += packet->GetSize (); | 96 m_stats.rxMgtBytes += packet->GetSize (); |
97 WifiMeshActionHeader actionHdr; | 97 WifiMeshActionHeader actionHdr; |
98 packet->RemoveHeader (actionHdr); | 98 packet->RemoveHeader (actionHdr); |
99 WifiMeshActionHeader::ActionValue actionValue = actionHdr.GetAction (); | 99 WifiMeshActionHeader::ActionValue actionValue = actionHdr.GetAction (); |
100 if (actionHdr.GetCategory () != WifiMeshActionHeader::MESH_PATH_SELECTION) | 100 if (actionHdr.GetCategory () != WifiMeshActionHeader::MESH_PATH_SELECTION) |
101 { | 101 { |
102 return true; | 102 return true; |
103 } | 103 } |
104 IeRann rann; | 104 WifiInformationElementVector elements; |
105 IePreq preq; | 105 packet->RemoveHeader (elements); |
106 IePrep prep; | 106 std::vector<HwmpProtocol::FailedDestination> failedDestinations; |
107 IePerr perr; | 107 for (WifiInformationElementVector::Iterator i = elements.Begin(); i != element s.End(); i ++) |
108 while (packet->RemoveHeader (rann)) | 108 { |
109 { | 109 if ((*i)->ElementId () == IE11S_RANN) |
110 NS_LOG_WARN ("RANN is not supported!"); | 110 { |
111 } | 111 NS_LOG_WARN ("RANN is not supported!"); |
112 while (packet->RemoveHeader (preq)) | 112 } |
113 { | 113 if ((*i)->ElementId () == IE11S_PREQ) |
114 m_stats.rxPreq++; | 114 { |
115 if (preq.GetOriginatorAddress () == m_protocol->GetAddress ()) | 115 Ptr<IePreq> preq = DynamicCast<IePreq> (*i); |
116 { | 116 NS_ASSERT (preq != 0); |
117 continue; | 117 m_stats.rxPreq++; |
118 } | 118 if (preq->GetOriginatorAddress () == m_protocol->GetAddress ()) |
119 if (preq.GetTtl () == 0) | 119 { |
120 { | 120 continue; |
121 continue; | 121 } |
122 } | 122 if (preq->GetTtl () == 0) |
123 preq.DecrementTtl (); | 123 { |
124 m_protocol->ReceivePreq (preq, header.GetAddr2 (), m_ifIndex, header.GetAd dr3 (), | 124 continue; |
125 m_parent->GetLinkMetric (header.GetAddr2 ())); | 125 } |
126 } | 126 preq->DecrementTtl (); |
127 while (packet->RemoveHeader (prep)) | 127 m_protocol->ReceivePreq (*preq, header.GetAddr2 (), m_ifIndex, header. GetAddr3 (), |
128 { | 128 m_parent->GetLinkMetric (header.GetAddr2 ())); |
129 m_stats.rxPrep++; | 129 } |
130 if (prep.GetTtl () == 0) | 130 if ((*i)->ElementId () == IE11S_PREP) |
131 { | 131 { |
132 continue; | 132 Ptr<IePrep> prep = DynamicCast<IePrep> (*i); |
133 } | 133 NS_ASSERT (prep != 0); |
134 prep.DecrementTtl (); | 134 m_stats.rxPrep++; |
135 m_protocol->ReceivePrep (prep, header.GetAddr2 (), m_ifIndex, header.GetAd dr3 (), | 135 if (prep->GetTtl () == 0) |
136 m_parent->GetLinkMetric (header.GetAddr2 ())); | 136 { |
137 } | 137 continue; |
138 std::vector<IePerr::FailedDestination> failedDestinations; | 138 } |
139 while (packet->RemoveHeader (perr)) | 139 prep->DecrementTtl (); |
140 { | 140 m_protocol->ReceivePrep (*prep, header.GetAddr2 (), m_ifIndex, header. GetAddr3 (), |
141 m_stats.rxPerr++; | 141 m_parent->GetLinkMetric (header.GetAddr2 ())); |
142 std::vector<IePerr::FailedDestination> destinations = perr.GetAddressUnitV ector (); | 142 } |
143 for (std::vector<IePerr::FailedDestination>::const_iterator i = destinatio ns.begin (); i | 143 if ((*i)->ElementId () == IE11S_PERR) |
144 != destinations.end (); i++) | 144 { |
145 { | 145 Ptr<IePerr> perr = DynamicCast<IePerr> (*i); |
146 failedDestinations.push_back (*i); | 146 NS_ASSERT (perr != 0); |
147 m_stats.rxPerr++; | |
148 std::vector<HwmpProtocol::FailedDestination> destinations = perr->GetA ddressUnitVector (); | |
149 for (std::vector<HwmpProtocol::FailedDestination>::const_iterator i = destinations.begin (); i | |
150 != destinations.end (); i++) | |
151 { | |
152 failedDestinations.push_back (*i); | |
153 } | |
147 } | 154 } |
148 } | 155 } |
149 if (failedDestinations.size () > 0) | 156 if (failedDestinations.size () > 0) |
150 { | 157 { |
151 m_protocol->ReceivePerr (failedDestinations, header.GetAddr2 (), m_ifIndex , header.GetAddr3 ()); | 158 m_protocol->ReceivePerr (failedDestinations, header.GetAddr2 (), m_ifIndex , header.GetAddr3 ()); |
152 } | 159 } |
153 NS_ASSERT (packet->GetSize () == 0); | 160 NS_ASSERT (packet->GetSize () == 0); |
154 return false; | 161 return false; |
155 } | 162 } |
156 | 163 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
210 { | 217 { |
211 NS_LOG_FUNCTION_NOARGS (); | 218 NS_LOG_FUNCTION_NOARGS (); |
212 std::vector<IePreq> preq_vector; | 219 std::vector<IePreq> preq_vector; |
213 preq_vector.push_back (preq); | 220 preq_vector.push_back (preq); |
214 SendPreq (preq_vector); | 221 SendPreq (preq_vector); |
215 } | 222 } |
216 void | 223 void |
217 HwmpProtocolMac::SendPreq (std::vector<IePreq> preq) | 224 HwmpProtocolMac::SendPreq (std::vector<IePreq> preq) |
218 { | 225 { |
219 Ptr<Packet> packet = Create<Packet> (); | 226 Ptr<Packet> packet = Create<Packet> (); |
220 for (std::vector<IePreq>::const_iterator i = preq.begin (); i != preq.end (); i++) | 227 WifiInformationElementVector elements; |
221 { | 228 for (std::vector<IePreq>::iterator i = preq.begin (); i != preq.end (); i++) |
222 packet->AddHeader (*i); | 229 { |
223 } | 230 elements.AddInformationElement(Ptr<IePreq> (&(*i))); |
231 } | |
232 packet->AddHeader(elements); | |
224 packet->AddHeader (GetWifiMeshActionHeader ()); | 233 packet->AddHeader (GetWifiMeshActionHeader ()); |
225 //create 802.11 header: | 234 //create 802.11 header: |
226 WifiMacHeader hdr; | 235 WifiMacHeader hdr; |
227 hdr.SetAction (); | 236 hdr.SetAction (); |
228 hdr.SetDsNotFrom (); | 237 hdr.SetDsNotFrom (); |
229 hdr.SetDsNotTo (); | 238 hdr.SetDsNotTo (); |
230 hdr.SetAddr2 (m_parent->GetAddress ()); | 239 hdr.SetAddr2 (m_parent->GetAddress ()); |
231 hdr.SetAddr3 (m_protocol->GetAddress ()); | 240 hdr.SetAddr3 (m_protocol->GetAddress ()); |
232 //Send Management frame | 241 //Send Management frame |
233 std::vector<Mac48Address> receivers = m_protocol->GetPreqReceivers (m_ifIndex) ; | 242 std::vector<Mac48Address> receivers = m_protocol->GetPreqReceivers (m_ifIndex) ; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
281 m_preqTimer = Simulator::Schedule (m_protocol->GetPreqMinInterval (), &HwmpPro tocolMac::SendMyPreq, this); | 290 m_preqTimer = Simulator::Schedule (m_protocol->GetPreqMinInterval (), &HwmpPro tocolMac::SendMyPreq, this); |
282 SendPreq (m_myPreq); | 291 SendPreq (m_myPreq); |
283 m_myPreq.clear (); | 292 m_myPreq.clear (); |
284 } | 293 } |
285 void | 294 void |
286 HwmpProtocolMac::SendPrep (IePrep prep, Mac48Address receiver) | 295 HwmpProtocolMac::SendPrep (IePrep prep, Mac48Address receiver) |
287 { | 296 { |
288 NS_LOG_FUNCTION_NOARGS (); | 297 NS_LOG_FUNCTION_NOARGS (); |
289 //Create packet | 298 //Create packet |
290 Ptr<Packet> packet = Create<Packet> (); | 299 Ptr<Packet> packet = Create<Packet> (); |
291 packet->AddHeader (prep); | 300 WifiInformationElementVector elements; |
301 elements.AddInformationElement(Ptr<IePrep> (&prep)); | |
302 packet->AddHeader (elements); | |
292 packet->AddHeader (GetWifiMeshActionHeader ()); | 303 packet->AddHeader (GetWifiMeshActionHeader ()); |
293 //create 802.11 header: | 304 //create 802.11 header: |
294 WifiMacHeader hdr; | 305 WifiMacHeader hdr; |
295 hdr.SetAction (); | 306 hdr.SetAction (); |
296 hdr.SetDsNotFrom (); | 307 hdr.SetDsNotFrom (); |
297 hdr.SetDsNotTo (); | 308 hdr.SetDsNotTo (); |
298 hdr.SetAddr1 (receiver); | 309 hdr.SetAddr1 (receiver); |
299 hdr.SetAddr2 (m_parent->GetAddress ()); | 310 hdr.SetAddr2 (m_parent->GetAddress ()); |
300 hdr.SetAddr3 (m_protocol->GetAddress ()); | 311 hdr.SetAddr3 (m_protocol->GetAddress ()); |
301 //Send Management frame | 312 //Send Management frame |
302 m_stats.txPrep++; | 313 m_stats.txPrep++; |
303 m_stats.txMgt++; | 314 m_stats.txMgt++; |
304 m_stats.txMgtBytes += packet->GetSize (); | 315 m_stats.txMgtBytes += packet->GetSize (); |
305 m_parent->SendManagementFrame (packet, hdr); | 316 m_parent->SendManagementFrame (packet, hdr); |
306 } | 317 } |
307 void | 318 void |
308 HwmpProtocolMac::ForwardPerr (std::vector<IePerr::FailedDestination> failedDesti nations, std::vector< | 319 HwmpProtocolMac::ForwardPerr (std::vector<HwmpProtocol::FailedDestination> faile dDestinations, std::vector< |
309 Mac48Address> receivers) | 320 Mac48Address> receivers) |
310 { | 321 { |
311 NS_LOG_FUNCTION_NOARGS (); | 322 NS_LOG_FUNCTION_NOARGS (); |
312 Ptr<Packet> packet = Create<Packet> (); | 323 Ptr<Packet> packet = Create<Packet> (); |
313 IePerr perr; | 324 Ptr<IePerr> perr = Create <IePerr> (); |
314 for (std::vector<IePerr::FailedDestination>::const_iterator i = failedDestinat ions.begin (); i | 325 WifiInformationElementVector elements; |
326 for (std::vector<HwmpProtocol::FailedDestination>::const_iterator i = failedDe stinations.begin (); i | |
315 != failedDestinations.end (); i++) | 327 != failedDestinations.end (); i++) |
316 { | 328 { |
317 if (!perr.IsFull ()) | 329 if (!perr->IsFull ()) |
318 { | 330 { |
319 perr.AddAddressUnit (*i); | 331 perr->AddAddressUnit (*i); |
320 } | 332 } |
321 else | 333 else |
322 { | 334 { |
323 packet->AddHeader (perr); | 335 elements.AddInformationElement(perr); |
324 perr.ResetPerr (); | 336 perr->ResetPerr (); |
325 } | 337 } |
326 } | 338 } |
327 if (perr.GetNumOfDest () > 0) | 339 if (perr->GetNumOfDest () > 0) |
328 { | 340 { |
329 packet->AddHeader (perr); | 341 elements.AddInformationElement(perr); |
330 } | 342 } |
343 packet->AddHeader (elements); | |
331 packet->AddHeader (GetWifiMeshActionHeader ()); | 344 packet->AddHeader (GetWifiMeshActionHeader ()); |
332 //create 802.11 header: | 345 //create 802.11 header: |
333 WifiMacHeader hdr; | 346 WifiMacHeader hdr; |
334 hdr.SetAction (); | 347 hdr.SetAction (); |
335 hdr.SetDsNotFrom (); | 348 hdr.SetDsNotFrom (); |
336 hdr.SetDsNotTo (); | 349 hdr.SetDsNotTo (); |
337 hdr.SetAddr2 (m_parent->GetAddress ()); | 350 hdr.SetAddr2 (m_parent->GetAddress ()); |
338 hdr.SetAddr3 (m_protocol->GetAddress ()); | 351 hdr.SetAddr3 (m_protocol->GetAddress ()); |
339 if (receivers.size () >= m_protocol->GetUnicastPerrThreshold ()) | 352 if (receivers.size () >= m_protocol->GetUnicastPerrThreshold ()) |
340 { | 353 { |
341 receivers.clear (); | 354 receivers.clear (); |
342 receivers.push_back (Mac48Address::GetBroadcast ()); | 355 receivers.push_back (Mac48Address::GetBroadcast ()); |
343 } | 356 } |
344 //Send Management frame | 357 //Send Management frame |
345 for (std::vector<Mac48Address>::const_iterator i = m_myPerr.receivers.begin () ; i | 358 for (std::vector<Mac48Address>::const_iterator i = receivers.begin (); i != re ceivers.end (); i++) |
346 != m_myPerr.receivers.end (); i++) | |
347 { | 359 { |
348 hdr.SetAddr1 (*i); | 360 hdr.SetAddr1 (*i); |
349 m_stats.txPerr++; | 361 m_stats.txPerr++; |
350 m_stats.txMgt++; | 362 m_stats.txMgt++; |
351 m_stats.txMgtBytes += packet->GetSize (); | 363 m_stats.txMgtBytes += packet->GetSize (); |
352 m_parent->SendManagementFrame (packet, hdr); | 364 m_parent->SendManagementFrame (packet, hdr); |
353 } | 365 } |
354 } | 366 } |
355 void | 367 void |
356 HwmpProtocolMac::InitiatePerr (std::vector<IePerr::FailedDestination> failedDest inations, std::vector< | 368 HwmpProtocolMac::InitiatePerr (std::vector<HwmpProtocol::FailedDestination> fail edDestinations, std::vector< |
357 Mac48Address> receivers) | 369 Mac48Address> receivers) |
358 { | 370 { |
359 //All duplicates in PERR are checked here, and there is no reason to | 371 //All duplicates in PERR are checked here, and there is no reason to |
360 //check it at any athoer place | 372 //check it at any athoer place |
361 { | 373 { |
362 std::vector<Mac48Address>::const_iterator end = receivers.end (); | 374 std::vector<Mac48Address>::const_iterator end = receivers.end (); |
363 for (std::vector<Mac48Address>::const_iterator i = receivers.begin (); i ! = end; i++) | 375 for (std::vector<Mac48Address>::const_iterator i = receivers.begin (); i ! = end; i++) |
364 { | 376 { |
365 bool should_add = true; | 377 bool should_add = true; |
366 for (std::vector<Mac48Address>::const_iterator j = m_myPerr.receivers. begin (); j | 378 for (std::vector<Mac48Address>::const_iterator j = m_myPerr.receivers. begin (); j |
367 != m_myPerr.receivers.end (); j++) | 379 != m_myPerr.receivers.end (); j++) |
368 { | 380 { |
369 if ((*i) == (*j)) | 381 if ((*i) == (*j)) |
370 { | 382 { |
371 should_add = false; | 383 should_add = false; |
372 } | 384 } |
373 } | 385 } |
374 if (should_add) | 386 if (should_add) |
375 { | 387 { |
376 m_myPerr.receivers.push_back (*i); | 388 m_myPerr.receivers.push_back (*i); |
377 } | 389 } |
378 } | 390 } |
379 } | 391 } |
380 { | 392 { |
381 std::vector<IePerr::FailedDestination>::const_iterator end = failedDestina tions.end (); | 393 std::vector<HwmpProtocol::FailedDestination>::const_iterator end = failedD estinations.end (); |
382 for (std::vector<IePerr::FailedDestination>::const_iterator i = failedDest inations.begin (); i != end; i++) | 394 for (std::vector<HwmpProtocol::FailedDestination>::const_iterator i = fail edDestinations.begin (); i != end; i++) |
383 { | 395 { |
384 bool should_add = true; | 396 bool should_add = true; |
385 for (std::vector<IePerr::FailedDestination>::const_iterator j = m_myPe rr.destinations.begin (); j | 397 for (std::vector<HwmpProtocol::FailedDestination>::const_iterator j = m_myPerr.destinations.begin (); j |
386 != m_myPerr.destinations.end (); j++) | 398 != m_myPerr.destinations.end (); j++) |
387 { | 399 { |
388 if (((*i).destination == (*j).destination) && ((*j).seqnum > (*i). seqnum)) | 400 if (((*i).destination == (*j).destination) && ((*j).seqnum > (*i). seqnum)) |
389 { | 401 { |
390 should_add = false; | 402 should_add = false; |
391 } | 403 } |
392 } | 404 } |
393 if (should_add) | 405 if (should_add) |
394 { | 406 { |
395 m_myPerr.destinations.push_back (*i); | 407 m_myPerr.destinations.push_back (*i); |
(...skipping 26 matching lines...) Expand all Loading... | |
422 return m_parent->GetFrequencyChannel (); | 434 return m_parent->GetFrequencyChannel (); |
423 } | 435 } |
424 HwmpProtocolMac::Statistics::Statistics () : | 436 HwmpProtocolMac::Statistics::Statistics () : |
425 txPreq (0), rxPreq (0), txPrep (0), rxPrep (0), txPerr (0), rxPerr (0), txMgt (0), txMgtBytes (0), | 437 txPreq (0), rxPreq (0), txPrep (0), rxPrep (0), txPerr (0), rxPerr (0), txMgt (0), txMgtBytes (0), |
426 rxMgt (0), rxMgtBytes (0), txData (0), txDataBytes (0), rxData (0), rxData Bytes (0) | 438 rxMgt (0), rxMgtBytes (0), txData (0), txDataBytes (0), rxData (0), rxData Bytes (0) |
427 { | 439 { |
428 } | 440 } |
429 void | 441 void |
430 HwmpProtocolMac::Statistics::Print (std::ostream & os) const | 442 HwmpProtocolMac::Statistics::Print (std::ostream & os) const |
431 { | 443 { |
432 os << "<Statistics " | 444 os << "<Statistics " |
Mathieu Lacage
2009/08/21 14:09:30
std::endl is your friend
and.kirill
2009/08/21 19:33:33
Done in all other Statistics::Print
Done.
| |
433 "txPreq= \"" << txPreq << "\"\n" | 445 "txPreq= \"" << txPreq << "\"" << std::endl << |
434 "txPrep=\"" << txPrep << "\"\n" | 446 "txPrep=\"" << txPrep << "\"" << std::endl << |
435 "txPerr=\"" << txPerr << "\"\n" | 447 "txPerr=\"" << txPerr << "\"" << std::endl << |
436 "rxPreq=\"" << rxPreq << "\"\n" | 448 "rxPreq=\"" << rxPreq << "\"" << std::endl << |
437 "rxPrep=\"" << rxPrep << "\"\n" | 449 "rxPrep=\"" << rxPrep << "\"" << std::endl << |
438 "rxPerr=\"" << rxPerr << "\"\n" | 450 "rxPerr=\"" << rxPerr << "\"" << std::endl << |
439 "txMgt=\"" << txMgt << "\"\n" | 451 "txMgt=\"" << txMgt << "\"" << std::endl << |
440 "txMgtBytes=\"" << txMgtBytes << "\"\n" | 452 "txMgtBytes=\"" << txMgtBytes << "\"" << std::endl << |
441 "rxMgt=\"" << rxMgt << "\"\n" | 453 "rxMgt=\"" << rxMgt << "\"" << std::endl << |
442 "rxMgtBytes=\"" << rxMgtBytes << "\"\n" | 454 "rxMgtBytes=\"" << rxMgtBytes << "\"" << std::endl << |
443 "txData=\"" << txData << "\"\n" | 455 "txData=\"" << txData << "\"" << std::endl << |
444 "txDataBytes=\"" << txDataBytes << "\"\n" | 456 "txDataBytes=\"" << txDataBytes << "\"" << std::endl << |
445 "rxData=\"" << rxData << "\"\n" | 457 "rxData=\"" << rxData << "\"" << std::endl << |
446 "rxDataBytes=\"" << rxDataBytes << "\"/>\n"; | 458 "rxDataBytes=\"" << rxDataBytes << "\"/>" << std::endl; |
447 } | 459 } |
448 void | 460 void |
449 HwmpProtocolMac::Report (std::ostream & os) const | 461 HwmpProtocolMac::Report (std::ostream & os) const |
450 { | 462 { |
451 os << "<HwmpProtocolMac\n" | 463 os << "<HwmpProtocolMac" << std::endl << |
452 "address =\"" << m_parent->GetAddress () << "\">\n"; | 464 "address =\"" << m_parent->GetAddress () << "\">" << std::endl; |
453 m_stats.Print (os); | 465 m_stats.Print (os); |
454 os << "</HwmpProtocolMac>\n"; | 466 os << "</HwmpProtocolMac>" << std::endl; |
455 } | 467 } |
456 void | 468 void |
457 HwmpProtocolMac::ResetStats () | 469 HwmpProtocolMac::ResetStats () |
458 { | 470 { |
459 m_stats = Statistics::Statistics (); | 471 m_stats = Statistics::Statistics (); |
460 } | 472 } |
461 | 473 |
462 } //namespace dot11s | 474 } //namespace dot11s |
463 }//namespace ns3 | 475 }//namespace ns3 |
LEFT | RIGHT |