diff --git a/doc/trace-source-list.h b/doc/trace-source-list.h index e69de29bb..c23d06ece 100644 --- a/doc/trace-source-list.h +++ b/doc/trace-source-list.h @@ -0,0 +1,204 @@ +/// +/// \ingroup TraceSourceList +/// \brief send ipv4 packet to outgoing interface +/// \param arg1 the trace context associated to the connected trace source. +/// \param arg2 packet sent. +/// \param arg3 index of output ipv4 interface. +/// +/// +/// The path to this trace source is: /nodes/[0-n]/ipv4/tx. +/// +/// The following classes can be extracted from \p arg1 with +/// ns3::TraceContext::GetElement: +/// - ns3::NodeListIndex +/// - ns3::Ipv4L3ProtocolTraceContextElement +void TraceSinkCallback0 (const TraceContext & arg1, const Packet & arg2, uint32_t arg3); + +/// +/// \ingroup TraceSourceList +/// \brief receive ipv4 packet from incoming interface +/// \param arg1 the trace context associated to the connected trace source. +/// \param arg2 packet received. +/// \param arg3 index of input ipv4 interface. +/// +/// +/// The path to this trace source is: /nodes/[0-n]/ipv4/rx. +/// +/// The following classes can be extracted from \p arg1 with +/// ns3::TraceContext::GetElement: +/// - ns3::NodeListIndex +/// - ns3::Ipv4L3ProtocolTraceContextElement +void TraceSinkCallback1 (const TraceContext & arg1, const Packet & arg2, uint32_t arg3); + +/// +/// \ingroup TraceSourceList +/// \brief drop ipv4 packet +/// \param arg1 the trace context associated to the connected trace source. +/// \param arg2 packet dropped. +/// +/// +/// The path to this trace source is: /nodes/[0-n]/ipv4/drop. +/// +/// The following classes can be extracted from \p arg1 with +/// ns3::TraceContext::GetElement: +/// - ns3::NodeListIndex +/// - ns3::Ipv4L3ProtocolTraceContextElement +void TraceSinkCallback2 (const TraceContext & arg1, const Packet & arg2); + +/// +/// \ingroup TraceSourceList +/// \brief store packet in queue +/// \param arg1 the trace context associated to the connected trace source. +/// \param arg2 packet queued. +/// +/// +/// The path to this trace source is: /nodes/[0-n]/devices/[0-n]/queue/enqueue. +/// +/// The following classes can be extracted from \p arg1 with +/// ns3::TraceContext::GetElement: +/// - ns3::NodeListIndex +/// - ns3::NodeNetDeviceIndex +/// - ns3::QueueTraceType +void TraceSinkCallback3 (const TraceContext & arg1, const Packet & arg2); + +/// +/// \ingroup TraceSourceList +/// \brief remove packet from queue +/// \param arg1 the trace context associated to the connected trace source. +/// \param arg2 packet dequeued. +/// +/// +/// The path to this trace source is: /nodes/[0-n]/devices/[0-n]/queue/dequeue. +/// +/// The following classes can be extracted from \p arg1 with +/// ns3::TraceContext::GetElement: +/// - ns3::NodeListIndex +/// - ns3::NodeNetDeviceIndex +/// - ns3::QueueTraceType +void TraceSinkCallback4 (const TraceContext & arg1, const Packet & arg2); + +/// +/// \ingroup TraceSourceList +/// \brief drop packet from queue +/// \param arg1 the trace context associated to the connected trace source. +/// \param arg2 packet dropped. +/// +/// +/// The path to this trace source is: /nodes/[0-n]/devices/[0-n]/queue/drop. +/// +/// The following classes can be extracted from \p arg1 with +/// ns3::TraceContext::GetElement: +/// - ns3::NodeListIndex +/// - ns3::NodeNetDeviceIndex +/// - ns3::QueueTraceType +void TraceSinkCallback5 (const TraceContext & arg1, const Packet & arg2); + +/// +/// \ingroup TraceSourceList +/// \brief receive MAC packet +/// \param arg1 the trace context associated to the connected trace source. +/// \param arg2 packet received. +/// +/// +/// The path to this trace source is: /nodes/[0-n]/devices/[0-n]/rx. +/// +/// The following classes can be extracted from \p arg1 with +/// ns3::TraceContext::GetElement: +/// - ns3::NodeListIndex +/// - ns3::NodeNetDeviceIndex +/// - ns3::PointToPointTraceType +void TraceSinkCallback6 (const TraceContext & arg1, const Packet & arg2); + +/// +/// \ingroup TraceSourceList +/// \brief receive MAC packet +/// \param arg1 the trace context associated to the connected trace source. +/// \param arg2 packet received. +/// +/// +/// The path to this trace source is: /nodes/[0-n]/devices/[0-n]/rx. +/// +/// The following classes can be extracted from \p arg1 with +/// ns3::TraceContext::GetElement: +/// - ns3::NodeListIndex +/// - ns3::NodeNetDeviceIndex +/// - ns3::CsmaTraceType +void TraceSinkCallback7 (const TraceContext & arg1, const Packet & arg2); + +/// +/// \ingroup TraceSourceList +/// \brief drop MAC packet +/// \param arg1 the trace context associated to the connected trace source. +/// \param arg2 packet dropped. +/// +/// +/// The path to this trace source is: /nodes/[0-n]/devices/[0-n]/drop. +/// +/// The following classes can be extracted from \p arg1 with +/// ns3::TraceContext::GetElement: +/// - ns3::NodeListIndex +/// - ns3::NodeNetDeviceIndex +/// - ns3::CsmaTraceType +void TraceSinkCallback8 (const TraceContext & arg1, const Packet & arg2); + +/// +/// \ingroup TraceSourceList +/// \brief The value of the speed vector changed +/// \param arg1 the trace context associated to the connected trace source. +/// \param arg2 the mobility model whose course changed. +/// +/// +/// The path to this trace source is: /nodes/[0-n]/$MobilityModelNotifier/course-change. +/// +/// The following classes can be extracted from \p arg1 with +/// ns3::TraceContext::GetElement: +/// - ns3::NodeListIndex +void TraceSinkCallback9 (const TraceContext & arg1, Ptr arg2); + +/// +/// \ingroup TraceSourceList +/// \brief send ipv4 packet to outgoing interface +/// \param arg1 the trace context associated to the connected trace source. +/// \param arg2 packet sent. +/// \param arg3 index of output ipv4 interface. +/// +/// +/// The path to this trace source is: /nodes/[0-n]/$Ipv4L3Protocol/tx. +/// +/// The following classes can be extracted from \p arg1 with +/// ns3::TraceContext::GetElement: +/// - ns3::NodeListIndex +/// - ns3::Ipv4L3ProtocolTraceContextElement +void TraceSinkCallback10 (const TraceContext & arg1, const Packet & arg2, uint32_t arg3); + +/// +/// \ingroup TraceSourceList +/// \brief receive ipv4 packet from incoming interface +/// \param arg1 the trace context associated to the connected trace source. +/// \param arg2 packet received. +/// \param arg3 index of input ipv4 interface. +/// +/// +/// The path to this trace source is: /nodes/[0-n]/$Ipv4L3Protocol/rx. +/// +/// The following classes can be extracted from \p arg1 with +/// ns3::TraceContext::GetElement: +/// - ns3::NodeListIndex +/// - ns3::Ipv4L3ProtocolTraceContextElement +void TraceSinkCallback11 (const TraceContext & arg1, const Packet & arg2, uint32_t arg3); + +/// +/// \ingroup TraceSourceList +/// \brief drop ipv4 packet +/// \param arg1 the trace context associated to the connected trace source. +/// \param arg2 packet dropped. +/// +/// +/// The path to this trace source is: /nodes/[0-n]/$Ipv4L3Protocol/drop. +/// +/// The following classes can be extracted from \p arg1 with +/// ns3::TraceContext::GetElement: +/// - ns3::NodeListIndex +/// - ns3::Ipv4L3ProtocolTraceContextElement +void TraceSinkCallback12 (const TraceContext & arg1, const Packet & arg2); + diff --git a/src/core/composite-trace-resolver.cc b/src/core/composite-trace-resolver.cc index 0f4e782b8..bb0aacabb 100644 --- a/src/core/composite-trace-resolver.cc +++ b/src/core/composite-trace-resolver.cc @@ -320,7 +320,7 @@ public: else if (m_sources == DOUBLEB) {os << "doubleB";} else if (m_sources == UINT16_T) {os << "uint16_t";} } - std::string GetName (void) {return "TraceSourceTest";} + std::string GetTypeName (void) {return "ns3::TraceSourceTest";} TraceSourceTest () : m_sources (TraceSourceTest::DOUBLEA) {} TraceSourceTest (enum Sources sources) :m_sources (sources) {} bool IsDoubleA (void) const {return m_sources == TraceSourceTest::DOUBLEA;} @@ -340,7 +340,7 @@ public: {static uint16_t uid = AllocateUid ("SubTraceSourceTest"); return uid;} void Print (std::ostream &os) {os << "subtracesource=int";} - std::string GetName (void) const {return "SubTraceSourceTest";} + std::string GetTypeName (void) const {return "ns3::SubTraceSourceTest";} SubTraceSourceTest () : m_sources (SubTraceSourceTest::INT) {} SubTraceSourceTest (enum Sources sources) : m_sources (sources) {} private: diff --git a/src/core/trace-context-element.cc b/src/core/trace-context-element.cc index 24b02fd23..dee4e97f4 100644 --- a/src/core/trace-context-element.cc +++ b/src/core/trace-context-element.cc @@ -3,11 +3,11 @@ namespace ns3 { std::string -ElementRegistry::GetName (uint16_t uid) +ElementRegistry::GetTypeName (uint16_t uid) { InfoVector *vec = GetInfoVector (); struct Info info = (*vec)[uid - 1]; - return info.getName (); + return info.getTypeName (); } uint32_t ElementRegistry::GetSize (uint16_t uid) diff --git a/src/core/trace-context-element.h b/src/core/trace-context-element.h index 4ed08c3ac..2baa7e39f 100644 --- a/src/core/trace-context-element.h +++ b/src/core/trace-context-element.h @@ -48,7 +48,7 @@ namespace ns3 { * MyContext (); * ~MyContext (); * void Print (std::ostream &os) const; - * std::string GetName (void) const; + * std::string GetTypeName (void) const; * * // the user-specific API to manipulate the context. * void SetData (uint8_t data); @@ -73,8 +73,9 @@ namespace ns3 { * os << "mycontext=" << (uint32_t) m_myContextData; * } * std::string - * MyContext::GetName (void) const + * MyContext::GetTypeName (void) const * { + * // return a fully-qualified c++ type name * return "MyContext"; * } * void @@ -121,23 +122,23 @@ public: static uint32_t GetSize (uint16_t uid); static void Print (uint16_t uid, uint8_t *instance, std::ostream &os); - static std::string GetName (uint16_t uid); + static std::string GetTypeName (uint16_t uid); static void Destroy (uint16_t uid, uint8_t *instance); private: - typedef std::string (*GetNameCb) (void); + typedef std::string (*GetTypeNameCb) (void); typedef void (*PrintCb) (uint8_t *instance, std::ostream &os); typedef void (*DestroyCb) (uint8_t *instance); struct Info { uint32_t size; std::string uidString; - GetNameCb getName; + GetTypeNameCb getTypeName; PrintCb print; DestroyCb destroy; }; typedef std::vector InfoVector; static InfoVector *GetInfoVector (void); template - static std::string DoGetName (void); + static std::string DoGetTypeName (void); template static void DoPrint (uint8_t *instance, std::ostream &os); template @@ -155,10 +156,10 @@ ElementRegistry::DoPrint (uint8_t *instance, std::ostream &os) } template std::string -ElementRegistry::DoGetName (void) +ElementRegistry::DoGetTypeName (void) { static T obj; - return obj.GetName (); + return obj.GetTypeName (); } template void @@ -187,7 +188,7 @@ ElementRegistry::AllocateUid (std::string name) struct Info info; info.size = sizeof (T); info.uidString = name; - info.getName = &ElementRegistry::DoGetName; + info.getTypeName = &ElementRegistry::DoGetTypeName; info.print = &ElementRegistry::DoPrint; info.destroy = &ElementRegistry::DoDestroy; vec->push_back (info); diff --git a/src/core/trace-context.cc b/src/core/trace-context.cc index 4c77d741f..af3ac2cfa 100644 --- a/src/core/trace-context.cc +++ b/src/core/trace-context.cc @@ -66,7 +66,7 @@ TraceContext::Iterator::Next (void) std::string TraceContext::Iterator::Get (void) const { - std::string name = ElementRegistry::GetName (m_uid); + std::string name = ElementRegistry::GetTypeName (m_uid); return name; } @@ -298,7 +298,7 @@ TraceContext::PrintAvailable (std::ostream &os, std::string separator) const do { currentUid = m_data->data[i]; uint8_t size = ElementRegistry::GetSize (currentUid); - os << ElementRegistry::GetName (currentUid); + os << ElementRegistry::GetTypeName (currentUid); i += 1 + size; if (i < m_data->size && currentUid != 0) { @@ -371,8 +371,8 @@ template class Ctx : public TraceContextElement { public: - static uint16_t GetUid (void) {static uint16_t uid = AllocateUid > (GetName ()); return uid;} - static std::string GetName (void) {std::ostringstream oss; oss << "Ctx" << N; return oss.str ();} + static uint16_t GetUid (void) {static uint16_t uid = AllocateUid > (GetTypeName ()); return uid;} + static std::string GetTypeName (void) {std::ostringstream oss; oss << "Ctx" << N; return oss.str ();} Ctx () : m_v (0) {} Ctx (int v) : m_v (v) {} void Print (std::ostream &os) {os << N;} diff --git a/src/devices/csma/csma-net-device.cc b/src/devices/csma/csma-net-device.cc index 413478ad3..a66c43018 100644 --- a/src/devices/csma/csma-net-device.cc +++ b/src/devices/csma/csma-net-device.cc @@ -60,9 +60,9 @@ CsmaTraceType::GetUid (void) return uid; } std::string -CsmaTraceType::GetName (void) const +CsmaTraceType::GetTypeName (void) const { - return "CsmaTraceType"; + return "ns3::CsmaTraceType"; } diff --git a/src/devices/csma/csma-net-device.h b/src/devices/csma/csma-net-device.h index db850914e..45d384a0a 100644 --- a/src/devices/csma/csma-net-device.h +++ b/src/devices/csma/csma-net-device.h @@ -52,7 +52,7 @@ public: CsmaTraceType (); void Print (std::ostream &os) const; static uint16_t GetUid (void); - std::string GetName (void) const; + std::string GetTypeName (void) const; private: enum Type m_type; }; diff --git a/src/devices/point-to-point/point-to-point-net-device.cc b/src/devices/point-to-point/point-to-point-net-device.cc index cee375b53..71853b84c 100644 --- a/src/devices/point-to-point/point-to-point-net-device.cc +++ b/src/devices/point-to-point/point-to-point-net-device.cc @@ -54,9 +54,9 @@ PointToPointTraceType::GetUid (void) return uid; } std::string -PointToPointTraceType::GetName (void) const +PointToPointTraceType::GetTypeName (void) const { - return "PointToPointTraceType"; + return "ns3::PointToPointTraceType"; } diff --git a/src/devices/point-to-point/point-to-point-net-device.h b/src/devices/point-to-point/point-to-point-net-device.h index 88544b7ed..88357136b 100644 --- a/src/devices/point-to-point/point-to-point-net-device.h +++ b/src/devices/point-to-point/point-to-point-net-device.h @@ -44,7 +44,7 @@ public: PointToPointTraceType (); void Print (std::ostream &os) const; static uint16_t GetUid (void); - std::string GetName (void) const; + std::string GetTypeName (void) const; }; /** diff --git a/src/internet-node/ipv4-l3-protocol.cc b/src/internet-node/ipv4-l3-protocol.cc index 1409cad50..05200f6c2 100644 --- a/src/internet-node/ipv4-l3-protocol.cc +++ b/src/internet-node/ipv4-l3-protocol.cc @@ -88,9 +88,9 @@ Ipv4L3ProtocolTraceContextElement::GetUid (void) return uid; } std::string -Ipv4L3ProtocolTraceContextElement::GetName (void) const +Ipv4L3ProtocolTraceContextElement::GetTypeName (void) const { - return "Ipv4L3ProtocolTraceContextElement"; + return "ns3::Ipv4L3ProtocolTraceContextElement"; } @@ -117,9 +117,9 @@ Ipv4L3ProtocolInterfaceIndex::GetUid (void) return uid; } std::string -Ipv4L3ProtocolInterfaceIndex::GetName (void) const +Ipv4L3ProtocolInterfaceIndex::GetTypeName (void) const { - return "Ipv4L3ProtocolInterfaceIndex"; + return "ns3::Ipv4L3ProtocolInterfaceIndex"; } diff --git a/src/internet-node/ipv4-l3-protocol.h b/src/internet-node/ipv4-l3-protocol.h index f5e8aef04..0383e8d9a 100644 --- a/src/internet-node/ipv4-l3-protocol.h +++ b/src/internet-node/ipv4-l3-protocol.h @@ -59,7 +59,7 @@ public: bool IsDrop (void) const; void Print (std::ostream &os) const; static uint16_t GetUid (void); - std::string GetName (void) const; + std::string GetTypeName (void) const; private: enum Type m_type; }; @@ -72,7 +72,7 @@ public: uint32_t Get (void) const; void Print (std::ostream &os) const; static uint16_t GetUid (void); - std::string GetName (void) const; + std::string GetTypeName (void) const; private: uint32_t m_index; }; diff --git a/src/internet-node/ipv4-l4-demux.cc b/src/internet-node/ipv4-l4-demux.cc index a4d83d49b..122d32ab8 100644 --- a/src/internet-node/ipv4-l4-demux.cc +++ b/src/internet-node/ipv4-l4-demux.cc @@ -55,9 +55,9 @@ Ipv4L4ProtocolTraceContextElement::GetUid (void) return uid; } std::string -Ipv4L4ProtocolTraceContextElement::GetName (void) const +Ipv4L4ProtocolTraceContextElement::GetTypeName (void) const { - return "Ipv4L4ProtocolTraceContextElement"; + return "ns3::Ipv4L4ProtocolTraceContextElement"; } diff --git a/src/internet-node/ipv4-l4-demux.h b/src/internet-node/ipv4-l4-demux.h index 40641485b..11ada2ca6 100644 --- a/src/internet-node/ipv4-l4-demux.h +++ b/src/internet-node/ipv4-l4-demux.h @@ -45,7 +45,7 @@ public: int Get (void) const; void Print (std::ostream &os) const; static uint16_t GetUid (void); - std::string GetName (void) const; + std::string GetTypeName (void) const; private: int m_protocolNumber; }; diff --git a/src/node/node-list.cc b/src/node/node-list.cc index 9c3b27ce7..3a68bf584 100644 --- a/src/node/node-list.cc +++ b/src/node/node-list.cc @@ -51,9 +51,9 @@ NodeListIndex::Get (void) const return m_index; } std::string -NodeListIndex::GetName (void) const +NodeListIndex::GetTypeName (void) const { - return "NodeListIndex"; + return "ns3::NodeListIndex"; } diff --git a/src/node/node-list.h b/src/node/node-list.h index d256953c1..d423d82fc 100644 --- a/src/node/node-list.h +++ b/src/node/node-list.h @@ -40,7 +40,7 @@ public: void Print (std::ostream &os); static uint16_t GetUid (void); uint32_t Get (void) const; - std::string GetName (void) const; + std::string GetTypeName (void) const; private: uint32_t m_index; }; diff --git a/src/node/node.cc b/src/node/node.cc index ed56ca8d8..171af4e2d 100644 --- a/src/node/node.cc +++ b/src/node/node.cc @@ -53,9 +53,9 @@ NodeNetDeviceIndex::GetUid (void) return uid; } std::string -NodeNetDeviceIndex::GetName (void) const +NodeNetDeviceIndex::GetTypeName (void) const { - return "NodeNetDeviceIndex"; + return "ns3::NodeNetDeviceIndex"; } diff --git a/src/node/node.h b/src/node/node.h index 4f1c5be86..07739ec81 100644 --- a/src/node/node.h +++ b/src/node/node.h @@ -44,7 +44,7 @@ public: NodeNetDeviceIndex (uint32_t index); uint32_t Get (void) const; void Print (std::ostream &os) const; - std::string GetName (void) const; + std::string GetTypeName (void) const; static uint16_t GetUid (void); private: uint32_t m_index; diff --git a/src/node/queue.cc b/src/node/queue.cc index 2ebc6c0d1..8ed033b66 100644 --- a/src/node/queue.cc +++ b/src/node/queue.cc @@ -33,9 +33,9 @@ static ClassIdDefaultValue g_classIdDefaultValue ("Queue", "Packet Queue", std::string -QueueTraceType::GetName (void) const +QueueTraceType::GetTypeName (void) const { - return "QueueTraceType"; + return "ns3::QueueTraceType"; } uint16_t QueueTraceType::GetUid (void) diff --git a/src/node/queue.h b/src/node/queue.h index 7b54f6e72..bfe0d009e 100644 --- a/src/node/queue.h +++ b/src/node/queue.h @@ -52,7 +52,7 @@ public: bool IsDequeue (void) const; bool IsDrop (void) const; void Print (std::ostream &os) const; - std::string GetName (void) const; + std::string GetTypeName (void) const; private: enum Type m_type; };