MaxQueueLen and MaxQueueTime attributes can't change

This commit is contained in:
Yoshihiko Yazawa
2010-12-14 21:41:21 -08:00
parent 87dcc63058
commit 558921399f
2 changed files with 21 additions and 2 deletions

View File

@@ -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<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 @@ 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 ()
{
}

View File

@@ -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; }