[pkg-wpa-devel] Re: Patch: Support for mapping scripts,
e.g. guessnet
Kel Modderman
kelrin at tpg.com.au
Mon Aug 7 13:19:04 UTC 2006
On Monday 07 August 2006 22:55, Felix Homann wrote:
> Hi Kel,
>
> On Monday 07 August 2006 14:15, Kel Modderman wrote:
> > On Monday 07 August 2006 21:24, Felix Homann wrote:
> >
> > I cannot promise these as environmental vars, that would require Jouni to
> > accept a patch, and the very reason the id_str was added was that SSID
> > could not be used as a valid mapping in many cases because it may contain
> > weird characters that cannot be used by networking tools.
>
> Ah, I see. Then just forget about it, I'll use wpa_cli as I did before. It
> also has the advantage that I don't need to modify the patch, I can just
> ask for reconsideration.
>
> > We can however, cludge around this by calling wpa_cli back on itself
> > like:
> >
> > wpa_cli status | sed -n -e 's/^ssid=//p'
>
> I'm using this:
>
> wpa_cli -i"$IFACE" status | grep ^ssid
But an external script does not now where the WPA_CTRL_DIR is (ctrl_interface
UNIX socket), so it will not work when this is not the default path
=> /var/run/wpa_supplicant.
wpa_action inherits this information from the environment.
Maybe you could adapt your guessnet patch to use this, with -p option. That
way, when called by wpa_action it could inherit the path via env var, but
default to /var/run/wpa_supplicant when env var is not present.
>
>
> If you're interested I've attached the script I've included in my guessnet
> patch. You can use as a guessnet test with one of the following lines in an
> iface stanza:
>
> test command test-command-wpacli bssid 01:02:03:04:05 ssid Network Name
> test command test-command-wpacli bssid 01:02:03:04:0a
> test command test-command-wpacli ssid Network Name
>
> Letters in the BSSID have to be lower case, blanks in the SSID are allowed,
> the BSSID has to preseed the ssid if both are present. You'll also have to
> specify the path to test-command-wpacli.
Yes, looks interesting.
>
> If the patch would be accepted it could be called without "command".
>
> > > This would also allow for a very simple script mapping by ssid: echo
> > > $SSID.
> >
> > I need a bit more help to understand where this will fit into wpa_action.
>
> It's not that important. I was thinking of
>
> something like
>
> ========
> ...
> wpa-mapping-script ssid-mapping.sh
>
> iface ssid inet dhcp
> ...
> =========
>
> and
>
> ============
> #!/bin/sh
> # this is ssid-mapping.sh
> echo $WPA_SSID
> ============
>
> Just a bit of playing around ..
This would be best via the guessnet test that you attached, rather than an own
script, as id_str pretty much defeats this, imho.
Thanks, Kel.
More information about the Pkg-wpa-devel
mailing list