Add Click logic
authorRuben Merz <ruben@net.t-labs.tu-berlin.de>
Wed, 18 May 2011 18:15:03 +0200
changeset 9 41d84bcc7ad8
parent 8 4e268ccc13de
child 10 f712669219fe
Add Click logic
003-click-netdevice-queue-state.patch
series
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/003-click-netdevice-queue-state.patch	Wed May 18 18:15:03 2011 +0200
@@ -0,0 +1,29 @@
+# HG changeset patch
+# Parent 72c957d04f2529ad41dc4990b3ce8ad154cc3065
+# User Ruben Merz <ruben@net.t-labs.tu-berlin.de>
+# Date 1305733911 -7200
+
+Click support for NetDevice queue state
+
+diff --git a/src/click/model/ipv4-click-routing.cc b/src/click/model/ipv4-click-routing.cc
+--- a/src/click/model/ipv4-click-routing.cc
++++ b/src/click/model/ipv4-click-routing.cc
+@@ -206,7 +206,17 @@
+ {
+   if (ifid >= 0 && ifid < (int) m_ipv4->GetNInterfaces ())
+     {
+-      return true;
++      Ptr<Ipv4L3ClickProtocol> ipv4l3 = DynamicCast<Ipv4L3ClickProtocol> (m_ipv4);
++      // Check whether the underlying netdevice accepts packets
++      Ptr<NetDevice> netdev = ipv4l3->GetNetDevice (ifid);
++      if (netdev->GetQueueState(0) > 0)
++        {
++          return true;
++        }
++      else
++        {
++          return false;
++        }
+     }
+   else
+     {
--- a/series	Wed May 18 17:18:37 2011 +0200
+++ b/series	Wed May 18 18:15:03 2011 +0200
@@ -1,2 +1,3 @@
 001-netdevice-queue-state.patch
 002-wifinetdevice-queue-state.patch
+003-click-netdevice-queue-state.patch