Commit graph

743 commits

Author SHA1 Message Date
Jouni Malinen 2b057028cb Fix client MLME test code for IBSS scan request
wpa_s->mlme.ssid is an array so it is always != NULL and this
comparision should really have used ssid_len instead.
2010-01-10 20:41:33 +02:00
Marcel Holtmann 097c5802da dbus: Fix value of BSS Privacy property
Checking for IEEE80211_CAP_PRIVACY needs to use & and not &&.
2010-01-10 18:18:08 +02:00
Jouni Malinen 728e776c09 Fix alloc validation in wpa_bss_get_bit_rates()
Need to check the value returned by os_malloc(), not the pointer to
this value.
2010-01-09 23:56:09 +02:00
Witold Sowa 8e5568f874 dbus: Change BSS, Network and some errors interface names
Remove ".Interface" part from BSS and Network objects and some
error names.
2010-01-09 11:41:09 +02:00
Masashi Honma 953f0f6333 bsd: Add support for WPA_TRACE and WPA_TRACE_BFD
On FreeBSD 8.0, WPA_TRACE and WPA_TRACE_BFD functionality build fails.
2010-01-09 11:01:12 +02:00
Jouni Malinen d97572a40f dbus: Add a test script for D-Bus API signals 2010-01-06 21:33:54 +02:00
Jouni Malinen c91278a5b4 dbus: Do not try to unregister not-yet-registered network object 2010-01-06 21:31:13 +02:00
Jouni Malinen d58f4a8177 Remove forgotten script termination attempt 2010-01-06 20:23:47 +02:00
Witold Sowa 158c6c7467 dbus: Add BSS property change notifications 2010-01-06 20:03:01 +02:00
Jouni Malinen c3299a8b74 dbus: Fix crash on property change if D-Bus API is disabled 2010-01-06 12:14:35 +02:00
Jouni Malinen 6c195cd507 dbus: Fix prop_changed_flags allocation to count properties correctly
There was an extra semicolon that broke the calculation of registered
properties and resulted in obj_desc->prop_changed_flags not being
allocated long enough for all the flags.
2010-01-06 11:55:21 +02:00
Jouni Malinen e30020c7ab dbus: Fix flush_object_timeout_handler context to be consistent
The path pointer used as the timeout_ctx was not constant; the path
string itself may have been the same, but the pointer certainly was not
since it was sometimes from stack and sometimes from the dynamically
allocated buffer in obj_desc. This caused some of the eloop timeout
cancellations not to find the timeout. Fix this by using the obj_desc
as the timeout context data.
2010-01-06 11:50:43 +02:00
Witold Sowa abd7a4e353 dbus: Aggregate PropertiesChanged signals
Instead of sending PropertiesChanged signals for each changed
property separately, mark properties as changed and send aggregated
PropertiesChanged signals for each interface in each object.
Aggregated PropertiesChanged signal is sent
- for all object after responding on DBus call
- for specified object after manual call to
  wpa_dbus_flush_object_changed_properties() function
- for each object separately after short timeout (currently 5 ms)
  which starts when first property in object is marked changed
2010-01-04 17:15:57 +02:00
Witold Sowa 75d328af50 dbus: Change BSS property MaxRate to Rates
Instead of exposing maximum BSS bit rate, expose sorted array
of all supported rates.
2010-01-04 16:52:30 +02:00
Jouni Malinen 58e1452474 dbus: Remove forgotten, unused functions from GetAll script 2010-01-04 16:35:38 +02:00
Jouni Malinen 777f07b62d dbus: Update example scripts to use PropertiesChanged
The StateChanged signal was removed, to use PropertiesChanged instead.
2010-01-04 16:34:06 +02:00
Marcel Holtmann 27f43d8de5 dbus: Replace StateChanged with PropertiesChanged signal
The actual supplicant state is exposed via a property on the interface
object. So having a separate signal StateChanged for notifying about
changes is a bad idea. The standard PropertiesChanged signal should be
used for this.

