diff --git a/src/node/channel.cc b/src/node/channel.cc index 690da0ce8..c5875b82e 100644 --- a/src/node/channel.cc +++ b/src/node/channel.cc @@ -27,14 +27,18 @@ NS_DEBUG_COMPONENT_DEFINE ("Channel"); namespace ns3 { +const InterfaceId Channel::iid ("Channel"); + Channel::Channel () - : m_name("Channel") + : Interface (Channel::iid), + m_name("Channel") { NS_DEBUG("Channel::Channel ()"); } Channel::Channel (std::string name) - : m_name(name) + : Interface (Channel::iid), + m_name(name) { NS_DEBUG("Channel::Channel (" << name << ")"); } diff --git a/src/node/channel.h b/src/node/channel.h index aefbf98b3..20671f9d5 100644 --- a/src/node/channel.h +++ b/src/node/channel.h @@ -24,7 +24,7 @@ #include #include -#include "ns3/object.h" +#include "ns3/interface.h" #include "ns3/ptr.h" namespace ns3 { @@ -37,9 +37,10 @@ class NetDevice; * A channel is a logical path over which information flows. The path can * be as simple as a short piece of wire, or as complicated as space-time. */ -class Channel : public Object +class Channel : public Interface { public: + static const InterfaceId iid; Channel (); Channel (std::string name); diff --git a/src/node/net-device.cc b/src/node/net-device.cc index bd5b2946f..86b25d2de 100644 --- a/src/node/net-device.cc +++ b/src/node/net-device.cc @@ -21,15 +21,19 @@ #include #include "ns3/assert.h" +#include "ns3/interface.h" +#include "channel.h" #include "net-device.h" #include "llc-snap-header.h" #include "node.h" -#include "ns3/channel.h" namespace ns3 { +const InterfaceId NetDevice::iid ("NetDevice"); + NetDevice::NetDevice(Ptr node, const MacAddress& addr) : + Interface (NetDevice::iid), m_node (node), m_name(""), m_ifIndex (0), diff --git a/src/node/net-device.h b/src/node/net-device.h index 78ed233d5..92289d5e0 100644 --- a/src/node/net-device.h +++ b/src/node/net-device.h @@ -25,9 +25,9 @@ #include #include "ns3/callback.h" #include "ns3/packet.h" -#include "ns3/object.h" -#include "mac-address.h" +#include "ns3/interface.h" #include "ns3/ptr.h" +#include "mac-address.h" namespace ns3 { @@ -55,9 +55,10 @@ class Channel; * this base class and implement your own version of the * NetDevice::SendTo method. */ -class NetDevice : public Object +class NetDevice : public Interface { public: + static const InterfaceId iid; /** * \param node base class node pointer of device's node * \param addr MAC address of this device.