[pkg-wpa-devel] Patch: Support for mapping scripts, e.g. guessnet

Felix Homann fexpop at onlinehome.de
Fri Aug 4 20:59:50 UTC 2006


Hi Kel,

On Thursday 03 August 2006 23:32, Kel Modderman wrote:
> Ok, maybe its time to investigate whether or not we can optionally use
> guessnet somehow. It could allow further flexibility to the roaming setup,
> but no idea how it can be done yet ;-)

please take a look at the attached patch. It allows for calling mapping 
scripts from wpa_action. The syntax is very similar to ifupdowns mapping 
syntax.

A mapping script is specified by a line "wpa-mapping-script script-name".

By default the mapping script will only be used if there's no logical 
interface matching the id_str, or if there's no id_str at all.

If the mapping script should be used even if there's a matching id_str/iface 
pair you can do this by adding a line "wpa-script-priority 1". The 
whole "grep for matching LOGICAL interface stanza in interfaces file" step 
will be skipped then.

ifupdown would pass the contents of a "map" line to stdin of the mapping 
script. So do we with "wpa-map" lines. Unfortunately there can be only one 
wpa-map line, but you can even use wpa-map0...wpa-map20. So there can only be 
up to 21 wpa-map lines. This is due to the bracket expansion I've used. The 
number can easily be extended but maybe there's a better solution.

Here's a snippet from /e/n/i illustrating its usage. In this example we use 
guessnet as the mapping script (the test lines are for guessnet): 

-----
iface wlan inet manual
        wpa-driver wext
        wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
        wpa-mapping-script guessnet-ifupdown
#       wpa-script-priority 1
        wpa-map logical1 logical2 default
        wpa-map0 default: default
#       wpa-map1 default: default
#       wpa-map2 anything in a wpa-map line will be passed to stdin
# 	  wpa-map20 	of the mapping script

iface logical1 inet dhcp
test peer address 192.168.1.1 mac 00:01:02:03:04:22

iface logical2 inet dhcp
test peer address 192.168.1.2 mac 00:01:02:03:04:22

iface default inet dhcp
-------

I'm quite sure that the patch needs some polishing, it's a rather quick shot 
at the problem and I'm not the most talented programmer ;-)

> Say, while you attention is this way Felix, would you mind having a read of
> the doc thats being drafted?

I've only taken a glimpse so far but I'm quite pleased. I'll have a deeper 
look at the weekend.

Kind regards,

Felix
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wpa_mapping.patch
Type: text/x-diff
Size: 2551 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-wpa-devel/attachments/20060804/727dd260/wpa_mapping.bin


More information about the Pkg-wpa-devel mailing list