Re: Configuration information in hostapd-0.6.2 / wpa_supplicant-0.6.2

Christian Fackroth Proger
Wed Feb 6 06:21:56 PST 2008

Thanks Jouni,

>> This is a simple question but I couldn't find it in the structures.
>> Is it possible to get the information if the software is configured
>> in IBSS or INFRA mode from the main structures?

> What exactly do you mean with software being configured to either of
> these modes? Each network configuration block can be separately set to
> use either mode..

I can configure the wpa_supplicant with a config file. In the config file I can set
a tag called "mode" which can be 0 for INFRA or 1 for IBSS as show in the follow


I need this information because depend on this I have to do different
things in the code.

>> I need this information on several locations in the code for example
>> in the function wpa_driver_wext_init(void *ctx, const char *ifname)
>> of wpa_supplicant. 

> There is no global IBSS/INFRA flag and as such, this information is not
> available at the time the init() handler for driver wrapper is called.
> Driver wrapper will be notified of the selected mode in the associate()
> call for each connection.

Ok in the function wpa_driver_wext_init(void *ctx, const char *ifname) the
driver is configured for INFRA with the follow instructions:

if (wpa_driver_wext_set_mode(drv, 0) < 0) {
  printf("Could not configure driver to use managed mode\n");

If the mode is 1 in the config file I have to configured this with 1 and not
fix with 0. So I need the information from the config file here and if this
information is not available I have to add this information. Or is there a
way I can use the associate() call for this?
There are several locations in hostapd and wpa_supplicant where I have
to make decisions depend from the selected mode. Do you have some
additional helpful hints for me?

Thanks in advance,

In 5 Schritten zur eigenen Homepage. Jetzt Domain sichern und gestalten! 
Nur 3,99 EUR/Monat!

More information about the Hostap mailing list