Small code which gives output similar to "iwlist eth0 scan"
dcbw at redhat.com
Sun Dec 9 12:22:32 EST 2007
On Sat, 2007-12-08 at 14:09 +0900, Raghavendra. S wrote:
> One more doubt about disassociation. In my code I will enable wpa
> supplicant using
> system("./wpa_supplicant -ieth0 -Dmarvell -c./wpa_supplicant.conf
> 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.
> 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
> > wpa_supplicant.conf and then I will enable wpa_supplicant.
> > user has to first see the scanned result and after that he
> > 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
> You can print out whatever you want given the information it
> 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.
> > -Raghu.
> > On 12/7/07, Dan Williams <dcbw at redhat.com> wrote:
> > On Fri, 2007-12-07 at 16:45 +0530, Raghavendra. S
> > > Hi,
> > >
> > > Does any one know small AP scan code which
> > 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
> > 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