traffic-control: Fix the size of the RootQueueDiscList attribute

This commit is contained in:
Stefano Avallone
2016-06-29 18:04:49 +02:00
parent 68ae41b061
commit 8a000b4a9f
2 changed files with 4 additions and 3 deletions

View File

@@ -130,6 +130,9 @@ main (int argc, char *argv[])
Ptr<QueueDisc> q = qdiscs.Get (1);
q->TraceConnectWithoutContext ("PacketsInQueue", MakeCallback (&TcPacketsInQueueTrace));
// Alternatively:
// Config::ConnectWithoutContext ("/NodeList/1/$ns3::TrafficControlLayer/RootQueueDiscList/0/PacketsInQueue",
// MakeCallback (&TcPacketsInQueueTrace));
Ptr<NetDevice> nd = devices.Get (1);
Ptr<PointToPointNetDevice> ptpnd = DynamicCast<PointToPointNetDevice> (nd);

View File

@@ -185,8 +185,6 @@ TrafficControlLayer::GetRootQueueDiscOnDevice (Ptr<NetDevice> device) const
if (ndi == m_netDevices.end ())
{
NS_LOG_WARN ("GetRootQueueDiscOnDevice should not be called before the "
<< "device is setup or a queue disc is installed on the device.");
return 0;
}
return ndi->second.rootQueueDisc;
@@ -241,7 +239,7 @@ TrafficControlLayer::NotifyNewAggregate ()
uint32_t
TrafficControlLayer::GetNDevices (void) const
{
return m_netDevices.size();
return m_node->GetNDevices ();
}