[Ns-developers] NetDevice link change callback
Mathieu Lacage
mathieu.lacage at sophia.inria.fr
Tue Jul 28 02:23:49 PDT 2009
On Mon, 2009-07-27 at 14:46 -0700, Tom Henderson wrote:
> 1) use of TracedCallback?
> Another option is to use a TracedCallback here, which some other
> developers have recommended in the past to use when there needs to be a
> list of callbacks.
>
> I don't have a strong opinion but this question keeps popping up (also
> in Qasim's conntrack code) so I think we should clarify whether
> TracedCallback should also be used in non-tracing scenarios whenever you
> want a std::list of callbacks, or whether we want another general
> CallbackList of some sort that is not used by tracing code.
I think that all you would need to make TracedCallback generic is change
its name to something which does not include 'Trace'. i.e., its API and
implementation has no dependency on the tracing code.
> 2) should we report link change, or link up?
> The method name is not really suggestive of how the callback works,
> which does not call when the link changes in all cases but only when the
> link goes to up. So, I would suggest either "AddLinkUpCallback" or
> "SetLinkChangeCallback" with an extra argument such as an enum for Up or
> Down.
The current implementation reports link change events, not link up
events. i.e., see src/devices/wifi/wifi-net-devices.cc. The current API
documentation in src/node/net-device.h should be improved instead of
changing the method name I think.
> I think others have raised the question "can I put a NetDevice into down
> state?" and presently the answer is no, but in practice, IFF_UP flag of
> a netdevice is settable, and it seems like we might want to add the
> capability to configure an interface to down state, which would trigger
> upcalls to both Ipv4 and Ipv6 stacks (and to the routing protocols).
What would be the expected semantics of that flag exactly ? Would you
expect the NetDevice subclasses to honor calling SetIfDown by ignoring
packets being passed down with NetDevice::Send* ?
Mathieu
More information about the Ns-developers
mailing list