diff --git a/src/network/model/node.cc b/src/network/model/node.cc index 76684d8bf..8b251cf4c 100644 --- a/src/network/model/node.cc +++ b/src/network/model/node.cc @@ -110,6 +110,13 @@ Node::GetId (void) const return m_id; } +Time +Node::GetLocalTime (void) const +{ + NS_LOG_FUNCTION (this); + return Simulator::Now (); +} + uint32_t Node::GetSystemId (void) const { diff --git a/src/network/model/node.h b/src/network/model/node.h index 9826b6cd3..ef8215912 100644 --- a/src/network/model/node.h +++ b/src/network/model/node.h @@ -33,6 +33,7 @@ namespace ns3 { class Application; class Packet; class Address; +class Time; /** @@ -77,6 +78,16 @@ public: */ uint32_t GetId (void) const; + /** + * In the future, ns3 nodes may have clock that returned a local time + * different from the virtual time Simulator::Now(). + * This function is currently a placeholder to ease the development of this feature. + * For now, it is only an alias to Simulator::Now() + * + * \return The time as seen by this node + */ + Time GetLocalTime (void) const; + /** * \returns the system id for parallel simulations associated * to this node.