diff -r c6e03f378655 src/applications/onoff/onoff-application.cc --- a/src/applications/onoff/onoff-application.cc Fri Oct 08 10:01:00 2010 -0700 +++ b/src/applications/onoff/onoff-application.cc Sun Oct 10 11:37:41 2010 -0700 @@ -111,6 +111,12 @@ m_maxBytes = maxBytes; } +Ptr +OnOffApplication::GetSocket (void) const +{ + NS_LOG_FUNCTION (this); + return m_socket; +} void OnOffApplication::DoDispose (void) diff -r c6e03f378655 src/applications/onoff/onoff-application.h --- a/src/applications/onoff/onoff-application.h Fri Oct 08 10:01:00 2010 -0700 +++ b/src/applications/onoff/onoff-application.h Sun Oct 10 11:37:41 2010 -0700 @@ -102,6 +102,11 @@ */ void SetMaxBytes (uint32_t maxBytes); + /** + * \return pointer to associated socket + */ + Ptr GetSocket (void) const; + protected: virtual void DoDispose (void); private: diff -r c6e03f378655 src/applications/packet-sink/packet-sink.cc --- a/src/applications/packet-sink/packet-sink.cc Fri Oct 08 10:01:00 2010 -0700 +++ b/src/applications/packet-sink/packet-sink.cc Sun Oct 10 11:37:41 2010 -0700 @@ -75,6 +75,20 @@ return m_totalRx; } +Ptr +PacketSink::GetListeningSocket (void) const +{ + NS_LOG_FUNCTION (this); + return m_socket; +} + +std::list > +PacketSink::GetAcceptedSockets (void) const +{ + NS_LOG_FUNCTION (this); + return m_socketList; +} + void PacketSink::DoDispose (void) { NS_LOG_FUNCTION (this); diff -r c6e03f378655 src/applications/packet-sink/packet-sink.h --- a/src/applications/packet-sink/packet-sink.h Fri Oct 08 10:01:00 2010 -0700 +++ b/src/applications/packet-sink/packet-sink.h Sun Oct 10 11:37:41 2010 -0700 @@ -77,7 +77,17 @@ * \return the total bytes received in this sink app */ uint32_t GetTotalRx () const; - + + /** + * \return pointer to listening socket + */ + Ptr GetListeningSocket (void) const; + + /** + * \return list of pointers to accepted sockets + */ + std::list > GetAcceptedSockets (void) const; + protected: virtual void DoDispose (void); private: