Bug 2817

Summary: patch: add addresses to trace sources
Product: ns-3 Reporter: Tom Henderson <tomh>
Component: applicationsAssignee: George Riley <riley>
Status: RESOLVED FIXED    
Severity: normal CC: ns-bugs
Priority: P3    
Version: unspecified   
Hardware: All   
OS: All   
Attachments: Add trace sources with addresses

Description Tom Henderson 2017-11-07 23:47:34 UTC
Created attachment 2949 [details]
Add trace sources with addresses

The attached patch (due to Fernando Cintron) proposes to add some new trace sources to several of our traffic generator apps:  PacketSink, UdpEchoClient/Server, OnOffApplication, and UdpServer.

Currently, the traces usually just export a Ptr<Packet>.  The proposal is to add a second trace in parallel to report also the source and destination addresses associated with the packet; e.g.

       m_rxTrace (packet);
+      m_rxTraceWithAddresses (packet, from, localAddress);
 
The signature is:

+   /**
+    * TracedCallback signature for packet and source/destination addresses.
+    *
+    * \param [in] packet The packet.
+    * \param [in] srcAddress The source address.
+    * \param [in] destAddress The destination address.
+    */
+  typedef void (* TwoAddressTracedCallback)
+    (const Ptr<const Packet> packet, const Address &srcAddress, const Address &destAddress);
Comment 1 Tom Henderson 2018-05-30 00:13:12 UTC
pushed in changeset 13607:2a60326d85e3