Small code which gives output similar to "iwlist eth0 scan"
Dan Williams
dcbw
Sun Dec 9 09:22:32 PST 2007
On Sat, 2007-12-08 at 14:09 +0900, Raghavendra. S wrote:
> Hi,
>
> One more doubt about disassociation. In my code I will enable wpa
> supplicant using
> system("./wpa_supplicant -ieth0 -Dmarvell -c./wpa_supplicant.conf
> -B");
> So it will be a daemon. Now to disassociate I need socket fd using
> which wpa_supplicant is communicating, How to get that. If I store the
> opened socket fd in some temp file then can I use same sock fd to
> disassociate and then kill wpa_supplicant using kill command or is
> there any better approach for the same.
Use the "ctrl_interface" parameter in the config file to tell
wpa_supplicant where to put it's global control socket.
dan
> -Raghu.
>
>
>
> On 12/7/07, Dan Williams <dcbw at redhat.com> wrote:
> 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
>
>
>
>
> --
> Regards & Thanks
> Raghavendra. S
More information about the Hostap
mailing list