src/node/internet-node.cc
changeset 521 e540282f8462
parent 520 92160600f7f2
child 522 d5039448597a
--- a/src/node/internet-node.cc	Thu May 03 14:23:41 2007 +0200
+++ b/src/node/internet-node.cc	Thu May 03 14:39:37 2007 +0200
@@ -32,6 +32,7 @@
 #include "arp.h"
 #include "net-device.h"
 #include "i-udp-impl.h"
+#include "i-arp-private.h"
 
 namespace ns3 {
 
@@ -42,8 +43,6 @@
   Arp *arp = new Arp (this);
   Udp *udp = new Udp (this);
 
-
-  // Instantiate the capabilities
   ApplicationList *applicationList = new ApplicationList(this);
   L3Demux *l3Demux = new L3Demux(this);
   Ipv4L4Demux *ipv4L4Demux = new Ipv4L4Demux(this);
@@ -53,7 +52,9 @@
   ipv4L4Demux->Insert (udp);
 
   IUdpImpl *udpImpl = new IUdpImpl (udp);
+  IArpPrivate *arpPrivate = new IArpPrivate (arp);
 
+  NsUnknown::AddInterface (arpPrivate);
   NsUnknown::AddInterface (udpImpl);
   NsUnknown::AddInterface (applicationList);
   NsUnknown::AddInterface (l3Demux);
@@ -67,6 +68,7 @@
   arp->Unref ();
   udp->Unref ();
   udpImpl->Unref ();
+  arpPrivate->Unref ();
 }
 
 InternetNode::~InternetNode ()
@@ -88,11 +90,6 @@
                  InternetNode::IPV4);
   ipv4->Unref ();
 
-  Arp *arp = GetArp ();
-  resolver->Add ("arp",
-                 MakeCallback (&Arp::CreateTraceResolver, arp),
-                 InternetNode::ARP);
-  arp->Unref ();
 
   return resolver;
 }
@@ -113,16 +110,6 @@
   return ipv4;
 }
 
-Arp *
-InternetNode::GetArp (void) const
-{
-  L3Demux *l3Demux = QueryInterface<L3Demux> (L3Demux::iid);
-  Arp *arp = static_cast<Arp*> (l3Demux->PeekProtocol (Arp::PROT_NUMBER));
-  l3Demux->Unref ();
-  arp->Ref ();
-  return arp;
-}
-
 void 
 InternetNode::DoAddDevice (NetDevice *device) const
 {