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) 2011 Universita' di Firenze, Italy | 3 * Copyright (c) 2011 Universita' di Firenze, Italy |
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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 void | 156 void |
157 Ipv4FragmentationTest::HandleReadServer (Ptr<Socket> socket) | 157 Ipv4FragmentationTest::HandleReadServer (Ptr<Socket> socket) |
158 { | 158 { |
159 Ptr<Packet> packet; | 159 Ptr<Packet> packet; |
160 Address from; | 160 Address from; |
161 while (packet = socket->RecvFrom (from)) | 161 while (packet = socket->RecvFrom (from)) |
162 { | 162 { |
163 if (InetSocketAddress::IsMatchingType (from)) | 163 if (InetSocketAddress::IsMatchingType (from)) |
164 { | 164 { |
165 // InetSocketAddress address = InetSocketAddress::ConvertFrom (from); | |
166 | |
167 // NS_LOG_UNCOND("** HandleReadServer " << *packet << " - " << packet-
>GetSize () ); | |
168 | |
169 packet->RemoveAllPacketTags (); | 165 packet->RemoveAllPacketTags (); |
170 packet->RemoveAllByteTags (); | 166 packet->RemoveAllByteTags (); |
171 | 167 |
172 m_receivedPacketServer = packet->Copy(); | 168 m_receivedPacketServer = packet->Copy(); |
173 } | 169 } |
174 } | 170 } |
175 } | 171 } |
176 | 172 |
177 void | 173 void |
178 Ipv4FragmentationTest::StartClient (Ptr<Node> ClientNode) | 174 Ipv4FragmentationTest::StartClient (Ptr<Node> ClientNode) |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 | 252 |
257 return p; | 253 return p; |
258 } | 254 } |
259 | 255 |
260 void | 256 void |
261 Ipv4FragmentationTest::DoRun (void) | 257 Ipv4FragmentationTest::DoRun (void) |
262 { | 258 { |
263 // set the arp cache to something quite high | 259 // set the arp cache to something quite high |
264 // we shouldn't need because the NetDevice used doesn't need arp, but still | 260 // we shouldn't need because the NetDevice used doesn't need arp, but still |
265 Config::SetDefault ("ns3::ArpCache::PendingQueueSize", UintegerValue (100)); | 261 Config::SetDefault ("ns3::ArpCache::PendingQueueSize", UintegerValue (100)); |
266 // LogComponentEnable("Ipv4L3Protocol", LOG_LEVEL_ALL); | |
267 // LogComponentEnable("Icmpv4L4Protocol", LOG_LEVEL_ALL); | |
268 | 262 |
269 // Create topology | 263 // Create topology |
270 ·· | 264 ·· |
271 // Receiver Node | 265 // Receiver Node |
272 Ptr<Node> serverNode = CreateObject<Node> (); | 266 Ptr<Node> serverNode = CreateObject<Node> (); |
273 AddInternetStack (serverNode); | 267 AddInternetStack (serverNode); |
274 Ptr<ErrorNetDevice> serverDev; | 268 Ptr<ErrorNetDevice> serverDev; |
275 Ptr<BinaryErrorModel> serverDevErrorModel = CreateObject<BinaryErrorModel> (); | 269 Ptr<BinaryErrorModel> serverDevErrorModel = CreateObject<BinaryErrorModel> (); |
276 { | 270 { |
277 serverDev = CreateObject<ErrorNetDevice> (); | 271 serverDev = CreateObject<ErrorNetDevice> (); |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 class Ipv4FragmentationTestSuite : public TestSuite | 406 class Ipv4FragmentationTestSuite : public TestSuite |
413 { | 407 { |
414 public: | 408 public: |
415 Ipv4FragmentationTestSuite () : TestSuite ("ipv4-fragmentation", UNIT) | 409 Ipv4FragmentationTestSuite () : TestSuite ("ipv4-fragmentation", UNIT) |
416 { | 410 { |
417 AddTestCase (new Ipv4FragmentationTest); | 411 AddTestCase (new Ipv4FragmentationTest); |
418 } | 412 } |
419 } g_ipv4fragmentationTestSuite; | 413 } g_ipv4fragmentationTestSuite; |
420 | 414 |
421 }; // namespace ns3 | 415 }; // namespace ns3 |
LEFT | RIGHT |