--- a/src/helper/csma-helper.h Fri Apr 16 07:52:54 2010 +0200 +++ a/src/helper/csma-helper.h Fri Apr 16 08:38:16 2010 +0200 @@ -43,7 +43,7 @@ * encapsulates a general attribute or a set of functionality that * may be of interest to many other classes. */ -class CsmaHelper : public PcapHelperForDevice, public AsciiTraceHelperForDevice +class CsmaHelper : public TraceHelperForDevice { public: /** --- a/src/helper/emu-helper.h Fri Apr 16 07:52:54 2010 +0200 +++ a/src/helper/emu-helper.h Fri Apr 16 08:38:16 2010 +0200 @@ -43,7 +43,7 @@ * encapsulates a general attribute or a set of functionality that * may be of interest to many other classes. */ - class EmuHelper : public PcapHelperForDevice, public AsciiTraceHelperForDevice +class EmuHelper : public TraceHelperForDevice { public: /* --- a/src/helper/internet-stack-helper.h Fri Apr 16 07:52:54 2010 +0200 +++ a/src/helper/internet-stack-helper.h Fri Apr 16 08:38:16 2010 +0200 @@ -45,15 +45,8 @@ * there is no device. This means that the creation of output file names will * change, and also the user-visible methods will not reference devices and * therefore the number of trace enable methods is reduced. - * - * Normally we eschew multiple inheritance, however, the classes - * PcapUserHelperForIpv4 and AsciiTraceUserHelperForIpv4 are - * treated as "mixins". A mixin is a self-contained class that - * encapsulates a general attribute or a set of functionality that - * may be of interest to many other classes. */ -class InternetStackHelper : public PcapHelperForIpv4, public PcapHelperForIpv6, - public AsciiTraceHelperForIpv4, public AsciiTraceHelperForIpv6 +class InternetStackHelper : public TraceHelperForIpvx { public: /** --- a/src/helper/point-to-point-helper.h Fri Apr 16 07:52:54 2010 +0200 +++ a/src/helper/point-to-point-helper.h Fri Apr 16 08:38:16 2010 +0200 @@ -42,7 +42,7 @@ * PcapUserHelperForDevice and AsciiTraceUserHelperForDevice are * "mixins". */ -class PointToPointHelper : public PcapHelperForDevice, public AsciiTraceHelperForDevice +class PointToPointHelper : public TraceHelperForDevice { public: /** --- a/src/helper/trace-helper.cc Fri Apr 16 07:52:54 2010 +0200 +++ a/src/helper/trace-helper.cc Fri Apr 16 08:38:16 2010 +0200 @@ -398,20 +398,20 @@ } void -PcapHelperForDevice::EnablePcap (std::string prefix, Ptr nd, bool promiscuous, bool explicitFilename) +TraceHelperForDevice::EnablePcap (std::string prefix, Ptr nd, bool promiscuous, bool explicitFilename) { EnablePcapInternal (prefix, nd, promiscuous, explicitFilename); } void -PcapHelperForDevice::EnablePcap (std::string prefix, std::string ndName, bool promiscuous, bool explicitFilename) +TraceHelperForDevice::EnablePcap (std::string prefix, std::string ndName, bool promiscuous, bool explicitFilename) { Ptr nd = Names::Find (ndName); EnablePcap (prefix, nd, promiscuous, explicitFilename); } void -PcapHelperForDevice::EnablePcap (std::string prefix, NetDeviceContainer d, bool promiscuous) +TraceHelperForDevice::EnablePcap (std::string prefix, NetDeviceContainer d, bool promiscuous) { for (NetDeviceContainer::Iterator i = d.Begin (); i != d.End (); ++i) { @@ -421,7 +421,7 @@ } void -PcapHelperForDevice::EnablePcap (std::string prefix, NodeContainer n, bool promiscuous) +TraceHelperForDevice::EnablePcap (std::string prefix, NodeContainer n, bool promiscuous) { NetDeviceContainer devs; for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i) @@ -436,13 +436,13 @@ } void -PcapHelperForDevice::EnablePcapAll (std::string prefix, bool promiscuous) +TraceHelperForDevice::EnablePcapAll (std::string prefix, bool promiscuous) { EnablePcap (prefix, NodeContainer::GetGlobal (), promiscuous); } void -PcapHelperForDevice::EnablePcap (std::string prefix, uint32_t nodeid, uint32_t deviceid, bool promiscuous) +TraceHelperForDevice::EnablePcap (std::string prefix, uint32_t nodeid, uint32_t deviceid, bool promiscuous) { NodeContainer n = NodeContainer::GetGlobal (); @@ -454,7 +454,7 @@ continue; } - NS_ABORT_MSG_IF (deviceid >= node->GetNDevices (), "PcapHelperForDevice::EnablePcap(): Unknown deviceid = " + NS_ABORT_MSG_IF (deviceid >= node->GetNDevices (), "TraceHelperForDevice::EnablePcap(): Unknown deviceid = " << deviceid); Ptr nd = node->GetDevice (deviceid); EnablePcap (prefix, nd, promiscuous); @@ -466,7 +466,7 @@ // Public API // void -AsciiTraceHelperForDevice::EnableAscii (std::string prefix, Ptr nd, bool explicitFilename) +TraceHelperForDevice::EnableAscii (std::string prefix, Ptr nd, bool explicitFilename) { EnableAsciiInternal (Ptr (), prefix, nd, explicitFilename); } @@ -475,7 +475,7 @@ // Public API // void -AsciiTraceHelperForDevice::EnableAscii (Ptr stream, Ptr nd) +TraceHelperForDevice::EnableAscii (Ptr stream, Ptr nd) { EnableAsciiInternal (stream, std::string (), nd, false); } @@ -484,7 +484,7 @@ // Public API // void -AsciiTraceHelperForDevice::EnableAscii (std::string prefix, std::string ndName, bool explicitFilename) +TraceHelperForDevice::EnableAscii (std::string prefix, std::string ndName, bool explicitFilename) { EnableAsciiImpl (Ptr (), prefix, ndName, explicitFilename); } @@ -493,7 +493,7 @@ // Public API // void -AsciiTraceHelperForDevice::EnableAscii (Ptr stream, std::string ndName) +TraceHelperForDevice::EnableAscii (Ptr stream, std::string ndName) { EnableAsciiImpl (stream, std::string (), ndName, false); } @@ -502,7 +502,7 @@ // Private API // void -AsciiTraceHelperForDevice::EnableAsciiImpl ( +TraceHelperForDevice::EnableAsciiImpl ( Ptr stream, std::string prefix, std::string ndName, @@ -516,7 +516,7 @@ // Public API // void -AsciiTraceHelperForDevice::EnableAscii (std::string prefix, NetDeviceContainer d) +TraceHelperForDevice::EnableAscii (std::string prefix, NetDeviceContainer d) { EnableAsciiImpl (Ptr (), prefix, d); } @@ -525,7 +525,7 @@ // Public API // void -AsciiTraceHelperForDevice::EnableAscii (Ptr stream, NetDeviceContainer d) +TraceHelperForDevice::EnableAscii (Ptr stream, NetDeviceContainer d) { EnableAsciiImpl (stream, std::string (), d); } @@ -534,7 +534,7 @@ // Private API // void -AsciiTraceHelperForDevice::EnableAsciiImpl (Ptr stream, std::string prefix, NetDeviceContainer d) +TraceHelperForDevice::EnableAsciiImpl (Ptr stream, std::string prefix, NetDeviceContainer d) { for (NetDeviceContainer::Iterator i = d.Begin (); i != d.End (); ++i) { @@ -547,7 +547,7 @@ // Public API // void -AsciiTraceHelperForDevice::EnableAscii (std::string prefix, NodeContainer n) +TraceHelperForDevice::EnableAscii (std::string prefix, NodeContainer n) { EnableAsciiImpl (Ptr (), prefix, n); } @@ -556,7 +556,7 @@ // Public API // void -AsciiTraceHelperForDevice::EnableAscii (Ptr stream, NodeContainer n) +TraceHelperForDevice::EnableAscii (Ptr stream, NodeContainer n) { EnableAsciiImpl (stream, std::string (), n); } @@ -565,7 +565,7 @@ // Private API // void -AsciiTraceHelperForDevice::EnableAsciiImpl (Ptr stream, std::string prefix, NodeContainer n) +TraceHelperForDevice::EnableAsciiImpl (Ptr stream, std::string prefix, NodeContainer n) { NetDeviceContainer devs; for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i) @@ -583,7 +583,7 @@ // Public API // void -AsciiTraceHelperForDevice::EnableAsciiAll (std::string prefix) +TraceHelperForDevice::EnableAsciiAll (std::string prefix) { EnableAsciiImpl (Ptr (), prefix, NodeContainer::GetGlobal ()); } @@ -592,7 +592,7 @@ // Public API // void -AsciiTraceHelperForDevice::EnableAsciiAll (Ptr stream) +TraceHelperForDevice::EnableAsciiAll (Ptr stream) { EnableAsciiImpl (stream, std::string (), NodeContainer::GetGlobal ()); } @@ -601,7 +601,7 @@ // Public API // void -AsciiTraceHelperForDevice::EnableAscii (Ptr stream, uint32_t nodeid, uint32_t deviceid) +TraceHelperForDevice::EnableAscii (Ptr stream, uint32_t nodeid, uint32_t deviceid) { EnableAsciiImpl (stream, std::string (), nodeid, deviceid, false); } @@ -610,7 +610,7 @@ // Public API // void -AsciiTraceHelperForDevice::EnableAscii ( +TraceHelperForDevice::EnableAscii ( std::string prefix, uint32_t nodeid, uint32_t deviceid, @@ -623,7 +623,7 @@ // Private API // void -AsciiTraceHelperForDevice::EnableAsciiImpl ( +TraceHelperForDevice::EnableAsciiImpl ( Ptr stream, std::string prefix, uint32_t nodeid, @@ -641,7 +641,7 @@ } NS_ABORT_MSG_IF (deviceid >= node->GetNDevices (), - "AsciiTraceHelperForDevice::EnableAscii(): Unknown deviceid = " << deviceid); + "TraceHelperForDevice::EnableAscii(): Unknown deviceid = " << deviceid); Ptr nd = node->GetDevice (deviceid); @@ -651,20 +651,20 @@ } void -PcapHelperForIpv4::EnablePcapIpv4 (std::string prefix, Ptr ipv4, uint32_t interface, bool explicitFilename) +TraceHelperForIpvx::EnablePcapIpv4 (std::string prefix, Ptr ipv4, uint32_t interface, bool explicitFilename) { EnablePcapIpv4Internal (prefix, ipv4, interface, explicitFilename); } void -PcapHelperForIpv4::EnablePcapIpv4 (std::string prefix, std::string ipv4Name, uint32_t interface, bool explicitFilename) +TraceHelperForIpvx::EnablePcapIpv4 (std::string prefix, std::string ipv4Name, uint32_t interface, bool explicitFilename) { Ptr ipv4 = Names::Find (ipv4Name); EnablePcapIpv4 (prefix, ipv4, interface, explicitFilename); } void -PcapHelperForIpv4::EnablePcapIpv4 (std::string prefix, Ipv4InterfaceContainer c) +TraceHelperForIpvx::EnablePcapIpv4 (std::string prefix, Ipv4InterfaceContainer c) { for (Ipv4InterfaceContainer::Iterator i = c.Begin (); i != c.End (); ++i) { @@ -674,7 +674,7 @@ } void -PcapHelperForIpv4::EnablePcapIpv4 (std::string prefix, NodeContainer n) +TraceHelperForIpvx::EnablePcapIpv4 (std::string prefix, NodeContainer n) { for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i) { @@ -691,13 +691,13 @@ } void -PcapHelperForIpv4::EnablePcapIpv4All (std::string prefix) +TraceHelperForIpvx::EnablePcapIpv4All (std::string prefix) { EnablePcapIpv4 (prefix, NodeContainer::GetGlobal ()); } void -PcapHelperForIpv4::EnablePcapIpv4 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename) +TraceHelperForIpvx::EnablePcapIpv4 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename) { NodeContainer n = NodeContainer::GetGlobal (); @@ -722,7 +722,7 @@ // Public API // void -AsciiTraceHelperForIpv4::EnableAsciiIpv4 (std::string prefix, Ptr ipv4, uint32_t interface, bool explicitFilename) +TraceHelperForIpvx::EnableAsciiIpv4 (std::string prefix, Ptr ipv4, uint32_t interface, bool explicitFilename) { EnableAsciiIpv4Internal (Ptr (), prefix, ipv4, interface, explicitFilename); } @@ -731,7 +731,7 @@ // Public API // void -AsciiTraceHelperForIpv4::EnableAsciiIpv4 (Ptr stream, Ptr ipv4, uint32_t interface) +TraceHelperForIpvx::EnableAsciiIpv4 (Ptr stream, Ptr ipv4, uint32_t interface) { EnableAsciiIpv4Internal (stream, std::string (), ipv4, interface, false); } @@ -740,7 +740,7 @@ // Public API // void -AsciiTraceHelperForIpv4::EnableAsciiIpv4 ( +TraceHelperForIpvx::EnableAsciiIpv4 ( std::string prefix, std::string ipv4Name, uint32_t interface, @@ -753,7 +753,7 @@ // Public API // void -AsciiTraceHelperForIpv4::EnableAsciiIpv4 (Ptr stream, std::string ipv4Name, uint32_t interface) +TraceHelperForIpvx::EnableAsciiIpv4 (Ptr stream, std::string ipv4Name, uint32_t interface) { EnableAsciiIpv4Impl (stream, std::string (), ipv4Name, interface, false); } @@ -762,7 +762,7 @@ // Private API // void -AsciiTraceHelperForIpv4::EnableAsciiIpv4Impl ( +TraceHelperForIpvx::EnableAsciiIpv4Impl ( Ptr stream, std::string prefix, std::string ipv4Name, @@ -777,7 +777,7 @@ // Public API // void -AsciiTraceHelperForIpv4::EnableAsciiIpv4 (std::string prefix, Ipv4InterfaceContainer c) +TraceHelperForIpvx::EnableAsciiIpv4 (std::string prefix, Ipv4InterfaceContainer c) { EnableAsciiIpv4Impl (Ptr (), prefix, c); } @@ -786,7 +786,7 @@ // Public API // void -AsciiTraceHelperForIpv4::EnableAsciiIpv4 (Ptr stream, Ipv4InterfaceContainer c) +TraceHelperForIpvx::EnableAsciiIpv4 (Ptr stream, Ipv4InterfaceContainer c) { EnableAsciiIpv4Impl (stream, std::string (), c); } @@ -795,7 +795,7 @@ // Private API // void -AsciiTraceHelperForIpv4::EnableAsciiIpv4Impl (Ptr stream, std::string prefix, Ipv4InterfaceContainer c) +TraceHelperForIpvx::EnableAsciiIpv4Impl (Ptr stream, std::string prefix, Ipv4InterfaceContainer c) { for (Ipv4InterfaceContainer::Iterator i = c.Begin (); i != c.End (); ++i) { @@ -808,7 +808,7 @@ // Public API // void -AsciiTraceHelperForIpv4::EnableAsciiIpv4 (std::string prefix, NodeContainer n) +TraceHelperForIpvx::EnableAsciiIpv4 (std::string prefix, NodeContainer n) { EnableAsciiIpv4Impl (Ptr (), prefix, n); } @@ -817,7 +817,7 @@ // Public API // void -AsciiTraceHelperForIpv4::EnableAsciiIpv4 (Ptr stream, NodeContainer n) +TraceHelperForIpvx::EnableAsciiIpv4 (Ptr stream, NodeContainer n) { EnableAsciiIpv4Impl (stream, std::string (), n); } @@ -826,7 +826,7 @@ // Private API // void -AsciiTraceHelperForIpv4::EnableAsciiIpv4Impl (Ptr stream, std::string prefix, NodeContainer n) +TraceHelperForIpvx::EnableAsciiIpv4Impl (Ptr stream, std::string prefix, NodeContainer n) { for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i) { @@ -846,7 +846,7 @@ // Public API // void -AsciiTraceHelperForIpv4::EnableAsciiIpv4All (std::string prefix) +TraceHelperForIpvx::EnableAsciiIpv4All (std::string prefix) { EnableAsciiIpv4Impl (Ptr (), prefix, NodeContainer::GetGlobal ()); } @@ -855,7 +855,7 @@ // Public API // void -AsciiTraceHelperForIpv4::EnableAsciiIpv4All (Ptr stream) +TraceHelperForIpvx::EnableAsciiIpv4All (Ptr stream) { EnableAsciiIpv4Impl (stream, std::string (), NodeContainer::GetGlobal ()); } @@ -864,7 +864,7 @@ // Public API // void -AsciiTraceHelperForIpv4::EnableAsciiIpv4 ( +TraceHelperForIpvx::EnableAsciiIpv4 ( Ptr stream, uint32_t nodeid, uint32_t interface, @@ -877,7 +877,7 @@ // Public API // void -AsciiTraceHelperForIpv4::EnableAsciiIpv4 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename) +TraceHelperForIpvx::EnableAsciiIpv4 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename) { EnableAsciiIpv4Impl (Ptr (), prefix, nodeid, interface, explicitFilename); } @@ -886,7 +886,7 @@ // Private API // void -AsciiTraceHelperForIpv4::EnableAsciiIpv4Impl ( +TraceHelperForIpvx::EnableAsciiIpv4Impl ( Ptr stream, std::string prefix, uint32_t nodeid, @@ -914,20 +914,20 @@ } void -PcapHelperForIpv6::EnablePcapIpv6 (std::string prefix, Ptr ipv6, uint32_t interface, bool explicitFilename) +TraceHelperForIpvx::EnablePcapIpv6 (std::string prefix, Ptr ipv6, uint32_t interface, bool explicitFilename) { EnablePcapIpv6Internal (prefix, ipv6, interface, explicitFilename); } void -PcapHelperForIpv6::EnablePcapIpv6 (std::string prefix, std::string ipv6Name, uint32_t interface, bool explicitFilename) +TraceHelperForIpvx::EnablePcapIpv6 (std::string prefix, std::string ipv6Name, uint32_t interface, bool explicitFilename) { Ptr ipv6 = Names::Find (ipv6Name); EnablePcapIpv6 (prefix, ipv6, interface, explicitFilename); } void -PcapHelperForIpv6::EnablePcapIpv6 (std::string prefix, Ipv6InterfaceContainer c) +TraceHelperForIpvx::EnablePcapIpv6 (std::string prefix, Ipv6InterfaceContainer c) { for (Ipv6InterfaceContainer::Iterator i = c.Begin (); i != c.End (); ++i) { @@ -937,7 +937,7 @@ } void -PcapHelperForIpv6::EnablePcapIpv6 (std::string prefix, NodeContainer n) +TraceHelperForIpvx::EnablePcapIpv6 (std::string prefix, NodeContainer n) { for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i) { @@ -954,13 +954,13 @@ } void -PcapHelperForIpv6::EnablePcapIpv6All (std::string prefix) +TraceHelperForIpvx::EnablePcapIpv6All (std::string prefix) { EnablePcapIpv6 (prefix, NodeContainer::GetGlobal ()); } void -PcapHelperForIpv6::EnablePcapIpv6 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename) +TraceHelperForIpvx::EnablePcapIpv6 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename) { NodeContainer n = NodeContainer::GetGlobal (); @@ -985,7 +985,7 @@ // Public API // void -AsciiTraceHelperForIpv6::EnableAsciiIpv6 (std::string prefix, Ptr ipv6, uint32_t interface, bool explicitFilename) +TraceHelperForIpvx::EnableAsciiIpv6 (std::string prefix, Ptr ipv6, uint32_t interface, bool explicitFilename) { EnableAsciiIpv6Internal (Ptr (), prefix, ipv6, interface, explicitFilename); } @@ -994,7 +994,7 @@ // Public API // void -AsciiTraceHelperForIpv6::EnableAsciiIpv6 (Ptr stream, Ptr ipv6, uint32_t interface) +TraceHelperForIpvx::EnableAsciiIpv6 (Ptr stream, Ptr ipv6, uint32_t interface) { EnableAsciiIpv6Internal (stream, std::string (), ipv6, interface, false); } @@ -1003,7 +1003,7 @@ // Public API // void -AsciiTraceHelperForIpv6::EnableAsciiIpv6 (std::string prefix, std::string ipv6Name, uint32_t interface, bool explicitFilename) +TraceHelperForIpvx::EnableAsciiIpv6 (std::string prefix, std::string ipv6Name, uint32_t interface, bool explicitFilename) { EnableAsciiIpv6Impl (Ptr (), prefix, ipv6Name, interface, explicitFilename); } @@ -1012,7 +1012,7 @@ // Public API // void -AsciiTraceHelperForIpv6::EnableAsciiIpv6 (Ptr stream, std::string ipv6Name, uint32_t interface) +TraceHelperForIpvx::EnableAsciiIpv6 (Ptr stream, std::string ipv6Name, uint32_t interface) { EnableAsciiIpv6Impl (stream, std::string (), ipv6Name, interface, false); } @@ -1021,7 +1021,7 @@ // Private API // void -AsciiTraceHelperForIpv6::EnableAsciiIpv6Impl ( +TraceHelperForIpvx::EnableAsciiIpv6Impl ( Ptr stream, std::string prefix, std::string ipv6Name, @@ -1036,7 +1036,7 @@ // Public API // void -AsciiTraceHelperForIpv6::EnableAsciiIpv6 (std::string prefix, Ipv6InterfaceContainer c) +TraceHelperForIpvx::EnableAsciiIpv6 (std::string prefix, Ipv6InterfaceContainer c) { EnableAsciiIpv6Impl (Ptr (), prefix, c); } @@ -1045,7 +1045,7 @@ // Public API // void -AsciiTraceHelperForIpv6::EnableAsciiIpv6 (Ptr stream, Ipv6InterfaceContainer c) +TraceHelperForIpvx::EnableAsciiIpv6 (Ptr stream, Ipv6InterfaceContainer c) { EnableAsciiIpv6Impl (stream, std::string (), c); } @@ -1054,7 +1054,7 @@ // Private API // void -AsciiTraceHelperForIpv6::EnableAsciiIpv6Impl (Ptr stream, std::string prefix, Ipv6InterfaceContainer c) +TraceHelperForIpvx::EnableAsciiIpv6Impl (Ptr stream, std::string prefix, Ipv6InterfaceContainer c) { for (Ipv6InterfaceContainer::Iterator i = c.Begin (); i != c.End (); ++i) { @@ -1067,7 +1067,7 @@ // Public API // void -AsciiTraceHelperForIpv6::EnableAsciiIpv6 (std::string prefix, NodeContainer n) +TraceHelperForIpvx::EnableAsciiIpv6 (std::string prefix, NodeContainer n) { EnableAsciiIpv6Impl (Ptr (), prefix, n); } @@ -1076,7 +1076,7 @@ // Public API // void -AsciiTraceHelperForIpv6::EnableAsciiIpv6 (Ptr stream, NodeContainer n) +TraceHelperForIpvx::EnableAsciiIpv6 (Ptr stream, NodeContainer n) { EnableAsciiIpv6Impl (stream, std::string (), n); } @@ -1085,7 +1085,7 @@ // Private API // void -AsciiTraceHelperForIpv6::EnableAsciiIpv6Impl (Ptr stream, std::string prefix, NodeContainer n) +TraceHelperForIpvx::EnableAsciiIpv6Impl (Ptr stream, std::string prefix, NodeContainer n) { for (NodeContainer::Iterator i = n.Begin (); i != n.End (); ++i) { @@ -1105,7 +1105,7 @@ // Public API // void -AsciiTraceHelperForIpv6::EnableAsciiIpv6All (std::string prefix) +TraceHelperForIpvx::EnableAsciiIpv6All (std::string prefix) { EnableAsciiIpv6Impl (Ptr (), prefix, NodeContainer::GetGlobal ()); } @@ -1114,7 +1114,7 @@ // Public API // void -AsciiTraceHelperForIpv6::EnableAsciiIpv6All (Ptr stream) +TraceHelperForIpvx::EnableAsciiIpv6All (Ptr stream) { EnableAsciiIpv6Impl (stream, std::string (), NodeContainer::GetGlobal ()); } @@ -1123,7 +1123,7 @@ // Public API // void -AsciiTraceHelperForIpv6::EnableAsciiIpv6 (Ptr stream, uint32_t nodeid, uint32_t interface) +TraceHelperForIpvx::EnableAsciiIpv6 (Ptr stream, uint32_t nodeid, uint32_t interface) { EnableAsciiIpv6Impl (stream, std::string (), nodeid, interface, false); } @@ -1132,7 +1132,7 @@ // Public API // void -AsciiTraceHelperForIpv6::EnableAsciiIpv6 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename) +TraceHelperForIpvx::EnableAsciiIpv6 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename) { EnableAsciiIpv6Impl (Ptr (), prefix, nodeid, interface, explicitFilename); } @@ -1141,7 +1141,7 @@ // Private API // void -AsciiTraceHelperForIpv6::EnableAsciiIpv6Impl ( +TraceHelperForIpvx::EnableAsciiIpv6Impl ( Ptr stream, std::string prefix, uint32_t nodeid, --- a/src/helper/trace-helper.h Fri Apr 16 07:52:54 2010 +0200 +++ a/src/helper/trace-helper.h Fri Apr 16 08:38:16 2010 +0200 @@ -321,21 +321,21 @@ } /** - * \brief Base class providing common user-level pcap operations for helpers + * \brief Base class providing common user-level pcap and ascii operations for helpers * representing net devices. */ -class PcapHelperForDevice +class TraceHelperForDevice { public: /** * @brief Construct a PcapHelperForDevice */ - PcapHelperForDevice () {} + TraceHelperForDevice () {} /** * @brief Destroy a PcapHelperForDevice */ - virtual ~PcapHelperForDevice () {} + virtual ~TraceHelperForDevice () {} /** * @brief Enable pcap output the indicated net device. @@ -408,24 +408,6 @@ * @param promiscuous If true capture all possible packets available at the device. */ void EnablePcapAll (std::string prefix, bool promiscuous = false); -}; - -/** - * \brief Base class providing common user-level ascii trace operations for helpers - * representing net devices. - */ -class AsciiTraceHelperForDevice -{ -public: - /** - * @brief Construct an AsciiTraceHelperForDevice. - */ - AsciiTraceHelperForDevice () {} - - /** - * @brief Destroy an AsciiTraceHelperForDevice. - */ - virtual ~AsciiTraceHelperForDevice () {} /** * @brief Enable ascii trace output on the indicated net device. @@ -604,24 +586,25 @@ * @internal Avoid code duplication. */ void EnableAsciiImpl (Ptr stream, std::string prefix, Ptr nd, bool explicitFilename); + }; /** - * @brief Base class providing common user-level pcap operations for helpers - * representing IPv4 protocols . + * @brief Base class providing common user-level pcap and ascii operations for helpers + * representing IPv4 and IPv6 protocols . */ -class PcapHelperForIpv4 +class TraceHelperForIpvx { public: /** - * @brief Construct a PcapHelperForIpv4. + * @brief Construct a TraceHelperForIpv4. */ - PcapHelperForIpv4 () {} + TraceHelperForIpvx () {} /** - * @brief Destroy a PcapHelperForIpv4. + * @brief Destroy a TraceHelperForIpv4. */ - virtual ~PcapHelperForIpv4 () {} + virtual ~TraceHelperForIpvx () {} /** * @brief Enable pcap output the indicated Ipv4 and interface pair. @@ -696,24 +679,78 @@ */ void EnablePcapIpv4All (std::string prefix); -}; - -/** - * @brief Base class providing common user-level ascii trace operations for - * helpers representing IPv4 protocols . - */ -class AsciiTraceHelperForIpv4 -{ -public: /** - * @brief Construct an AsciiTraceHelperForIpv4. + * @brief Enable pcap output the indicated Ipv6 and interface pair. + * @internal + * + * @param prefix Filename prefix to use for pcap files. + * @param ipv6 Ptr on which you want to enable tracing. + * @param interface Interface on ipv6 on which you want to enable tracing. + * @param explicitFilename Treat the prefix as an explicit filename if true. */ - AsciiTraceHelperForIpv4 () {} + virtual void EnablePcapIpv6Internal (std::string prefix, + Ptr ipv6, + uint32_t interface, + bool explicitFilename) = 0; /** - * @brief Destroy an AsciiTraceHelperForIpv4 + * @brief Enable pcap output the indicated Ipv6 and interface pair. + * + * @param prefix Filename prefix to use for pcap files. + * @param ipv6 Ptr on which you want to enable tracing. + * @param interface Interface on ipv6 on which you want to enable tracing. + * @param explicitFilename Treat the prefix as an explicit filename if true. */ - virtual ~AsciiTraceHelperForIpv4 () {} + void EnablePcapIpv6 (std::string prefix, Ptr ipv6, uint32_t interface, bool explicitFilename = false); + + /** + * @brief Enable pcap output the indicated Ipv6 and interface pair using a + * Ptr previously named using the ns-3 object name service. + * + * @param prefix filename prefix to use for pcap files. + * @param ipv6Name Name of the Ptr on which you want to enable tracing. + * @param interface Interface on ipv6 on which you want to enable tracing. + * @param explicitFilename Treat the prefix as an explicit filename if true. + */ + void EnablePcapIpv6 (std::string prefix, std::string ipv6Name, uint32_t interface, bool explicitFilename = false); + + /** + * @brief Enable pcap output on each Ipv6 and interface pair in the container. + * + * @param prefix Filename prefix to use for pcap files. + * @param c Ipv6InterfaceContainer of Ipv6 and interface pairs + */ + void EnablePcapIpv6 (std::string prefix, Ipv6InterfaceContainer c); + + /** + * @brief Enable pcap output on all Ipv6 and interface pairs existing in the + * nodes provided in the container. + * + * \param prefix Filename prefix to use for pcap files. + * \param n container of nodes. + */ + void EnablePcapIpv6 (std::string prefix, NodeContainer n); + + /** + * @brief Enable pcap output on the Ipv6 and interface pair specified by a + * global node-id (of a previously created node) and interface. Since there + * can be only one Ipv6 aggregated to a node, the node-id unambiguously + * determines the Ipv6. + * + * @param prefix Filename prefix to use for pcap files. + * @param nodeid The node identifier/number of the node on which to enable tracing. + * @param interface Interface on ipv6 on which you want to enable tracing. + * @param explicitFilename Treat the prefix as an explicit filename if true + */ + void EnablePcapIpv6 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename); + + /** + * @brief Enable pcap output on all Ipv6 and interface pairs existing in the + * set of all nodes created in the simulation. + * + * @param prefix Filename prefix to use for pcap files. + */ + void EnablePcapIpv6All (std::string prefix); /** * @brief Enable ascii trace output on the indicated Ipv4 and interface pair. @@ -875,153 +912,6 @@ */ void EnableAsciiIpv4 (Ptr stream, uint32_t nodeid, uint32_t interface, bool explicitFilename); -private: - /** - * @internal Avoid code duplication. - */ - void EnableAsciiIpv4Impl (Ptr stream, - std::string prefix, - uint32_t nodeid, - uint32_t interface, - bool explicitFilename); - - /** - * @internal Avoid code duplication. - */ - void EnableAsciiIpv4Impl (Ptr stream, std::string prefix, NodeContainer n); - - /** - * @internal Avoid code duplication. - */ - void EnableAsciiIpv4Impl (Ptr stream, std::string prefix, Ipv4InterfaceContainer c); - - /** - * @internal Avoid code duplication. - */ - void EnableAsciiIpv4Impl (Ptr stream, - std::string prefix, - std::string ipv4Name, - uint32_t interface, - bool explicitFilename); - - /** - * @internal Avoid code duplication. - */ - void EnableAsciiIpv4Impl (Ptr stream, - std::string prefix, - Ptr ipv4, - uint32_t interface, - bool explicitFilename); -}; - -/** - * @brief Base class providing common user-level pcap operations for helpers - * representing IPv6 protocols . - */ -class PcapHelperForIpv6 -{ -public: - /** - * @brief Construct a PcapHelperForIpv6. - */ - PcapHelperForIpv6 () {} - - /** - * @brief Destroy a PcapHelperForIpv6 - */ - virtual ~PcapHelperForIpv6 () {} - - /** - * @brief Enable pcap output the indicated Ipv6 and interface pair. - * @internal - * - * @param prefix Filename prefix to use for pcap files. - * @param ipv6 Ptr on which you want to enable tracing. - * @param interface Interface on ipv6 on which you want to enable tracing. - * @param explicitFilename Treat the prefix as an explicit filename if true. - */ - virtual void EnablePcapIpv6Internal (std::string prefix, - Ptr ipv6, - uint32_t interface, - bool explicitFilename) = 0; - - /** - * @brief Enable pcap output the indicated Ipv6 and interface pair. - * - * @param prefix Filename prefix to use for pcap files. - * @param ipv6 Ptr on which you want to enable tracing. - * @param interface Interface on ipv6 on which you want to enable tracing. - * @param explicitFilename Treat the prefix as an explicit filename if true. - */ - void EnablePcapIpv6 (std::string prefix, Ptr ipv6, uint32_t interface, bool explicitFilename = false); - - /** - * @brief Enable pcap output the indicated Ipv6 and interface pair using a - * Ptr previously named using the ns-3 object name service. - * - * @param prefix filename prefix to use for pcap files. - * @param ipv6Name Name of the Ptr on which you want to enable tracing. - * @param interface Interface on ipv6 on which you want to enable tracing. - * @param explicitFilename Treat the prefix as an explicit filename if true. - */ - void EnablePcapIpv6 (std::string prefix, std::string ipv6Name, uint32_t interface, bool explicitFilename = false); - - /** - * @brief Enable pcap output on each Ipv6 and interface pair in the container. - * - * @param prefix Filename prefix to use for pcap files. - * @param c Ipv6InterfaceContainer of Ipv6 and interface pairs - */ - void EnablePcapIpv6 (std::string prefix, Ipv6InterfaceContainer c); - - /** - * @brief Enable pcap output on all Ipv6 and interface pairs existing in the - * nodes provided in the container. - * - * \param prefix Filename prefix to use for pcap files. - * \param n container of nodes. - */ - void EnablePcapIpv6 (std::string prefix, NodeContainer n); - - /** - * @brief Enable pcap output on the Ipv6 and interface pair specified by a - * global node-id (of a previously created node) and interface. Since there - * can be only one Ipv6 aggregated to a node, the node-id unambiguously - * determines the Ipv6. - * - * @param prefix Filename prefix to use for pcap files. - * @param nodeid The node identifier/number of the node on which to enable tracing. - * @param interface Interface on ipv6 on which you want to enable tracing. - * @param explicitFilename Treat the prefix as an explicit filename if true - */ - void EnablePcapIpv6 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename); - - /** - * @brief Enable pcap output on all Ipv6 and interface pairs existing in the - * set of all nodes created in the simulation. - * - * @param prefix Filename prefix to use for pcap files. - */ - void EnablePcapIpv6All (std::string prefix); -}; - -/** - * @brief Base class providing common user-level ascii trace operations for - * helpers representing IPv6 protocols . - */ -class AsciiTraceHelperForIpv6 -{ -public: - /** - * @brief Construct an AsciiTraceHelperForIpv6. - */ - AsciiTraceHelperForIpv6 () {} - - /** - * @brief Destroy an AsciiTraceHelperForIpv6 - */ - virtual ~AsciiTraceHelperForIpv6 () {} - /** * @brief Enable ascii trace output on the indicated Ipv6 and interface pair. * @internal @@ -1185,6 +1075,43 @@ /** * @internal Avoid code duplication. */ + void EnableAsciiIpv4Impl (Ptr stream, + std::string prefix, + uint32_t nodeid, + uint32_t interface, + bool explicitFilename); + + /** + * @internal Avoid code duplication. + */ + void EnableAsciiIpv4Impl (Ptr stream, std::string prefix, NodeContainer n); + + /** + * @internal Avoid code duplication. + */ + void EnableAsciiIpv4Impl (Ptr stream, std::string prefix, Ipv4InterfaceContainer c); + + /** + * @internal Avoid code duplication. + */ + void EnableAsciiIpv4Impl (Ptr stream, + std::string prefix, + std::string ipv4Name, + uint32_t interface, + bool explicitFilename); + + /** + * @internal Avoid code duplication. + */ + void EnableAsciiIpv4Impl (Ptr stream, + std::string prefix, + Ptr ipv4, + uint32_t interface, + bool explicitFilename); + + /** + * @internal Avoid code duplication. + */ void EnableAsciiIpv6Impl (Ptr stream, std::string prefix, uint32_t nodeid, @@ -1220,6 +1147,8 @@ bool explicitFilename); }; + + } // namespace ns3 #endif /* TRACE_HELPER_H */ --- a/src/helper/wifi-helper.h Fri Apr 16 07:52:54 2010 +0200 +++ a/src/helper/wifi-helper.h Fri Apr 16 08:38:16 2010 +0200 @@ -43,7 +43,7 @@ * This base class must be implemented by new PHY implementation which wish to integrate * with the \ref ns3::WifiHelper class. */ -class WifiPhyHelper +class WifiPhyHelper : public TraceHelperForDevice { public: virtual ~WifiPhyHelper (); --- a/src/helper/wimax-helper.h Fri Apr 16 07:52:54 2010 +0200 +++ a/src/helper/wimax-helper.h Fri Apr 16 08:38:16 2010 +0200 @@ -49,7 +49,7 @@ /** * \brief build a set of WimaxNetDevice objects */ -class WimaxHelper :public PcapHelperForDevice, public AsciiTraceHelperForDevice +class WimaxHelper : public TraceHelperForDevice { public: /** --- a/src/helper/yans-wifi-helper.h Fri Apr 16 07:52:54 2010 +0200 +++ a/src/helper/yans-wifi-helper.h Fri Apr 16 08:38:16 2010 +0200 @@ -136,8 +136,7 @@ * in this class correspond to PHY-level traces and come to us via WifiPhyHelper * */ -class YansWifiPhyHelper : public WifiPhyHelper, - public PcapHelperForDevice, public AsciiTraceHelperForDevice +class YansWifiPhyHelper : public WifiPhyHelper { public: /**