The advantage of StateChanged signal was that it includes the previous
state, but not even NetworkManager is making use of this. And tracking
the old state via the property and this signal is easily possible anyway.
2010-01-04 16:33:44 +02:00
Marcel Holtmann a2753c285f dbus: Use simple strings for debug level
Instead of using some magic integer values that really only mean
something to WPA internal code, just use simple strings. Possible
values are "msgdump", "debug", "info", "warning" and "error" which
map directly to WPA debugging support.
2010-01-04 16:22:26 +02:00
Jouni Malinen 9c3a2284de Fix compiler warnings for non-WPS build 2010-01-03 21:21:03 +02:00
Jouni Malinen abd9fafab6 Standardize on a single definition of auth_alg bitfield values 2010-01-03 21:14:40 +02:00
Jouni Malinen 70f8cc8ec8 Share the same enum for MFP configuration
The three existing enums were already depending on using the same
values in couple of places and it is just simpler to standardize on
one of these to avoid need for mapping between different enums for
the exact same thing.
2010-01-03 21:02:51 +02:00
Jouni Malinen d1f9c410c1 Remove src/drivers/scan_helpers.c
Most of this file was already moved into wpa_supplicant/scan.c and
we can remove the file completely by having couple of small helper
functions copied to the remaining users outside core wpa_supplicant
code.
2010-01-03 20:27:32 +02:00
Jouni Malinen 9ba9fa07cc Move wpa_supplicant specific scan code away from src/drivers
This fits better in wpa_supplicant/scan.c. Couple of remaining
scan_helpers.c functions are currently used in driver wrappers,
but they can likely be removed in the future.
2010-01-03 18:48:11 +02:00
Jouni Malinen 1d041bec84 Use generic driver event notification for AP mode assoc/disassoc 2010-01-03 18:22:22 +02:00
Jouni Malinen a8e0505bf0 Use driver event, EVENT_EAPOL_RX, for EAPOL frame indication 2010-01-03 17:44:40 +02:00
Jouni Malinen 55777702cd Add driver API functionality for off-channel Action frames
This adds new commands and events for allowing off-channel Action
frame exchanges to be requested. This functionality is not yet used
and is only fully supported by driver_test.c at this point.
driver_nl80211.c has support for the remain-on-channel commands, but
the Action frame TX/RX part is still pending review for the kernel
code and as such, is not yet included here.
2010-01-03 13:57:51 +02:00
Jouni Malinen 7bfc47c34f Add driver ops for allocating interface addresses
This adds placeholder code for allowing the virtual interfaces to be
pre-allocated a MAC address before the interface type is known with
drivers that do not handle interface type changes.
2010-01-03 13:42:06 +02:00
Jouni Malinen 504e905c6e Add a driver op for enabling Probe Request reporting in station mode 2010-01-03 13:30:22 +02:00
Jouni Malinen 9646a8ab8b Remove unnecessary wpa_event_type typedef 2010-01-03 13:10:12 +02:00
Jouni Malinen fdbe50ed98 Fix CONFIG_AP=y build after driver API changes 2010-01-03 13:05:54 +02:00
Jouni Malinen 2a8b74163e Move struct hostapd_frame_info definition away from driver API
This is internal data structure for hostapd/AP functionality and does
not need to be defined in driver.h.
2010-01-03 12:37:02 +02:00
Jouni Malinen 245519e0cd Replace wpa_supplicant_sta_rx() call with driver event
Get rid of wpa_supplicant_sta_rx() and add a new driver event that is
marked to be used only with driver_test.c. In addition, remove this
functionality from privsep wrapper. This is only use for client mode
MLME testing with driver_test.c.
2010-01-03 11:50:26 +02:00
Jouni Malinen 7d7d57b2dc Use shared function for figuring out if BSS is in use
The BSS that is currently in use must not be freed even if it does
not show up in scan results.
2010-01-03 10:55:31 +02:00
Jouni Malinen 1c83b67efd Fix memory corruption on BSS entry reallocation
The wpa_s->bss_id list was being corrupted when the BSS entry needed
to be reallocated due to longer IE data. The entry has to be removed
from all lists before reallocation to avoid this (it was only removed
from the wpa_s->bss list).
2010-01-03 01:25:43 +02:00
Jouni Malinen 2f1a90188c dbus: Use free_dbus_object_desc() consistently to free object descriptor 2010-01-03 01:01:56 +02:00
Jouni Malinen e90bd80cf5 dbus: Remove duplication of object methods/signals/properties
There is no need to duplicate the method/signal/property arrays that
were registered for objects. The registration was using static arrays
on methods/signals/properties in all places and we can as well use
those throughout without having to allocate memory and copy all the
entries for every object. This reduces number of allocations and
amount of unnecessary code quite a bit.
2010-01-03 00:52:30 +02:00
Jouni Malinen 3e87bd5478 dbus: Use stack for temporary object path
This is small enough buffer to not require more complex dynamic
allocation for temporary use.
2010-01-02 17:17:00 +02:00
Jouni Malinen 8f770587d9 Maintain a pointer to the current BSS table entry 2010-01-02 16:59:19 +02:00
Jouni Malinen a1fd2ce54e Do not store raw scan results
Use scan results to update the BSS table and to select the BSS for
connection, but do not store the results for longer time.
2010-01-02 16:41:38 +02:00
Jouni Malinen 6fa81a3b3f Use BSS table entry instead of raw scan result for connection 2010-01-02 16:16:02 +02:00
Jouni Malinen e48f0fb6a7 Use BSS table for WPA get-Beacon-IEs operation 2010-01-02 15:26:50 +02:00
Jouni Malinen 16b71ac217 Convert ctrl_iface scan_results cmd to use BSS table 2010-01-02 15:19:35 +02:00
Jouni Malinen 9734dc17b6 dbus: Use BSS table instead of raw scan results in older API
Change the old D-Bus API to use the new BSS table instead of raw
scan results.
2010-01-02 15:13:25 +02:00
Jouni Malinen 8d923a4acf Only expire scanned BSSes based on new scan results
Get more information about scans when updating BSS table information.
This allows the missing-from-scans expiration rule to work properly
when only partial set of channels or SSIDs are being scanned.
2010-01-02 13:57:44 +02:00
Jouni Malinen 59f2caa925 WPS: Use BSS table instead of raw scan results 2010-01-02 13:36:12 +02:00
Jouni Malinen 88ba1f7213 dbus: Cleaned up signal message construction functions 2010-01-02 12:06:44 +02:00
Jouni Malinen fff9ab1b2d dbus: Simplify _wpa_dbus_dict_fill_value_from_variant() a bit 2010-01-02 10:59:51 +02:00
Jouni Malinen 97d3f8c3a9 dbus: Share the same function for type to type-as-string conversion 2010-01-02 10:45:03 +02:00
Jouni Malinen c221499782 dbus: Use common code for checking key parameter
No need to duplicate the check into many functions.
2010-01-02 10:39:19 +02:00
Jouni Malinen 6c68b0db5d dbus: Fix WPS ProcessCredentials property setter to use Boolean
The incorrect type used with property setter call did not allow
the property to be modified.
2010-01-01 23:06:10 +02:00
Jouni Malinen ec99cb7b00 dbus: Add debug printing on property setter type mismatches 2010-01-01 23:05:44 +02:00
Jouni Malinen 2fd13f1bae dbus: Set ProcessCredentials to get WPS Credential signal 2010-01-01 23:04:27 +02:00
Jouni Malinen 1701996209 dbus: Add example script for running WPS PBC 2010-01-01 22:34:15 +02:00
Jouni Malinen d8d8c6d02a dbus: Split wpas_dbus_handler_wps_start() into helper functions 2010-01-01 22:33:47 +02:00
Jouni Malinen db9a76c032 dbus: Fix a typo in function name (invald -> invalid) 2010-01-01 21:52:29 +02:00
Jouni Malinen f65a5b7598 dbus: Fix init-failure-detection
This was broken in previous cleanup.
2010-01-01 21:30:58 +02:00
Jouni Malinen ccafcbed32 dbus: Cleaned up initialization and integration with eloop 2010-01-01 21:21:20 +02:00
Jouni Malinen c2b8c674cb dbus: Remove perror() calls
The perror() calls do not make much sense with libdbus functions and
wpa_printf() would really be used for all error printing anyway. In
addition, many of the error messages on out-of-memory cases are not
really of much use, so they were removed. This is also cleaning up
some of the error path handling to avoid duplicated code.
2010-01-01 20:50:12 +02:00
Jouni Malinen c49cf2d68f dbus: Clean up dbus_path/dbus_new_path use
These cannot be NULL, so there is no point in checking for that. In
addition, the accessor function for this is just making the code harder
to understand.
2010-01-01 19:12:31 +02:00
Jouni Malinen 1912049828 dbus: Get rid of unnecessary string duplication in dbus_path
There is no point in making it so complex to initialize a string
with two allocations and a function call.
2010-01-01 18:56:07 +02:00
Jouni Malinen 52bdd880a3 dbus: Remove wpas_dbus_callbacks abstraction
This callback structure was specific to the new D-Bus API which makes
it more or less pointless. It is just simpler to call the notification
functions directly. More proper design could be to use a generic
mechanism for registering notification callbacks into notify.c, but
that is not yet available and should not be designed just based on a
single user.
2010-01-01 18:45:29 +02:00
Jouni Malinen bad0dc3c0c dbus: Do not include libdbus dbus/dbus.h into dbus_{old,new}.h
These header files are included outside the dbus subdirectory and there
is not really any need to force the libdbus dbus/dbus.h header file to
be included into these files.
2010-01-01 18:20:05 +02:00
Jouni Malinen 36b5c6871c dbus: Move the SIGPOLL FreeBSD compat code into dbus_common.c
No point in storing this in header files anymore since SIGPOLL is only
used in dbus_common.c.
2010-01-01 18:16:24 +02:00
Jouni Malinen 00a4784d24 dbus: Get rid of unused static inline functions 2010-01-01 18:14:44 +02:00
Jouni Malinen d316584c6a dbus: Optimize introspection to use single pass for interfaces
There is no need to go through methods, signals, and properties in
two loops and only collect interfaces in the first run. Get rid of
unnecessary CPU use by generating the XML data for interfaces with
a single pass.
2010-01-01 18:08:23 +02:00
Jouni Malinen ce4f7fdbdd dbus: Get rid of libxml2 dependency with introspection
The XML used in D-Bus introspection is simple and there is no need to use
libxml2 to generate it. This gets rid of the dependency on the large
library by using internal XML generation.
2010-01-01 17:51:15 +02:00
Jouni Malinen 21e338a860 dbus: Split extract_interfaces() into helper functions 2010-01-01 15:50:00 +02:00
Jouni Malinen de7a79ceb6 dbus: Cleanup and fix loops
Simpler to use for loops instead of handling next pointer selection
in all places. In addition, couple of functions could have ended up
in an infinite loop on error path since the pointer update was missed.
2010-01-01 14:25:25 +02:00
Jouni Malinen 4292b01322 dbus: Use strdup instead of malloc+strncpy 2010-01-01 14:15:12 +02:00
Jouni Malinen 04551ee6d6 dbus: Move introspection support into a separate file 2010-01-01 14:03:00 +02:00
Jouni Malinen 64bde6d730 dbus: Use CONFIG_DBUS instead of old||new 2010-01-01 13:26:56 +02:00
Jouni Malinen 094e9ea1d7 dbus: Remove unnecessary ifdef CONFIG_CTRL_IFACE_DBUS_NEW
This header file is only included if the new D-Bus API is enabled.
2010-01-01 13:18:37 +02:00
Jouni Malinen e7f7d231a4 dbus: Fix example get-list-of-interfaces operation 2010-01-01 13:16:33 +02:00
Jouni Malinen 70993cd8e2 dbus: Update example script to use the new API 2010-01-01 13:10:09 +02:00
Witold Sowa db9133acb2 dbus: Divide DebugParams property to three separate properties 2010-01-01 13:00:22 +02:00
Witold Sowa b7e8feec68 dbus: Rename InterfaceCreated to InterfaceAdded
Change signal name to the one defined in documentation and
introspection data.
2010-01-01 12:49:27 +02:00
Witold Sowa e376f1193b dbus: Add second properties arg to *Added signals
Add a dictionary argument containing all properties of the newly added
object to BSSAdded, NetworkAdded, and InterfaceAdded signals.
2010-01-01 12:47:59 +02:00
Witold Sowa 58605c6e61 dbus: Replace BSS 'Properties' property with separate properties
In addition, remove Quality and Noise properties since the BSS table
is not the correct place for fetching per-channel information (Noise)
and Quality is not well-defined (nor available from many drivers).
2010-01-01 12:28:24 +02:00
Jouni Malinen 21e210fc99 dbus: Fix get_all_properties() to handle NULL return from getter
This needs to avoid trying to add the NULL entry into the D-Bus
message since libdbus will make the program terminate in such a case.
2010-01-01 12:27:10 +02:00
Witold Sowa fcea0b7d1d dbus: Add generic properties getter and setter 2010-01-01 11:56:56 +02:00
Witold Sowa 1fa5995b51 dbus: Define priv argument for object rather than for method
We don't actually need to define separate user_data argument for
each method handler and property getter/setter. Instead, we can define
one argument for the whole object. That will make it easier to register
objects like BSS or Networks which require allocating and freeing
memory for their arguments.
2010-01-01 11:33:41 +02:00
Jouni Malinen d84c8f1413 dbus: Add example script for fetching all properties with Getall 2010-01-01 11:00:11 +02:00
Jouni Malinen bacfd05fe5 dbus: Rename old D-Bus API files to include "_old"
This makes it easier to figure out which file is used by which
D-Bus interface.
2009-12-31 21:55:32 +02:00
Jouni Malinen 26e054ce6b dbus: Do not deinitialize new D-Bus API if it is not initialized
This fixes a crash on error path when D-Bus initialization fails.
2009-12-31 21:50:12 +02:00
Jouni Malinen 8ddef94bd4 dbus: Share common initialization code for both old and new interface
This was mostly identical code that had been copied for the new D-Bus
API implementation and as such, should really have been shared from
the beginning. In addition, the copied code ended up generating
interesting stack traces since the actual D-Bus connection was being
shared even though the pointer to it was stored in two distinct
data structures. The old D-Bus code ended up dispatching some
D-Bus callbacks which ended up running the new D-Bus code.

