[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: interfaces, mapping, etc

Joey Hess wrote:
> iface wlan0-home inet static
>         pre-up /usr/share/wlan-ng/start wlan0-home
>         address
>         gateway
>         netmask
>         down /usr/share/wlan-ng/stop

I've been thinking about this a bit, and I think that it's a pity that
ifupdown doesn't have a more dynamic notion of what fields it accepts
in these stanzas and how they're dealt with. A hypothetical complete stanza
for a wlan-ng interface should really be something like this:

iface wlan0-home inet static
	wifi_mode ad-hoc
	wifi_essid mywifilan
	wifi_id mylaptop
	wifi_channel 1
	wifi_rate 11
	wifi_wep off
#	wifi_key foo
Actually that same stanza would work for a more traditional linux
orinoco card as well; the information is the same, the way its fed to
the drivers much different. But I don't think there's much chance of
something like this working with the current ifupdown, which seems to
get the set of field names based on the type of interface, and
hard-codes what is done with them.

To support this hypothetical system, ifupdown would currently need to be
modified to add another parameter to the iface line saying what kind of
wireless interface it is:

iface eth0 inet wireless-tools static
iface wlan0 inet wlan-ng static

Or maybe just add a field for that:

iface eth0 inet static
	wifi_type wlan-ng

Either way, then add the new wifi_* fields, and add code to run the
right commands based on them and so on. If you feel this is the right
approach, I might give it a try for wlan-ng. I think something more
flexible without having to add each new bit to ifupdown would be nicer

So -- ifupdown already ignores fields with names it doesn't know. Just
make it set all such fields in the environemnt when running the various
if-up.* scripts, and the up, pre-up, down, and post-down commands.

Then to add support for wlan-ng's additional needed fields, I can just
write if-*.d scripts that examine their environemnt for the wifi_*
fields, check to see if this is an interface they should act on, and do
their thing. If someone finally converts pcmcia-cs to use ifupdown, they can
drop in a similar script for the wireless-tools stuff.

I think that'd be quite nice. Getting every bit of network configuration
info in one file, including the wireless stuff would be swell! It can
even be extended locally to any arbitrary network scheme related data
one might want to put in there (mail relay? dns server? why not?) What
do you think?

I expect this would not be a big change (with luck, just a few lines),
and I'd be happy to tackle it if you lack time.

see shy jo

To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Reply to: