--- a/src/uan/model/uan-phy.cc Fri Jun 15 06:59:19 2012 -0700
+++ b/src/uan/model/uan-phy.cc Mon Jun 18 10:18:58 2012 +0200
@@ -69,8 +69,64 @@
TypeId UanPhy::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::UanPhy")
- .SetParent<Object> ();
+ .SetParent<Object> ()
+ .AddTraceSource ("PhyTxBegin",
+ "Trace source indicating a packet has begun transmitting over the channel medium",
+ MakeTraceSourceAccessor (&UanPhy::m_phyTxBeginTrace))
+ .AddTraceSource ("PhyTxEnd",
+ "Trace source indicating a packet has been completely transmitted over the channel.",
+ MakeTraceSourceAccessor (&UanPhy::m_phyTxEndTrace))
+ .AddTraceSource ("PhyTxDrop",
+ "Trace source indicating a packet has been dropped by the device during transmission",
+ MakeTraceSourceAccessor (&UanPhy::m_phyTxDropTrace))
+ .AddTraceSource ("PhyRxBegin",
+ "Trace source indicating a packet has begun being received from the channel medium by the device",
+ MakeTraceSourceAccessor (&UanPhy::m_phyRxBeginTrace))
+ .AddTraceSource ("PhyRxEnd",
+ "Trace source indicating a packet has been completely received from the channel medium by the device",
+ MakeTraceSourceAccessor (&UanPhy::m_phyRxEndTrace))
+ .AddTraceSource ("PhyRxDrop",
+ "Trace source indicating a packet has been dropped by the device during reception",
+ MakeTraceSourceAccessor (&UanPhy::m_phyRxDropTrace))
+ ;
return tid;
}
+
+void
+UanPhy::NotifyTxBegin (Ptr<const Packet> packet)
+{
+ m_phyTxBeginTrace (packet);
+}
+
+void
+UanPhy::NotifyTxEnd (Ptr<const Packet> packet)
+{
+ m_phyTxEndTrace (packet);
+}
+
+void
+UanPhy::NotifyTxDrop (Ptr<const Packet> packet)
+{
+ m_phyTxDropTrace (packet);
+}
+
+void
+UanPhy::NotifyRxBegin (Ptr<const Packet> packet)
+{
+ m_phyRxBeginTrace (packet);
+}
+
+void
+UanPhy::NotifyRxEnd (Ptr<const Packet> packet)
+{
+ m_phyRxEndTrace (packet);
+}
+
+void
+UanPhy::NotifyRxDrop (Ptr<const Packet> packet)
+{
+ m_phyRxDropTrace (packet);
+}
+
} // namespace ns3
--- a/src/uan/model/uan-phy.h Fri Jun 15 06:59:19 2012 -0700
+++ b/src/uan/model/uan-phy.h Mon Jun 18 10:18:58 2012 +0200
@@ -382,6 +382,91 @@
virtual void Clear (void) = 0;
virtual void SetSleepMode (bool sleep) = 0;
+
+
+ /**
+ * Public method used to fire a PhyTxBegin trace. Implemented for encapsulation
+ * purposes.
+ */
+ void NotifyTxBegin (Ptr<const Packet> packet);
+
+ /**
+ * Public method used to fire a PhyTxEnd trace. Implemented for encapsulation
+ * purposes.
+ */
+ void NotifyTxEnd (Ptr<const Packet> packet);
+
+ /**
+ * Public method used to fire a PhyTxDrop trace. Implemented for encapsulation
+ * purposes.
+ */
+ void NotifyTxDrop (Ptr<const Packet> packet);
+
+ /**
+ * Public method used to fire a PhyRxBegin trace. Implemented for encapsulation
+ * purposes.
+ */
+ void NotifyRxBegin (Ptr<const Packet> packet);
+
+ /**
+ * Public method used to fire a PhyRxEnd trace. Implemented for encapsulation
+ * purposes.
+ */
+ void NotifyRxEnd (Ptr<const Packet> packet);
+
+ /**
+ * Public method used to fire a PhyRxDrop trace. Implemented for encapsulation
+ * purposes.
+ */
+ void NotifyRxDrop (Ptr<const Packet> packet);
+
+private:
+ /**
+ * The trace source fired when a packet begins the transmission process on
+ * the medium.
+ *
+ * \see class CallBackTraceSource
+ */
+ TracedCallback<Ptr<const Packet> > m_phyTxBeginTrace;
+
+ /**
+ * The trace source fired when a packet ends the transmission process on
+ * the medium.
+ *
+ * \see class CallBackTraceSource
+ */
+ TracedCallback<Ptr<const Packet> > m_phyTxEndTrace;
+
+ /**
+ * The trace source fired when the phy layer drops a packet as it tries
+ * to transmit it.
+ *
+ * \see class CallBackTraceSource
+ */
+ TracedCallback<Ptr<const Packet> > m_phyTxDropTrace;
+
+ /**
+ * The trace source fired when a packet begins the reception process from
+ * the medium.
+ *
+ * \see class CallBackTraceSource
+ */
+ TracedCallback<Ptr<const Packet> > m_phyRxBeginTrace;
+
+ /**
+ * The trace source fired when a packet ends the reception process from
+ * the medium.
+ *
+ * \see class CallBackTraceSource
+ */
+ TracedCallback<Ptr<const Packet> > m_phyRxEndTrace;
+
+ /**
+ * The trace source fired when the phy layer drops a packet it has received.
+ *
+ * \see class CallBackTraceSource
+ */
+ TracedCallback<Ptr<const Packet> > m_phyRxDropTrace;
};
}