dcbw at redhat.com
Wed Dec 12 09:44:16 EST 2007
On Wed, 2007-12-12 at 06:03 +0530, Raghavendra. S wrote:
> My requirement is something like this...let me explain with small
> piece of code.
> int main()
> printf("1- scan\n
> 2 - enable esecurity\n
> 3 - disable security\n
> 4 - edit config\n");
> //after taking input from user - say 'choice'
> case SCAN:
> // here i want to scan using wpa supplicant. and get result.
> case EDIT_CONFIG:
> // user will enter inputs after seeing scan result and
> then i will configure wpa_supplicant.conf as per users requirement.
> case ENABLE_SECURITY:
> // here i will enable supplicant. as below
> system("./wpa_supplicant -c ./wpa_supplicant.conf");
> //assume I will enable successfully with required command line
> //if successfully enabled i will work here...say getting
> ip...ping etc..
> case DISABLE_SECURITY:
> //here i should disable to do that...
> // I have to disassociate first.
> // then i will kill wpa supplicant.
> return 0;
> My code will look as above. I would like to understand following things here.
> 1. for scanning - I will modify wpa supplicant code to take command
> line argument say '-s' which indicates enable wpa supplicant only to
> scan. so I will enable wpa supplicant like this,
> system("./wpa_supplicant -s -c ./dummy_wpa_supplicant.conf"). I
> think using this I will get scan result. Let me know if there's any
> better approach. My objective here is to get scan result and i should
> fill this scan result in some structure.
Yes, there is. Take the scanning code in driver_wext.c, and put it into
the same file in which your main.c is. Do the scanning from _your_
program. You don't need wpa_supplicant running to scan.
Or, talk to wpa_supplicant over the control socket.
> 2. For disable security. - First I will disassociate. problem here is
> how i will get control on socket opened by wpa_supplicant, to
> disassociate it? If I able to to that then...my problem is solved.
> After this I will simply kill wpa supplicant.
You specify the control interface in the config file you pass to the
> I am not planning to use, wpa_cli.
> On 12/11/07, Jouni Malinen <j at w1.fi> wrote:
> > On Tue, Dec 11, 2007 at 06:51:01AM +0530, Raghavendra. S wrote:
> > > In below mailing list link you have mentioned that wpa supplicant
> > > snapshot version has provided command to disassociate.
> > >
> > > http://lists.shmoo.com/pipermail/hostap/2003-November/004852.html
> > That message has nothing to do with wpa_supplicant (it was about the
> > Host AP driver).
> > > I downloaded snapshot 0.6.0. But could not find command for
> > > disassociation. Will you plz tell me where can I get wpa supplicant code
> > > that supports disassociation command.
> > What exactly do you mean with "disassociation command"? Would 'wpa_cli
> > disconnect' meet your needs?
> > --
> > Jouni Malinen PGP id EFC895FA
> > _______________________________________________
> > HostAP mailing list
> > HostAP at shmoo.com
> > http://lists.shmoo.com/mailman/listinfo/hostap
More information about the HostAP