Bugzilla – Bug 2546
Add PrintRoutingChange and PrintRoutingChangeAll functions
Last modified: 2017-06-03 15:50:07 UTC
These API functions provide the ability to only print the routing table when it changes. They behave like PrintRoutingTableEvery and PrintRoutingTableAllEvery except if the routing table has not changed since the last time is was printed, no output is produced. Currently these functions are only available for routing protocols that maintain state information in a routing table (AODV and DSDV).
Well, technically al the routing protocols are using a routing table, and it should be quite easy to notify a change through a callback. I'm gonna wait to see the implementation for AODV and DSDV, perhaps we can figure out something generic.
Changes uploaded as https://codereview.appspot.com/317900043/
The implementation submitted uses the same implementation as PrintRoutingTable(All)Every which is repetitive schedule at the user specified frequency and then saves a copy of the routing table to compare during the next call. I considered using callbacks but struggled getting that implementation to work. There are lots of us of that in NS-3 but could not find an example that was appropriate for this type of situation. If you can provide a simple example when one calls sets up a bound callback that another class could use to execute on a state change that would be extremely helpful and then I could implement for the other routing protocols.
Updated change set uploaded to remove periodic scheduling and generate output on routing changes. Also implemented all models that actually implement PrintRoutingTable.
Moving to patch pending (with unresolved comments in the code review issue)