Since the private context pointers were mostly identical, everything
seemed to more or less work, but this design was just making things
more complex and potentially very easy to break.
2009-12-31 00:15:56 +02:00
Jouni Malinen 0474686514 Fix couple of memory leaks in wpa_config_get_all() 2009-12-30 22:37:23 +02:00
Jouni Malinen 1179cb834d wpa_gui-qt4: Update BSS entries in Peers dialog dynamically
Use the new BSS added/removed events to add/remove BSS (AP) entries
in the Peers dialog.
2009-12-30 22:18:18 +02:00
Jouni Malinen ba96adb65f dbus: Verify dbus_message_new_method_return() return value before use 2009-12-29 23:46:50 +02:00
Jouni Malinen 8e56d18993 dbus: Fix D-Bus network and BSS object registration/unregistration
Do not try to unregister BSS objects twice (the latter one with invalid
path) and make sure all network objects get added and removed properly
(the ones read from configuration file were not being registered, but
were tried to be unregistered).
2009-12-29 22:17:18 +02:00
Jouni Malinen c2f5126941 WPS: Add Enrollee-seen event message and wpa_gui-qt4 Peers entry
This can be used to show active Enrollees in AP mode to make it
easier to provision a new device.
2009-12-28 16:24:04 +02:00
Jouni Malinen f7e5436502 WPS: Clear SSID selection if more than one BSSID match is found
Need to use wildcard SSID matching for WPS connection if the same
BSSID occurs multiple time in scan results since any of the SSIDs
may be used.
2009-12-28 16:07:15 +02:00
Jouni Malinen d7dcba70bc Define struct wpa_ssid::mode as an enum with more readable values 2009-12-28 16:00:36 +02:00
Jouni Malinen bd1af96ad1 Add [ESS] flag for scan/BSS info from ctrl_iface 2009-12-28 13:35:51 +02:00
Jouni Malinen d009a9dac6 Add scan parameter support for client MLME 2009-12-28 13:34:03 +02:00
Jouni Malinen 4832ecd754 Add an option for driver wrappers to report operational frequency 2009-12-28 13:23:13 +02:00
Jouni Malinen d566f4152f Fix wpa_cli with libreadline and WPA_TRACE to use consistent alloc
Need to use strdup(), not os_strdup() here since the readline/fgets
result needs to use same style for memory allocation to avoid WPA_TRACE
errors.
2009-12-28 12:13:52 +02:00
Jouni Malinen e5fc8c8ce5 Fix crash on BSS deinit getting called before BSS init 2009-12-28 12:11:23 +02:00
Jouni Malinen 34359a3fb1 Include BSS table unconditionally in the wpa_supplicant build
This will allow more cleanup to be done for scan results processing
since all code can now be made to depend on the BSS table instead of
the temporary scan results.

Once remaining code has been converted to use the BSS table, the new
scan results can be freed immediately after the BSS table has been
updated. In addition, filtering of BSS information should be added
to better support systems with limited resources. For now, memory
use can be limited by defining WPA_BSS_MAX_COUNT to be smaller.
Anyway, better filtering of results to only the configured networks
should be added to improve this.
2009-12-28 01:14:56 +02:00
Jouni Malinen ccd286d025 dbus: Use the new BSS table with the new D-Bus API
Replace the scan results -based implementation with the use of information
from the new BSS table maintained by wpa_supplicant to get a more stable
source of BSS data. Change the use of BSSID as the key for the BSS object
to use the BSS table unique identifier so that multi-SSID APs can be
handled properly.
2009-12-28 01:10:07 +02:00
Jouni Malinen 99a6a63f25 Add wpa_bss_get_max_rate() to match with old scan_res helpers 2009-12-28 01:09:32 +02:00