About network device

Brian J. Tarricone bjt23 at cornell.edu
Sun Aug 5 18:06:37 PDT 2007


On Sun, 05 Aug 2007 23:59:42 +0200 Atton Jonathan wrote:

> I need watching my network device: if he is up, if the ip address is
> modified ...
> 
> Atm i use Hal to have the device list and if a device is add or
> remove. I can retrieve his name with net.interface.
>  Some questions:
> 
> - net.80203.link is not yet implemented right ?
> - net.interface_up seems doesn't work on my gentoo with hal 0.5.9, is
> it implemented or not ?

I brought this up a bit ago, and I've written a HAL addon for an app
I've written which take care of some of the unimplemented net.*
properties (including net.interface_up and net.80203.link).  See here:

http://svn.xfce.org/svn/kelnos/airconfig/trunk/hald-addon-airconfig-net/

(Of course, I've namespaced all the properties under
org.spuriousinterrupt.Airconfig to avoid any possible conflicts with
other apps, but you get the idea.)

When I talked about it on this list, it seemed there wasn't any
interest in merging this into HAL proper, and that a network-related
daemon such as NetworkManager shoul implement this functionality.

> Is it possible with Hal to have a callback when the ip address is
> modified ?

Nope.  My code doesn't do that either.  Perhaps someone else has
implemented what you're looking for.

Otherwise, if your application is Linux-only, you could consider using
a netlink socket to watch for things like this (which is what my addon
does; you could extend it pretty trivially to watch for IP address
changes).

	-brian


More information about the hal mailing list