Bug 653 - NetDevice link change callback proposal
: NetDevice link change callback proposal
Status: RESOLVED FIXED
: ns-3
devices
: ns-3-dev
: All All
: P5 normal
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2009-08-06 17:56 EDT by
Modified: 2009-09-15 03:06 EDT (History)


Attachments
proposed patch (14.11 KB, patch)
2009-08-06 17:58 EDT, Tom Henderson
Details | Diff
std::list<Callback> => TracedCallback (13.10 KB, patch)
2009-08-14 03:13 EDT, Sebastien Vincent
Details | Diff
Use TracedCallback object in *-net-device (14.56 KB, patch)
2009-08-24 04:13 EDT, Sebastien Vincent
Details | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2009-08-06 17:56:47 EDT
From Sebastien Vincent:

In NetDevice, there is a callback when device change state (UP or DOWN). 
It is used mainly by ArpL3Protocol to flush ARP cache.
But for future IPv6 integration, it would be also useful to use it to 
purge Neighbor Discovery cache.

So I propose to replace single callback in NetDevice base and sub 
classes by a list of link change callback.

The main API change would be :

NetDevice::SetLinkChangeCallback(Callback<void> callback) => 
NetDevice::AddLinkChangeCallback(Callback<void> callback)

In all NetDevice's subclasses, replace all Callback<void> 
m_linkChangeCallback by std::list<Callback<void> m_linkChangeCallbacks.
When link change, call every callbacks of the list.


Thread/discussion started on developers list:
http://mailman.isi.edu/pipermail/ns-developers/2009-July/006280.html
------- Comment #1 From 2009-08-06 17:58:16 EDT -------
Created an attachment (id=544) [details]
proposed patch

from Sebastien Vincent, July 27 2009
------- Comment #2 From 2009-08-14 03:13:13 EDT -------
Created an attachment (id=560) [details]
std::list<Callback> => TracedCallback

Update patch :
- typedef TracedCallback to ListCallback;
- use ListCallback in NetDevice (csma, point-to-point, wifi, emu).
------- Comment #3 From 2009-08-24 00:58:23 EDT -------
(In reply to comment #2)
> Created an attachment (id=560) [details] [details]
> std::list<Callback> => TracedCallback
> 
> Update patch :
> - typedef TracedCallback to ListCallback;
> - use ListCallback in NetDevice (csma, point-to-point, wifi, emu).
> 

For the moment, how about just removing the typedef until requirements for a
ListCallback are better sorted out, and just using a TracedCallback (with your
other changes)?

Plus, we need to patch CHANGES.html.
------- Comment #4 From 2009-08-24 04:13:32 EDT -------
Created an attachment (id=570) [details]
Use TracedCallback object in *-net-device

Update patch. 

It also add code to flush IPv6 neighbor discovery cache (in Icmpv6L4Protocol)
and some text in CHANGES.html.
------- Comment #5 From 2009-09-05 00:43:06 EDT -------
(In reply to comment #4)
> Created an attachment (id=570) [details] [details]
> Use TracedCallback object in *-net-device
> 
> Update patch. 
> 
> It also add code to flush IPv6 neighbor discovery cache (in Icmpv6L4Protocol)
> and some text in CHANGES.html.
> 

+1 on this; I suggest to merge it next week and close this if no further
comments.
------- Comment #6 From 2009-09-15 03:06:28 EDT -------
Changeset: e90e1ef585b0