OLD | NEW |
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 Strasbourg University | 3 * Copyright (c) 2008-2009 Strasbourg University |
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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 ping6.SetLocal (i1.GetAddress (0, 1)); | 144 ping6.SetLocal (i1.GetAddress (0, 1)); |
145 ping6.SetRemote (i2.GetAddress (1, 1));· | 145 ping6.SetRemote (i2.GetAddress (1, 1));· |
146 | 146 |
147 ping6.SetAttribute ("MaxPackets", UintegerValue (maxPacketCount)); | 147 ping6.SetAttribute ("MaxPackets", UintegerValue (maxPacketCount)); |
148 ping6.SetAttribute ("Interval", TimeValue (interPacketInterval)); | 148 ping6.SetAttribute ("Interval", TimeValue (interPacketInterval)); |
149 ping6.SetAttribute ("PacketSize", UintegerValue (packetSize)); | 149 ping6.SetAttribute ("PacketSize", UintegerValue (packetSize)); |
150 ApplicationContainer apps = ping6.Install (net1.Get (0)); | 150 ApplicationContainer apps = ping6.Install (net1.Get (0)); |
151 apps.Start (Seconds (2.0)); | 151 apps.Start (Seconds (2.0)); |
152 apps.Stop (Seconds (20.0)); | 152 apps.Stop (Seconds (20.0)); |
153 | 153 |
154 std::ofstream ascii; | 154 AsciiTraceHelper ascii; |
155 ascii.open ("simple-routing-ping6.tr"); | 155 csma.EnableAsciiAll (ascii.CreateFileStream ("simple-routing-ping6.tr")); |
156 CsmaHelper::EnablePcapAll (std::string ("simple-routing-ping6"), true); | 156 csma.EnablePcapAll ("simple-routing-ping6", true); |
157 CsmaHelper::EnableAsciiAll (ascii); | |
158 | 157 |
159 NS_LOG_INFO ("Run Simulation."); | 158 NS_LOG_INFO ("Run Simulation."); |
160 Simulator::Run (); | 159 Simulator::Run (); |
161 Simulator::Destroy (); | 160 Simulator::Destroy (); |
162 NS_LOG_INFO ("Done."); | 161 NS_LOG_INFO ("Done."); |
163 } | 162 } |
164 | 163 |
OLD | NEW |