Bug 2817 - patch: add addresses to trace sources
patch: add addresses to trace sources
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: applications
unspecified
All All
: P3 normal
Assigned To: George Riley
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-11-07 23:47 UTC by Tom Henderson
Modified: 2018-05-30 00:13 UTC (History)
1 user (show)

See Also:


Attachments
Add trace sources with addresses (12.21 KB, patch)
2017-11-07 23:47 UTC, Tom Henderson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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