Add support for tracing the OLSR routing table size.
--- a/src/routing/olsr/olsr-agent-impl.cc Thu Feb 14 18:15:26 2008 +0000
+++ b/src/routing/olsr/olsr-agent-impl.cc Thu Feb 14 18:55:11 2008 +0000
@@ -296,6 +296,11 @@
"const olsr::MessageList &", "list of OLSR messages contained in the packet"
),
m_txPacketTrace);
+ resolver->AddSource ("RoutingTableChanged",
+ TraceDoc ("the OLSR routing table has changed",
+ "uint32_t", "size of the new routing table"
+ ),
+ m_routingTableChanged);
resolver->SetParentResolver (Object::GetTraceResolver ());
return resolver;
}
@@ -970,6 +975,7 @@
}
NS_LOG_DEBUG ("Node " << m_mainAddress << ": RoutingTableComputation end.");
+ m_routingTableChanged (m_routingTable->GetSize ());
}
--- a/src/routing/olsr/olsr-agent-impl.h Thu Feb 14 18:15:26 2008 +0000
+++ b/src/routing/olsr/olsr-agent-impl.h Thu Feb 14 18:55:11 2008 +0000
@@ -187,6 +187,7 @@
const MessageList &> m_rxPacketTrace;
CallbackTraceSource <const PacketHeader &,
const MessageList &> m_txPacketTrace;
+ CallbackTraceSource <uint32_t> m_routingTableChanged;
};
--- a/src/routing/olsr/routing-table.h Thu Feb 14 18:15:26 2008 +0000
+++ b/src/routing/olsr/routing-table.h Thu Feb 14 18:55:11 2008 +0000
@@ -81,8 +81,9 @@
{}
~RoutingTable () {}
-
+
void Clear ();
+ uint32_t GetSize () const { return m_table.size (); }
void RemoveEntry (const Ipv4Address &dest);
void AddEntry (const Ipv4Address &dest,
const Ipv4Address &next,