MaxQueueLen and MaxQueueTime attributes can't change
authorYoshihiko Yazawa <yoshiyaz@gmail.com>
Tue, 14 Dec 2010 21:41:21 -0800
changeset 6682 096ee74e0562
parent 6681 df822f566004
child 6683 95a102872a7e
MaxQueueLen and MaxQueueTime attributes can't change
src/routing/aodv/aodv-routing-protocol.cc
src/routing/aodv/aodv-routing-protocol.h
--- a/src/routing/aodv/aodv-routing-protocol.cc	Fri Dec 10 15:22:36 2010 +0100
+++ b/src/routing/aodv/aodv-routing-protocol.cc	Tue Dec 14 21:41:21 2010 -0800
@@ -194,11 +194,13 @@
                      MakeTimeChecker ())
       .AddAttribute ("MaxQueueLen", "Maximum number of packets that we allow a routing protocol to buffer.",
                      UintegerValue (64),
-                     MakeUintegerAccessor (&RoutingProtocol::MaxQueueLen),
+                     MakeUintegerAccessor (&RoutingProtocol::SetMaxQueueLen,
+                                           &RoutingProtocol::GetMaxQueueLen),
                      MakeUintegerChecker<uint32_t> ())
       .AddAttribute ("MaxQueueTime", "Maximum time packets can be queued (in seconds)",
                      TimeValue (Seconds (30)),
-                     MakeTimeAccessor (&RoutingProtocol::MaxQueueTime),
+                     MakeTimeAccessor (&RoutingProtocol::SetMaxQueueTime,
+                                       &RoutingProtocol::GetMaxQueueTime),
                      MakeTimeChecker ())
       .AddAttribute ("AllowedHelloLoss", "Number of hello messages which may be loss for valid link.",
                      UintegerValue (2),
@@ -228,6 +230,19 @@
   return tid;
 }
 
+void
+RoutingProtocol::SetMaxQueueLen (uint32_t len)
+{
+    MaxQueueLen = len;
+    m_queue.SetMaxQueueLen (len);
+}
+void
+RoutingProtocol::SetMaxQueueTime (Time t)
+{
+  MaxQueueTime = t;
+  m_queue.SetQueueTimeout (t);
+}
+
 RoutingProtocol::~RoutingProtocol ()
 {
 }
--- a/src/routing/aodv/aodv-routing-protocol.h	Fri Dec 10 15:22:36 2010 +0100
+++ b/src/routing/aodv/aodv-routing-protocol.h	Tue Dec 14 21:41:21 2010 -0800
@@ -74,6 +74,10 @@
   
   ///\name Handle protocol parameters
   //\{
+  Time GetMaxQueueTime () const { return MaxQueueTime; }
+  void SetMaxQueueTime (Time t);
+  uint32_t GetMaxQueueLen () const { return MaxQueueLen; }
+  void SetMaxQueueLen (uint32_t len);
   bool GetDesinationOnlyFlag () const { return DestinationOnly; }
   void SetDesinationOnlyFlag (bool f) { DestinationOnly = f; }
   bool GetGratuitousReplyFlag () const { return GratuitousReply; }