call Node::AddDevice from NetDevice::NetDevice
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Sun, 13 May 2007 09:58:53 +0200
changeset 586 6220d0040d50
parent 585 a009b03b720a
child 587 8d2fd4c1bb7a
call Node::AddDevice from NetDevice::NetDevice
SConstruct
src/devices/p2p/p2p-topology.cc
src/node/net-device.cc
--- a/SConstruct	Sun May 13 09:46:38 2007 +0200
+++ b/SConstruct	Sun May 13 09:58:53 2007 +0200
@@ -416,7 +416,7 @@
 example_simple_p2p = build.Ns3Module('simple-p2p', 'examples')
 example_simple_p2p.set_executable()
 ns3.add(example_simple_p2p)
-example_simple_p2p.add_deps(['core', 'simulator', 'node', 'p2p', 'internet-node'])
+example_simple_p2p.add_deps(['core', 'simulator', 'node', 'p2p', 'internet-node', 'applications'])
 example_simple_p2p.add_source('simple-p2p.cc')
 
 ns3.generate_dependencies()
--- a/src/devices/p2p/p2p-topology.cc	Sun May 13 09:46:38 2007 +0200
+++ b/src/devices/p2p/p2p-topology.cc	Sun May 13 09:58:53 2007 +0200
@@ -49,14 +49,12 @@
 
   Ptr<Queue> q = Queue::CreateDefault ();
   net1->AddQueue(q);
-  n1->AddDevice (net1);
   net1->Attach (channel);
   
   Ptr<PointToPointNetDevice> net2 = MakeNewObject<PointToPointNetDevice> (n2);
 
   q = Queue::CreateDefault ();
   net2->AddQueue(q);
-  n2->AddDevice (net2);
   net2->Attach (channel);
 
   return channel;
--- a/src/node/net-device.cc	Sun May 13 09:46:38 2007 +0200
+++ b/src/node/net-device.cc	Sun May 13 09:58:53 2007 +0200
@@ -43,7 +43,9 @@
   m_isBroadcast (false), 
   m_isMulticast (false), 
   m_isPointToPoint (false)
-{}
+{
+  m_node->AddDevice (this);
+}
 
 NetDevice::~NetDevice ()
 {}