From 558921399f9aa47da2c9b5205cbfc8027be64abd Mon Sep 17 00:00:00 2001 From: Yoshihiko Yazawa Date: Tue, 14 Dec 2010 21:41:21 -0800 Subject: [PATCH] MaxQueueLen and MaxQueueTime attributes can't change --- src/routing/aodv/aodv-routing-protocol.cc | 19 +++++++++++++++++-- src/routing/aodv/aodv-routing-protocol.h | 4 ++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/routing/aodv/aodv-routing-protocol.cc b/src/routing/aodv/aodv-routing-protocol.cc index 895afc3fb..48162db2c 100644 --- a/src/routing/aodv/aodv-routing-protocol.cc +++ b/src/routing/aodv/aodv-routing-protocol.cc @@ -194,11 +194,13 @@ RoutingProtocol::GetTypeId (void) 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 ()) .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 @@ RoutingProtocol::GetTypeId (void) 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 () { } diff --git a/src/routing/aodv/aodv-routing-protocol.h b/src/routing/aodv/aodv-routing-protocol.h index 5b0628e13..12d2a668d 100644 --- a/src/routing/aodv/aodv-routing-protocol.h +++ b/src/routing/aodv/aodv-routing-protocol.h @@ -74,6 +74,10 @@ public: ///\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; }