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) 2007,2008 INRIA, UDcast | 3 * Copyright (c) 2007,2008 INRIA, UDcast |
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 |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 NS_LOG_INFO ("\t Create a fragment" | 220 NS_LOG_INFO ("\t Create a fragment" |
221 "\n\t\t fragmentOffset=" << fragmentOffset << | 221 "\n\t\t fragmentOffset=" << fragmentOffset << |
222 "\n\t\t packetSize=" << element.m_packet->GetSize () << | 222 "\n\t\t packetSize=" << element.m_packet->GetSize () << |
223 "\n\t\t fragmentSize=" << fragmentSize << std::endl); | 223 "\n\t\t fragmentSize=" << fragmentSize << std::endl); |
224 | 224 |
225 Ptr<Packet> fragment = packet->CreateFragment (fragmentOffset,fragment
Size); | 225 Ptr<Packet> fragment = packet->CreateFragment (fragmentOffset,fragment
Size); |
226 | 226 |
227 FragmentationSubheader fragmentSubhdr; | 227 FragmentationSubheader fragmentSubhdr; |
228 NS_LOG_INFO ("\t Latest Fragment" << std::endl); | 228 NS_LOG_INFO ("\t Latest Fragment" << std::endl); |
229 fragmentSubhdr.SetFc (2); // This is the latest fragment | 229 fragmentSubhdr.SetFc (2); // This is the latest fragment |
230 fragmentSubhdr.SetFsn (static_cast<uint8_t>(element.m_fragmentNumber))
; | 230 fragmentSubhdr.SetFsn (static_cast<uint8_t> (element.m_fragmentNumber)
); |
231 | 231 |
232 NS_LOG_INFO ("\t FragmentSize=" << fragment->GetSize () << std::endl); | 232 NS_LOG_INFO ("\t FragmentSize=" << fragment->GetSize () << std::endl); |
233 fragment->AddHeader (fragmentSubhdr); | 233 fragment->AddHeader (fragmentSubhdr); |
234 | 234 |
235 /*check because may be it is a bandwidth request packet (in which case
a Bandwidth Request Header | 235 /*check because may be it is a bandwidth request packet (in which case
a Bandwidth Request Header |
236 has already been added to the packet) in which case Generic MAC Header
will not be added to it. | 236 has already been added to the packet) in which case Generic MAC Header
will not be added to it. |
237 this will only happen in the case of SS as only SS sends the bandwidth
request packet. */ | 237 this will only happen in the case of SS as only SS sends the bandwidth
request packet. */ |
238 if (element.m_hdrType.GetType () == MacHeaderType::HEADER_TYPE_GENERIC
) | 238 if (element.m_hdrType.GetType () == MacHeaderType::HEADER_TYPE_GENERIC
) |
239 { | 239 { |
240 uint8_t tmpType = element.m_hdr.GetType (); | 240 uint8_t tmpType = element.m_hdr.GetType (); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 { | 289 { |
290 NS_LOG_INFO ("\t First Fragment" << std::endl); | 290 NS_LOG_INFO ("\t First Fragment" << std::endl); |
291 SetFragmentation (packetType); | 291 SetFragmentation (packetType); |
292 fragmentSubhdr.SetFc (1); | 292 fragmentSubhdr.SetFc (1); |
293 } | 293 } |
294 else | 294 else |
295 { | 295 { |
296 NS_LOG_INFO ("\t Middle Fragment" << std::endl); | 296 NS_LOG_INFO ("\t Middle Fragment" << std::endl); |
297 fragmentSubhdr.SetFc (3); | 297 fragmentSubhdr.SetFc (3); |
298 } | 298 } |
299 fragmentSubhdr.SetFsn (static_cast<uint8_t>(element.m_fragmentNumber)); | 299 fragmentSubhdr.SetFsn (static_cast<uint8_t> (element.m_fragmentNumber)); |
300 NS_LOG_INFO ("\t FragmentSize=" << fragment->GetSize () << std::endl); | 300 NS_LOG_INFO ("\t FragmentSize=" << fragment->GetSize () << std::endl); |
301 fragment->AddHeader (fragmentSubhdr); | 301 fragment->AddHeader (fragmentSubhdr); |
302 | 302 |
303 SetFragmentNumber (packetType); | 303 SetFragmentNumber (packetType); |
304 SetFragmentOffset (packetType, maxFragmentSize); | 304 SetFragmentOffset (packetType, maxFragmentSize); |
305 | 305 |
306 /*check because may be it is a bandwidth request packet (in which case a B
andwidth Request Header | 306 /*check because may be it is a bandwidth request packet (in which case a B
andwidth Request Header |
307 has already been added to the packet) in which case Generic MAC Header w
ill not be added to it. | 307 has already been added to the packet) in which case Generic MAC Header w
ill not be added to it. |
308 this will only happen in the case of SS as only SS sends the bandwid
th request packet. */ | 308 this will only happen in the case of SS as only SS sends the bandwid
th request packet. */ |
309 if (element.m_hdrType.GetType () == MacHeaderType::HEADER_TYPE_GENERIC) | 309 if (element.m_hdrType.GetType () == MacHeaderType::HEADER_TYPE_GENERIC) |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 } | 401 } |
402 return packet; | 402 return packet; |
403 } | 403 } |
404 | 404 |
405 return 0; | 405 return 0; |
406 } | 406 } |
407 | 407 |
408 uint32_t | 408 uint32_t |
409 WimaxMacQueue::GetSize (void) const | 409 WimaxMacQueue::GetSize (void) const |
410 { | 410 { |
411 return m_queue.size (); | 411 return static_cast<uint32_t> (m_queue.size ()); |
412 } | 412 } |
413 | 413 |
414 uint32_t | 414 uint32_t |
415 WimaxMacQueue::GetNBytes (void) const | 415 WimaxMacQueue::GetNBytes (void) const |
416 { | 416 { |
417 return m_bytes; | 417 return m_bytes; |
418 } | 418 } |
419 | 419 |
420 uint32_t WimaxMacQueue::GetQueueLengthWithMACOverhead (void) | 420 uint32_t WimaxMacQueue::GetQueueLengthWithMACOverhead (void) |
421 { | 421 { |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 { | 651 { |
652 m_fragmentNumber++; | 652 m_fragmentNumber++; |
653 } | 653 } |
654 | 654 |
655 void | 655 void |
656 WimaxMacQueue::QueueElement::SetFragmentOffset (uint32_t offset) | 656 WimaxMacQueue::QueueElement::SetFragmentOffset (uint32_t offset) |
657 { | 657 { |
658 m_fragmentOffset += offset; | 658 m_fragmentOffset += offset; |
659 } | 659 } |
660 } // namespace ns3 | 660 } // namespace ns3 |
LEFT | RIGHT |