Thu Dec 8 12:10:32 2016 +0100 25c3d5a network: added API for signalling socket creation  [Natale Patriciello] diff --git a/src/network/model/application.cc b/src/network/model/application.cc index 415fac0..8eb4514 100644 --- a/src/network/model/application.cc +++ b/src/network/model/application.cc @@ -49,6 +49,10 @@ Application::GetTypeId (void) TimeValue (TimeStep (0)), MakeTimeAccessor (&Application::m_stopTime), MakeTimeChecker ()) + .AddTraceSource ("SocketCreated", + "A Socket has been created", + MakeTraceSourceAccessor (&Application::m_socketCreated), + "ns3::Application::ApplicationSocketCreated") ; return tid; } diff --git a/src/network/model/application.h b/src/network/model/application.h index cb00055..2f9478e 100644 --- a/src/network/model/application.h +++ b/src/network/model/application.h @@ -26,6 +26,8 @@ #include "ns3/object.h" #include "ns3/ptr.h" #include "ns3/node.h" +#include "ns3/traced-callback.h" +#include "ns3/socket.h" namespace ns3 { @@ -104,6 +106,13 @@ public: */ void SetNode (Ptr node); + /** + * TracedCallback signature for socket creation + * + * \param [in] socket The socket created + */ + typedef void (* ApplicationSocketCreated)(const Ptr socket); + private: /** * \brief Application specific startup code @@ -131,6 +140,8 @@ protected: Time m_stopTime; //!< The simulation time that the application will end EventId m_startEvent; //!< The event that will fire at m_startTime to start the application EventId m_stopEvent; //!< The event that will fire at m_stopTime to end the application + + TracedCallback > m_socketCreated; //!< TracedCallback for socket creation }; } // namespace ns3