Small code which gives output similar to "iwlist eth0 scan"

Dan Williams dcbw
Fri Dec 7 03:53:34 PST 2007


On Fri, 2007-12-07 at 17:20 +0530, Raghavendra. S wrote:
> Hi Dan,
>  
>  Actually in my case I want to get scan result first then configure
> wpa_supplicant.conf and then I will enable wpa_supplicant. Because
> user has to first see the scanned result and after that he can
> configure to which AP he want to associate with and security models he
> want to use. So I need some independent small AP scan code similar to
> "iwlist eth0 scan".

Again, look at driver_wext.c.  Code to scan and get results is there.
You can print out whatever you want given the information it returns.
You can create a tool that incorporates that code, prints out what the
user wants from scan result information passed back by the driver, and
then spawn wpa_supplicant however you like.

Dan

> -Raghu.
> 
>  
> On 12/7/07, Dan Williams <dcbw at redhat.com> wrote: 
>         On Fri, 2007-12-07 at 16:45 +0530, Raghavendra. S wrote:
>         > Hi,
>         >
>         >    Does any one know small AP scan code which gives
>         similar/same 
>         > output as that of "iwlist eth0 scan". I dont want to use
>         iwlist
>         > because of its size.
>         
>         Look at the driver_wext.c code from wpa_supplicant at
>         wpa_driver_wext_scan() and
>         wpa_driver_wext_get_scan_results().  You 
>         don't need to screenscrape output if you can just use the
>         values
>         directly.
>         
>         Dan
>         
>         
>         
> 
> 
> 
> -- 
> Regards & Thanks
> Raghavendra. S 





More information about the Hostap mailing list