From 5879700a90004d4ad16cee2b222b2de97e9592d3 Mon Sep 17 00:00:00 2001
From: Peter Barnes
Date: Fri, 1 May 2020 23:54:30 +0000
Subject: [PATCH] core: (fixes 2815) Config::Connect should throw warnings
This patch logs unconditionally when a trace path doesn't exist.
We also provide FailSafe versions of Config::Connect and
Config::ConnectWithoutContext. These should be used
when you can't be sure that a trace path exists in the current model.
This resolves the warnings from AnimationInterface::ConnectCallbacks()
Credit to "InquisitivePenguin (GCI 2019) <>" for diagnosing this issue,
opening the way to a solution.
---
CHANGES.html | 2 +
doc/manual/source/attributes.rst | 10 +-
doc/manual/source/tracing.rst | 7 +
src/core/model/config.cc | 131 +++++++++++-----
src/core/model/config.h | 30 ++++
src/netanim/model/animation-interface.cc | 190 +++++++++++------------
6 files changed, 234 insertions(+), 136 deletions(-)
diff --git a/CHANGES.html b/CHANGES.html
index a5a56dd9a..4d1de5bd2 100644
--- a/CHANGES.html
+++ b/CHANGES.html
@@ -54,6 +54,7 @@ us a note on ns-developers mailing list.
Changes from ns-3.30 to ns-3.31
New API:
+ New ...FailSafe () variants of the Config and Config::MatchContainer functions which set Attributes or connect TraceSources. These all return a boolean indicating if any attributes could be set (or trace sources connected). These are useful if you are not sure that the requested objects exist, for example in AnimationInterface.
New attributes for Ipv4L3Protocol have been added to enable RFC 6621-based duplicate packet detection (DPD) (EnableDuplicatePacketDetection ) and to control the cache expiration time (DuplicateExpire ).
MakeConsistent method of BuildingsHelper class is
deprecated and moved to MobilityBuildingInfo class. DoInitialize
@@ -78,6 +79,7 @@ transmitted.
Changes to existing API:
+ Previously the Config::Connect and Config::Set families of functions would fail silently if the attribute or trace source didn't exist on the path given (typically due to spelling errors). Now those functions will throw a fatal error. If you need the old behavior use the new ...FailSafe () variants.
The internal TCP API for TcpCongestionOps has been extended to support the CongControl method to allow for delivery rate estimation feedback to the congestion control mechanism.
Functions LteEnbPhy::ReceiveUlHarqFeedback and LteUePhy::ReceiveLteDlHarqFeedback are renamed to LteEnbPhy::ReportUlHarqFeedback and LteUePhy::EnqueueDlHarqFeedback , respectively to avoid confusion about their functionality. LteHelper is updated accordingly.
Now on, instead of uint8_t , uint16_t would be used to store a bandwidth value in LTE.
diff --git a/doc/manual/source/attributes.rst b/doc/manual/source/attributes.rst
index f9a6668a7..71af68381 100644
--- a/doc/manual/source/attributes.rst
+++ b/doc/manual/source/attributes.rst
@@ -463,7 +463,15 @@ default values.::
At this point, we have created a single :cpp:class:`Node` (``n0``)
and a single :cpp:class:`PointToPointNetDevice` (``net0``),
-and added a :cpp:class:`DropTailQueue` (``q``) to ``net0``.
+added a :cpp:class:`DropTailQueue` (``q``) to ``net0``,
+which will be configured with a queue size limit of 80 packets.
+
+As a final note, the :cpp:func:`Config::Set...()` functions
+will throw an error if the targeted Attribute does not exist at the path
+given. There are also "fail-safe" versions,
+:cpp:func:`Config::Set...FailSafe()`, if you can't be sure the Attribute
+exists. The fail-safe versions return `true` if at least one instance
+could be set.
Constructors, Helpers and ObjectFactory
=======================================
diff --git a/doc/manual/source/tracing.rst b/doc/manual/source/tracing.rst
index 55ca8e5df..76f6b58d7 100644
--- a/doc/manual/source/tracing.rst
+++ b/doc/manual/source/tracing.rst
@@ -294,6 +294,13 @@ congestion window in the TCP socket, the registered callback will be executed
and the function ``CwndTracer`` will be called printing out the old and new
values of the TCP congestion window.
+As a final note, the :cpp:func:`Config::Connect...()` functions
+will throw an error if the targeted TraceSource does not exist at the path
+given. There are also "fail-safe" versions,
+:cpp:func:`Config::Connect...FailSafe()`, if you can't be sure the TraceSource
+exists. The fail-safe versions return `true` if at least one connection
+could be made.
+
Using the Tracing API
*********************
diff --git a/src/core/model/config.cc b/src/core/model/config.cc
index 25e1942bf..39272882a 100644
--- a/src/core/model/config.cc
+++ b/src/core/model/config.cc
@@ -48,8 +48,8 @@ MatchContainer::MatchContainer (const std::vector > &objects,
const std::vector &contexts,
std::string path)
: m_objects (objects),
- m_contexts (contexts),
- m_path (path)
+ m_contexts (contexts),
+ m_path (path)
{
NS_LOG_FUNCTION (this << &objects << &contexts << path);
}
@@ -97,31 +97,63 @@ MatchContainer::Set (std::string name, const AttributeValue &value)
for (Iterator tmp = Begin (); tmp != End (); ++tmp)
{
Ptr object = *tmp;
+ // Let ObjectBase::SetAttribute raise any errors
object->SetAttribute (name, value);
}
}
+bool
+MatchContainer::SetFailSafe (std::string name, const AttributeValue &value)
+{
+ NS_LOG_FUNCTION (this << name << &value);
+ bool ok = false;
+ for (Iterator tmp = Begin (); tmp != End (); ++tmp)
+ {
+ Ptr object = *tmp;
+ ok |= object->SetAttributeFailSafe (name, value);
+ }
+ return ok;
+}
void
MatchContainer::Connect (std::string name, const CallbackBase &cb)
+{
+ if (!ConnectFailSafe (name, cb))
+ {
+ NS_FATAL_ERROR ("Cound not connect callback to " << name);
+ }
+}
+bool
+MatchContainer::ConnectFailSafe (std::string name, const CallbackBase &cb)
{
NS_LOG_FUNCTION (this << name << &cb);
NS_ASSERT (m_objects.size () == m_contexts.size ());
+ bool ok = false;
for (uint32_t i = 0; i < m_objects.size (); ++i)
{
Ptr object = m_objects[i];
std::string ctx = m_contexts[i] + name;
- object->TraceConnect (name, ctx, cb);
+ ok |= object->TraceConnect (name, ctx, cb);
}
+ return ok;
}
void
MatchContainer::ConnectWithoutContext (std::string name, const CallbackBase &cb)
+{
+ if (!ConnectWithoutContextFailSafe (name, cb))
+ {
+ NS_FATAL_ERROR ("Could not connect callback to " << name);
+ }
+}
+bool
+MatchContainer::ConnectWithoutContextFailSafe (std::string name, const CallbackBase &cb)
{
NS_LOG_FUNCTION (this << name << &cb);
-
+ bool ok = false;
for (Iterator tmp = Begin (); tmp != End (); ++tmp)
{
Ptr object = *tmp;
- object->TraceConnectWithoutContext (name, cb);
+ ok |= object->TraceConnectWithoutContext (name, cb);
}
+ return ok;
}
void
MatchContainer::Disconnect (std::string name, const CallbackBase &cb)
@@ -585,12 +617,16 @@ Resolver::DoArrayResolve (std::string path, const ObjectPtrContainerValue &conta
class ConfigImpl : public Singleton
{
public:
+ // Keep Set and SetFailSafe since their errors are triggered
+ // by the underlying ObjecBase functions.
/** \copydoc Config::Set() */
void Set (std::string path, const AttributeValue &value);
- /** \copydoc Config::ConnectWithoutContext() */
- void ConnectWithoutContext (std::string path, const CallbackBase &cb);
- /** \copydoc Config::Connect() */
- void Connect (std::string path, const CallbackBase &cb);
+ /** \copydoc Config::SetFailSafe() */
+ bool SetFailSafe (std::string path, const AttributeValue &value);
+ /** \copydoc Config::ConnectWithoutContextFailSafe() */
+ bool ConnectWithoutContextFailSafe (std::string path, const CallbackBase &cb);
+ /** \copydoc Config::ConnectFailSafe() */
+ bool ConnectFailSafe (std::string path, const CallbackBase &cb);
/** \copydoc Config::DisconnectWithoutContext() */
void DisconnectWithoutContext (std::string path, const CallbackBase &cb);
/** \copydoc Config::Disconnect() */
@@ -648,21 +684,24 @@ ConfigImpl::Set (std::string path, const AttributeValue &value)
MatchContainer container = LookupMatches (root);
container.Set (leaf, value);
}
-void
-ConfigImpl::ConnectWithoutContext (std::string path, const CallbackBase &cb)
+bool
+ConfigImpl::SetFailSafe (std::string path, const AttributeValue &value)
+{
+ NS_LOG_FUNCTION (this << path << &value);
+
+ std::string root, leaf;
+ ParsePath (path, &root, &leaf);
+ MatchContainer container = LookupMatches (root);
+ return container.SetFailSafe (leaf, value);
+}
+bool
+ConfigImpl::ConnectWithoutContextFailSafe (std::string path, const CallbackBase &cb)
{
NS_LOG_FUNCTION (this << path << &cb);
std::string root, leaf;
ParsePath (path, &root, &leaf);
MatchContainer container = LookupMatches (root);
- if (container.GetN () == 0)
- {
- std::size_t lastFwdSlash = root.rfind ("/");
- NS_LOG_WARN ("Failed to connect " << leaf <<
- ", the Requested object name = " << root.substr (lastFwdSlash + 1) <<
- " does not exits on path " << root.substr (0, lastFwdSlash));
- }
- container.ConnectWithoutContext (leaf, cb);
+ return container.ConnectWithoutContextFailSafe (leaf, cb);
}
void
ConfigImpl::DisconnectWithoutContext (std::string path, const CallbackBase &cb)
@@ -674,28 +713,21 @@ ConfigImpl::DisconnectWithoutContext (std::string path, const CallbackBase &cb)
if (container.GetN () == 0)
{
std::size_t lastFwdSlash = root.rfind ("/");
- NS_LOG_WARN ("Failed to disconnect " << leaf <<
- ", the Requested object name = " << root.substr (lastFwdSlash + 1) <<
- " does not exits on path " << root.substr (0, lastFwdSlash));
+ NS_LOG_WARN ("Failed to disconnect " << leaf
+ << ", the Requested object name = " << root.substr (lastFwdSlash + 1)
+ << " does not exits on path " << root.substr (0, lastFwdSlash));
}
container.DisconnectWithoutContext (leaf, cb);
}
-void
-ConfigImpl::Connect (std::string path, const CallbackBase &cb)
+bool
+ConfigImpl::ConnectFailSafe (std::string path, const CallbackBase &cb)
{
NS_LOG_FUNCTION (this << path << &cb);
std::string root, leaf;
ParsePath (path, &root, &leaf);
MatchContainer container = LookupMatches (root);
- if (container.GetN () == 0)
- {
- std::size_t lastFwdSlash = root.rfind ("/");
- NS_LOG_WARN ("Failed to connect " << leaf <<
- ", the Requested object name = " << root.substr (lastFwdSlash + 1) <<
- " does not exits on path " << root.substr (0, lastFwdSlash));
- }
- container.Connect (leaf, cb);
+ return container.ConnectFailSafe (leaf, cb);
}
void
ConfigImpl::Disconnect (std::string path, const CallbackBase &cb)
@@ -708,9 +740,9 @@ ConfigImpl::Disconnect (std::string path, const CallbackBase &cb)
if (container.GetN () == 0)
{
std::size_t lastFwdSlash = root.rfind ("/");
- NS_LOG_WARN ("Failed to disconnect " << leaf <<
- ", the Requested object name = " << root.substr (lastFwdSlash + 1) <<
- " does not exits on path " << root.substr (0, lastFwdSlash));
+ NS_LOG_WARN ("Failed to disconnect " << leaf
+ << ", the Requested object name = " << root.substr (lastFwdSlash + 1)
+ << " does not exits on path " << root.substr (0, lastFwdSlash));
}
container.Disconnect (leaf, cb);
}
@@ -721,10 +753,11 @@ ConfigImpl::LookupMatches (std::string path)
NS_LOG_FUNCTION (this << path);
class LookupMatchesResolver : public Resolver
{
- public:
+public:
LookupMatchesResolver (std::string path)
: Resolver (path)
- {}
+ {
+ }
virtual void DoOne (Ptr object, std::string path)
{
m_objects.push_back (object);
@@ -803,12 +836,16 @@ void Reset (void)
(*i)->ResetInitialValue ();
}
}
-
void Set (std::string path, const AttributeValue &value)
{
NS_LOG_FUNCTION (path << &value);
ConfigImpl::Get ()->Set (path, value);
}
+bool SetFailSafe (std::string path, const AttributeValue &value)
+{
+ NS_LOG_FUNCTION (path << &value);
+ return ConfigImpl::Get ()->SetFailSafe (path, value);
+}
void SetDefault (std::string name, const AttributeValue &value)
{
NS_LOG_FUNCTION (name << &value);
@@ -862,7 +899,12 @@ bool SetGlobalFailSafe (std::string name, const AttributeValue &value)
void ConnectWithoutContext (std::string path, const CallbackBase &cb)
{
NS_LOG_FUNCTION (path << &cb);
- ConfigImpl::Get ()->ConnectWithoutContext (path, cb);
+ ConnectWithoutContextFailSafe (path, cb);
+}
+bool ConnectWithoutContextFailSafe (std::string path, const CallbackBase &cb)
+{
+ NS_LOG_FUNCTION (path << &cb);
+ return ConfigImpl::Get ()->ConnectWithoutContextFailSafe (path, cb);
}
void DisconnectWithoutContext (std::string path, const CallbackBase &cb)
{
@@ -873,7 +915,16 @@ void
Connect (std::string path, const CallbackBase &cb)
{
NS_LOG_FUNCTION (path << &cb);
- ConfigImpl::Get ()->Connect (path, cb);
+ if (!ConnectFailSafe (path, cb))
+ {
+ NS_FATAL_ERROR ("Could not connect callback to " << name);
+ }
+}
+bool
+ConnectFailSafe (std::string path, const CallbackBase &cb)
+{
+ NS_LOG_FUNCTION (path << &cb);
+ return ConfigImpl::Get ()->ConnectFailSafe (path, cb);
}
void
Disconnect (std::string path, const CallbackBase &cb)
diff --git a/src/core/model/config.h b/src/core/model/config.h
index 096ed45d2..1e76d3ab8 100644
--- a/src/core/model/config.h
+++ b/src/core/model/config.h
@@ -65,6 +65,11 @@ void Reset (void);
* value.
*/
void Set (std::string path, const AttributeValue &value);
+/**
+ * \copydoc Set()
+ * \return \c true if any matching attributes could be set.
+ */
+bool SetFailSafe (std::string path, const AttributeValue &value);
/**
* \ingroup config
* \param [in] name The full name of the attribute
@@ -112,6 +117,11 @@ bool SetGlobalFailSafe (std::string name, const AttributeValue &value);
* to them.
*/
void ConnectWithoutContext (std::string path, const CallbackBase &cb);
+/**
+ * \copydoc ConnectWithoutContext()
+ * \returns \c true if any trace sources could be connected.
+ */
+bool ConnectWithoutContextFailSafe (std::string path, const CallbackBase &cb);
/**
* \ingroup config
* \param [in] path A path to match trace sources.
@@ -131,6 +141,11 @@ void DisconnectWithoutContext (std::string path, const CallbackBase &cb);
* context string upon trace event notification.
*/
void Connect (std::string path, const CallbackBase &cb);
+/**
+ * \copydoc Connect()
+ * \returns \c true if any trace sources could be connected.
+ */
+bool ConnectFailSafe (std::string path, const CallbackBase &cb);
/**
* \ingroup config
* \param [in] path A path to match trace sources.
@@ -204,6 +219,11 @@ public:
* \sa ns3::Config::Set
*/
void Set (std::string name, const AttributeValue &value);
+ /**
+ * \copydoc Set()
+ * \returns \c true if any attributes could be set.
+ */
+ bool SetFailSafe (std::string name, const AttributeValue &value);
/**
* \param [in] name The name of the trace source to connect to
* \param [in] cb The sink to connect to the trace source
@@ -213,6 +233,11 @@ public:
* \sa ns3::Config::Connect
*/
void Connect (std::string name, const CallbackBase &cb);
+ /**
+ * \copydoc Connect()
+ * \returns \c true if any trace sources could be connected.
+ */
+ bool ConnectFailSafe (std::string name, const CallbackBase &cb);
/**
* \param [in] name The name of the trace source to connect to
* \param [in] cb The sink to connect to the trace source
@@ -222,6 +247,11 @@ public:
* \sa ns3::Config::ConnectWithoutContext
*/
void ConnectWithoutContext (std::string name, const CallbackBase &cb);
+ /**
+ * \copydoc ConnectWithoutContext()
+ * \returns \c true if any trace sources could be connected.
+ */
+ bool ConnectWithoutContextFailSafe (std::string name, const CallbackBase &cb);
/**
* \param [in] name The name of the trace source to disconnect from
* \param [in] cb The sink to disconnect from the trace source
diff --git a/src/netanim/model/animation-interface.cc b/src/netanim/model/animation-interface.cc
index fd36818ad..09dc26f6e 100644
--- a/src/netanim/model/animation-interface.cc
+++ b/src/netanim/model/animation-interface.cc
@@ -1626,109 +1626,109 @@ void
AnimationInterface::ConnectCallbacks ()
{
// Connect the callbacks
- Config::Connect ("/ChannelList/*/TxRxPointToPoint",
- MakeCallback (&AnimationInterface::DevTxTrace, this));
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyTxPsduBegin",
- MakeCallback (&AnimationInterface::WifiPhyTxBeginTrace, this));
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyRxBegin",
- MakeCallback (&AnimationInterface::WifiPhyRxBeginTrace, this));
- Config::ConnectWithoutContext ("/NodeList/*/$ns3::MobilityModel/CourseChange",
- MakeCallback (&AnimationInterface::MobilityCourseChangeTrace, this));
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::WimaxNetDevice/Tx",
- MakeCallback (&AnimationInterface::WimaxTxTrace, this));
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::WimaxNetDevice/Rx",
- MakeCallback (&AnimationInterface::WimaxRxTrace, this));
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::LteNetDevice/Tx",
- MakeCallback (&AnimationInterface::LteTxTrace, this));
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::LteNetDevice/Rx",
- MakeCallback (&AnimationInterface::LteRxTrace, this));
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::CsmaNetDevice/PhyTxBegin",
- MakeCallback (&AnimationInterface::CsmaPhyTxBeginTrace, this));
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::CsmaNetDevice/PhyTxEnd",
- MakeCallback (&AnimationInterface::CsmaPhyTxEndTrace, this));
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::CsmaNetDevice/PhyRxEnd",
- MakeCallback (&AnimationInterface::CsmaPhyRxEndTrace, this));
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::CsmaNetDevice/MacRx",
- MakeCallback (&AnimationInterface::CsmaMacRxTrace, this));
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::UanNetDevice/Phy/PhyTxBegin",
- MakeCallback (&AnimationInterface::UanPhyGenTxTrace, this));
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::UanNetDevice/Phy/PhyRxBegin",
- MakeCallback (&AnimationInterface::UanPhyGenRxTrace, this));
- Config::Connect ("/NodeList/*/$ns3::BasicEnergySource/RemainingEnergy",
- MakeCallback (&AnimationInterface::RemainingEnergyTrace, this));
-
+ Config::ConnectFailSafe ("/ChannelList/*/TxRxPointToPoint",
+ MakeCallback (&AnimationInterface::DevTxTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyTxPsduBegin",
+ MakeCallback (&AnimationInterface::WifiPhyTxBeginTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyRxBegin",
+ MakeCallback (&AnimationInterface::WifiPhyRxBeginTrace, this));
+ Config::ConnectWithoutContextFailSafe ("/NodeList/*/$ns3::MobilityModel/CourseChange",
+ MakeCallback (&AnimationInterface::MobilityCourseChangeTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::WimaxNetDevice/Tx",
+ MakeCallback (&AnimationInterface::WimaxTxTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::WimaxNetDevice/Rx",
+ MakeCallback (&AnimationInterface::WimaxRxTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::LteNetDevice/Tx",
+ MakeCallback (&AnimationInterface::LteTxTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::LteNetDevice/Rx",
+ MakeCallback (&AnimationInterface::LteRxTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::CsmaNetDevice/PhyTxBegin",
+ MakeCallback (&AnimationInterface::CsmaPhyTxBeginTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::CsmaNetDevice/PhyTxEnd",
+ MakeCallback (&AnimationInterface::CsmaPhyTxEndTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::CsmaNetDevice/PhyRxEnd",
+ MakeCallback (&AnimationInterface::CsmaPhyRxEndTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::CsmaNetDevice/MacRx",
+ MakeCallback (&AnimationInterface::CsmaMacRxTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::UanNetDevice/Phy/PhyTxBegin",
+ MakeCallback (&AnimationInterface::UanPhyGenTxTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::UanNetDevice/Phy/PhyRxBegin",
+ MakeCallback (&AnimationInterface::UanPhyGenRxTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/$ns3::BasicEnergySource/RemainingEnergy",
+ MakeCallback (&AnimationInterface::RemainingEnergyTrace, this));
+
ConnectLte ();
-
- Config::Connect ("/NodeList/*/$ns3::Ipv4L3Protocol/Tx",
- MakeCallback (&AnimationInterface::Ipv4TxTrace, this));
- Config::Connect ("/NodeList/*/$ns3::Ipv4L3Protocol/Rx",
- MakeCallback (&AnimationInterface::Ipv4RxTrace, this));
- Config::Connect ("/NodeList/*/$ns3::Ipv4L3Protocol/Drop",
- MakeCallback (&AnimationInterface::Ipv4DropTrace, this));
-
+
+ Config::ConnectFailSafe ("/NodeList/*/$ns3::Ipv4L3Protocol/Tx",
+ MakeCallback (&AnimationInterface::Ipv4TxTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/$ns3::Ipv4L3Protocol/Rx",
+ MakeCallback (&AnimationInterface::Ipv4RxTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/$ns3::Ipv4L3Protocol/Drop",
+ MakeCallback (&AnimationInterface::Ipv4DropTrace, this));
+
// Queue Enqueues
-
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::AlohaNoackNetDevice/Queue/Enqueue",
- MakeCallback (&AnimationInterface::EnqueueTrace, this));
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::CsmaNetDevice/TxQueue/Enqueue",
- MakeCallback (&AnimationInterface::EnqueueTrace, this));
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::PointToPointNetDevice/TxQueue/Enqueue",
- MakeCallback (&AnimationInterface::EnqueueTrace, this));
-
+
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::AlohaNoackNetDevice/Queue/Enqueue",
+ MakeCallback (&AnimationInterface::EnqueueTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::CsmaNetDevice/TxQueue/Enqueue",
+ MakeCallback (&AnimationInterface::EnqueueTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::PointToPointNetDevice/TxQueue/Enqueue",
+ MakeCallback (&AnimationInterface::EnqueueTrace, this));
+
// Queue Dequeues
-
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::AlohaNoackNetDevice/Queue/Dequeue",
- MakeCallback (&AnimationInterface::DequeueTrace, this));
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::CsmaNetDevice/TxQueue/Dequeue",
- MakeCallback (&AnimationInterface::DequeueTrace, this));
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::PointToPointNetDevice/TxQueue/Dequeue",
- MakeCallback (&AnimationInterface::DequeueTrace, this));
-
+
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::AlohaNoackNetDevice/Queue/Dequeue",
+ MakeCallback (&AnimationInterface::DequeueTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::CsmaNetDevice/TxQueue/Dequeue",
+ MakeCallback (&AnimationInterface::DequeueTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::PointToPointNetDevice/TxQueue/Dequeue",
+ MakeCallback (&AnimationInterface::DequeueTrace, this));
+
// Queue Drops
-
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::AlohaNoackNetDevice/Queue/Drop",
- MakeCallback (&AnimationInterface::QueueDropTrace, this));
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::CsmaNetDevice/TxQueue/Drop",
- MakeCallback (&AnimationInterface::QueueDropTrace, this));
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::PointToPointNetDevice/TxQueue/Drop",
- MakeCallback (&AnimationInterface::QueueDropTrace, this));
-
-
+
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::AlohaNoackNetDevice/Queue/Drop",
+ MakeCallback (&AnimationInterface::QueueDropTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::CsmaNetDevice/TxQueue/Drop",
+ MakeCallback (&AnimationInterface::QueueDropTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::PointToPointNetDevice/TxQueue/Drop",
+ MakeCallback (&AnimationInterface::QueueDropTrace, this));
+
+
// Wifi Mac
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/MacTx",
- MakeCallback (&AnimationInterface::WifiMacTxTrace, this));
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/MacTxDrop",
- MakeCallback (&AnimationInterface::WifiMacTxDropTrace, this));
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/MacRx",
- MakeCallback (&AnimationInterface::WifiMacRxTrace, this));
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/MacRxDrop",
- MakeCallback (&AnimationInterface::WifiMacRxDropTrace, this));
-
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/MacTx",
+ MakeCallback (&AnimationInterface::WifiMacTxTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/MacTxDrop",
+ MakeCallback (&AnimationInterface::WifiMacTxDropTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/MacRx",
+ MakeCallback (&AnimationInterface::WifiMacRxTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/MacRxDrop",
+ MakeCallback (&AnimationInterface::WifiMacRxDropTrace, this));
+
// Wifi Phy
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyTxDrop",
- MakeCallback (&AnimationInterface::WifiPhyTxDropTrace, this));
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyRxDrop",
- MakeCallback (&AnimationInterface::WifiPhyRxDropTrace, this));
-
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyTxDrop",
+ MakeCallback (&AnimationInterface::WifiPhyTxDropTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyRxDrop",
+ MakeCallback (&AnimationInterface::WifiPhyRxDropTrace, this));
+
// LrWpan
- Config::Connect ("NodeList/*/DeviceList/*/$ns3::LrWpanNetDevice/Phy/PhyTxBegin",
- MakeCallback (&AnimationInterface::LrWpanPhyTxBeginTrace, this));
- Config::Connect ("NodeList/*/DeviceList/*/$ns3::LrWpanNetDevice/Phy/PhyRxBegin",
- MakeCallback (&AnimationInterface::LrWpanPhyRxBeginTrace, this));
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::LrWpanNetDevice/Mac/MacTx",
- MakeCallback (&AnimationInterface::LrWpanMacTxTrace, this));
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::LrWpanNetDevice/Mac/MacTxDrop",
- MakeCallback (&AnimationInterface::LrWpanMacTxDropTrace, this));
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::LrWpanNetDevice/Mac/MacRx",
- MakeCallback (&AnimationInterface::LrWpanMacRxTrace, this));
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::LrWpanNetDevice/Mac/MacRxDrop",
- MakeCallback (&AnimationInterface::LrWpanMacRxDropTrace, this));
-
+ Config::ConnectFailSafe ("NodeList/*/DeviceList/*/$ns3::LrWpanNetDevice/Phy/PhyTxBegin",
+ MakeCallback (&AnimationInterface::LrWpanPhyTxBeginTrace, this));
+ Config::ConnectFailSafe ("NodeList/*/DeviceList/*/$ns3::LrWpanNetDevice/Phy/PhyRxBegin",
+ MakeCallback (&AnimationInterface::LrWpanPhyRxBeginTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::LrWpanNetDevice/Mac/MacTx",
+ MakeCallback (&AnimationInterface::LrWpanMacTxTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::LrWpanNetDevice/Mac/MacTxDrop",
+ MakeCallback (&AnimationInterface::LrWpanMacTxDropTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::LrWpanNetDevice/Mac/MacRx",
+ MakeCallback (&AnimationInterface::LrWpanMacRxTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::LrWpanNetDevice/Mac/MacRxDrop",
+ MakeCallback (&AnimationInterface::LrWpanMacRxDropTrace, this));
+
// Wave
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::WaveNetDevice/PhyEntities/*/$ns3::WifiPhy/PhyTxBegin",
- MakeCallback (&AnimationInterface::WavePhyTxBeginTrace, this));
- Config::Connect ("/NodeList/*/DeviceList/*/$ns3::WaveNetDevice/PhyEntities/*/$ns3::WifiPhy/PhyRxBegin",
- MakeCallback (&AnimationInterface::WavePhyRxBeginTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::WaveNetDevice/PhyEntities/*/$ns3::WifiPhy/PhyTxBegin",
+ MakeCallback (&AnimationInterface::WavePhyTxBeginTrace, this));
+ Config::ConnectFailSafe ("/NodeList/*/DeviceList/*/$ns3::WaveNetDevice/PhyEntities/*/$ns3::WifiPhy/PhyRxBegin",
+ MakeCallback (&AnimationInterface::WavePhyRxBeginTrace, this));
}
Vector