net.interface_up and unimplemented net.80203 properties (linux)
Brian J. Tarricone
bjt23 at cornell.edu
Mon Mar 12 17:05:07 PDT 2007
On Mon, 12 Mar 2007 16:33:26 -0400 David Zeuthen wrote:
>On Mon, 2007-03-12 at 02:22 -0700, Brian J. Tarricone wrote:
>
>> I'm perfectly ok with keeping my HAL addon with my app, which will
>> get installed with scripts and .fdi files to enable the
>> functionality I need. I'm merely hoping that it might be deemed
>> possibly-useful to other users of HAL. This is the first time I've
>> worked with HAL so closely, and I wanted to test the waters first
>> before coming up with a patch.
>
>Isn't it possible to do today what you need just as HAL addon? I mean,
>an addon is really just a daemon tied to a specific device that takes
>over a name space, e.g. it maintains properties
>
> com.example.myapp.*
>
>and provides D-Bus methods and signals on
>
> com.example.MyApp
>
>So, for network management, I'd expect that you can get away with
>providing methods such as
>
> com.example.MyApp.BringUp (type=[dhcp,static], <other details>
>
>and populate
>
> com.example.myapp.interface_is_up
> com.example.myapp.interface_type
> com.example.myapp.interface_ipv4_address
> com.example.myapp.interface_ipv6_address
> ...
>
>and so on (I'm just making these up). Doesn't that work?
Yep, that's what I already have. My intent here was to see if there's
interest in getting the addon distributed with HAL proper (i.e., just
like hald-addon-storage, etc.). As it is now, net.interface_up is
present but broken (I see in newer HAL releases it's been removed; I'm
on 0.5.7.1), and the net.80203.{link,rate} properties aren't
implemented. I feel like it would be useful to have them working "out
of the box" so to speak, without having to reimplement it in
NetworkManager, my app, and any other apps that care about the property
but don't (or can't) assume the presence of NM.
I've also added D-Bus methods for bringing the interface up and down,
with corresponding scripts; adding methods and scripts to set IP
addresses, etc. is easy as you note.
Also, my addon implementation only works on Linux, but it would be nice
to be able to support whatever other OSes HAL runs/will run on, which
is something I may not be able to do myself. Having a working Linux
implementation for the properties might give incentive to the various
HAL porters, so apps like mine and like NM will get the support for
free. (There's also the matter that it seems that HAL changed
locations for addons/scripts between 0.5.7 and 0.5.8, at least there's
a difference between my Gentoo and Ubuntu boxes; figuring out where
to install them from my app could be a pain.)
Again, I can certainly distribute the addon and scripts with my app
(namespaced for my app rather than using org.freedesktop.Hal.xyz), but
I wonder if there'd be interest in making them an official part of the
HAL D-Bus interface. I'd be willing to work up a patch (both for code
and for the HAL spec/documentation) against current git if it seems
worth it.
-brian
More information about the hal
mailing list