src/internet-node/ipv4-l3-protocol.cc
changeset 3172 e661e08c3211
parent 3153 1433edf49f02
child 3216 b36bb98d766e
--- a/src/internet-node/ipv4-l3-protocol.cc	Wed May 28 17:52:42 2008 +0100
+++ b/src/internet-node/ipv4-l3-protocol.cc	Thu May 29 09:34:31 2008 +0100
@@ -29,6 +29,7 @@
 #include "ns3/uinteger.h"
 #include "ns3/trace-source-accessor.h"
 #include "ns3/object-vector.h"
+#include "arp-l3-protocol.h"
 
 #include "ipv4-l3-protocol.h"
 #include "ipv4-l4-protocol.h"
@@ -320,6 +321,13 @@
 Ipv4L3Protocol::AddInterface (Ptr<NetDevice> device)
 {
   NS_LOG_FUNCTION (this << &device);
+
+  Ptr<Node> node = GetObject<Node> ();
+  node->RegisterProtocolHandler (MakeCallback (&Ipv4L3Protocol::Receive, this), 
+                                 Ipv4L3Protocol::PROT_NUMBER, device);
+  node->RegisterProtocolHandler (MakeCallback (&ArpL3Protocol::Receive, PeekPointer (GetObject<ArpL3Protocol> ())),
+                                 ArpL3Protocol::PROT_NUMBER, device);
+
   Ptr<ArpIpv4Interface> interface = CreateObject<ArpIpv4Interface> ();
   interface->SetNode (m_node);
   interface->SetDevice (device);