equal
deleted
inserted
replaced
57 #include "ns3/point-to-point-topology.h" |
57 #include "ns3/point-to-point-topology.h" |
58 #include "ns3/onoff-application.h" |
58 #include "ns3/onoff-application.h" |
59 #include "ns3/packet-sink.h" |
59 #include "ns3/packet-sink.h" |
60 #include "ns3/error-model.h" |
60 #include "ns3/error-model.h" |
61 #include "ns3/node-list.h" |
61 #include "ns3/node-list.h" |
|
62 #include "ns3/config.h" |
62 |
63 |
63 #include "ns3/tcp.h" |
64 #include "ns3/tcp.h" |
64 |
65 |
65 using namespace ns3; |
66 using namespace ns3; |
66 |
67 |
67 NS_LOG_COMPONENT_DEFINE ("TcpLargeTransferErrors"); |
68 NS_LOG_COMPONENT_DEFINE ("TcpLargeTransferErrors"); |
68 |
69 |
69 void |
70 void |
70 ApplicationTraceSink (const TraceContext &context, Ptr<const Packet> packet, |
71 ApplicationTraceSink (Ptr<const Packet> packet, |
71 const Address &addr) |
72 const Address &addr) |
72 { |
73 { |
73 // g_log is not declared in optimized builds |
74 // g_log is not declared in optimized builds |
74 // should convert this to use of some other flag than the logging system |
75 // should convert this to use of some other flag than the logging system |
75 #ifdef NS3_LOG_ENABLE |
76 #ifdef NS3_LOG_ENABLE |
76 if (!g_log.IsNoneEnabled ()) { |
77 if (!g_log.IsNoneEnabled ()) { |
236 // and can be read by the "tcpdump -r" command (use "-tt" option to |
237 // and can be read by the "tcpdump -r" command (use "-tt" option to |
237 // display timestamps correctly) |
238 // display timestamps correctly) |
238 PcapTrace pcaptrace ("tcp-large-transfer-errors.pcap"); |
239 PcapTrace pcaptrace ("tcp-large-transfer-errors.pcap"); |
239 pcaptrace.TraceAllIp (); |
240 pcaptrace.TraceAllIp (); |
240 |
241 |
241 NodeList::Connect ("/nodes/*/applications/*/rx", MakeCallback (&ApplicationTraceSink)); |
242 Config::Connect ("/NodeList/*/ApplicationList/*/Rx", MakeCallback (&ApplicationTraceSink)); |
242 |
243 |
243 Simulator::StopAt (Seconds(10000)); |
244 Simulator::StopAt (Seconds(10000)); |
244 Simulator::Run (); |
245 Simulator::Run (); |
245 Simulator::Destroy (); |
246 Simulator::Destroy (); |
246 } |
247 } |