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 | 3 * Copyright (c) 2007,2008 INRIA |
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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 BSScheduler::CheckForFragmentation (Ptr<WimaxConnection> connection, | 95 BSScheduler::CheckForFragmentation (Ptr<WimaxConnection> connection, |
96 int availableSymbols, | 96 int availableSymbols, |
97 WimaxPhy::ModulationType modulationType) | 97 WimaxPhy::ModulationType modulationType) |
98 { | 98 { |
99 NS_LOG_INFO ("BS Scheduler, CheckForFragmentation"); | 99 NS_LOG_INFO ("BS Scheduler, CheckForFragmentation"); |
100 if (connection->GetType () != Cid::TRANSPORT) | 100 if (connection->GetType () != Cid::TRANSPORT) |
101 { | 101 { |
102 NS_LOG_INFO ("\t No Transport connction, Fragmentation IS NOT possible"); | 102 NS_LOG_INFO ("\t No Transport connction, Fragmentation IS NOT possible"); |
103 return false; | 103 return false; |
104 } | 104 } |
105 uint32_t availableByte = static_cast<uint32_t>(GetBs ()->GetPhy ()-> | 105 uint32_t availableByte = static_cast<uint32_t> (GetBs ()->GetPhy ()-> |
106 GetNrBytes (availableSymbols, modulationType)); | 106 GetNrBytes (availableSymbols, modulationType)); |
107 | 107 |
108 uint32_t headerSize = connection->GetQueue ()->GetFirstPacketHdrSize ( | 108 uint32_t headerSize = connection->GetQueue ()->GetFirstPacketHdrSize ( |
109 MacHeaderType::HEADER_TYPE_GENERIC); | 109 MacHeaderType::HEADER_TYPE_GENERIC); |
110 NS_LOG_INFO ("\t availableByte = " << availableByte << | 110 NS_LOG_INFO ("\t availableByte = " << availableByte << |
111 " headerSize = " << headerSize); | 111 " headerSize = " << headerSize); |
112 | 112 |
113 if (availableByte > headerSize) | 113 if (availableByte > headerSize) |
114 { | 114 { |
115 NS_LOG_INFO ("\t Fragmentation IS possible"); | 115 NS_LOG_INFO ("\t Fragmentation IS possible"); |
116 return true; | 116 return true; |
117 } | 117 } |
118 else | 118 else |
119 { | 119 { |
120 NS_LOG_INFO ("\t Fragmentation IS NOT possible"); | 120 NS_LOG_INFO ("\t Fragmentation IS NOT possible"); |
121 return false; | 121 return false; |
122 } | 122 } |
123 } | 123 } |
124 } // namespace ns3 | 124 } // namespace ns3 |
LEFT | RIGHT |