Commit Graph

503 Commits

Author SHA1 Message Date
Felix Fietkau fbbfcbac29 hostapd: Add WDS (4-address frame) mode with per-station interfaces
This mode allows associated stations to use 4-address frames to allow
layer 2 bridging to be used. At least for the time being, this is only
supported with driver=nl80211.
2009-12-24 11:46:22 +02:00
Jouni Malinen 96603e4fe1 Comment CONFIG_WPA_TRACE_BFD=y out by default 2009-12-23 23:20:11 +02:00
Jouni Malinen 79d6c85ffd Fix memory leak in config freeing
Both supported_rates and basic_rates arrays must be freed when freeing
hostapd configuration.
2009-12-21 22:22:49 +02:00
Jouni Malinen 094393b144 Copy config_methods and device_type configuration for AP mode 2009-12-21 16:10:21 +02:00
Jouni Malinen c0e4dd9eeb WPS: Make Config Methods configurable for wpa_supplicant
This adds config_methods configuration option for wpa_supplicant
following the design used in hostapd. In addition, the string is
now parsed in common code from src/wps/wps_common.c and the list
of configurable methods include all the defined methods from
WPS 1.0h spec.
2009-12-21 15:59:25 +02:00
Jouni Malinen f3f2eeba01 WPS: Add option for forcing Registrar to use PSK format in Credential
The use_psk_key parameter can now be used to force the Registrar to
use PSK format instead of ASCII passphrase when building a Credential
for the Enrollee. For now, this is not enabled, but it could be enabled
either based on external (to WPS) configuration or automatically set
based on some WPS attribute values from the Enrollee.
2009-12-21 12:46:19 +02:00
Jouni Malinen 0ae687bd10 AP: Allow both WPA passphrase and PSK to be configured
Instead of dropping the configured PSK and deriving it based on
passphrase, use the provided PSK as-is and also maintain a copy of
the passphrase since it can be of use later. This allows both values
to be configured without havign to derive the PSK every time the
network is initialized.
2009-12-21 12:11:08 +02:00
Jouni Malinen b22b41ee87 Describe tracing build options for developers 2009-12-20 23:41:06 +02:00
Jouni Malinen f2f7d965b8 Add option libbfd support for tracing code
CONFIG_WPA_TRACE=y and CONFIG_WPA_TRACE_BFD=y can now be used to get
even more complete symbols (func/file/line and inline functions) for
backtraces.
2009-12-20 23:35:06 +02:00
Jouni Malinen 3433ed8c03 hostapd_cli: Use os_program_{init,deinit} 2009-12-19 22:26:36 +02:00
Jouni Malinen fb4baa688b Add memory allocation analyzer to verify OS wrapper use
WPA_TRACE=y builds will now verify that memory allocation in done
consistently using os_{zalloc,malloc,realloc,strdup,free} (i.e., no
mixing of os_* functions and unwrapper functions). In addition, some
common memory allocation issues (double-free, memory leaks, etc.) are
detected automatically.
2009-12-19 21:47:56 +02:00
Jouni Malinen 80d77c31ff hostapd: Call os_program_{init,deinit}() 2009-12-19 20:55:17 +02:00
Jouni Malinen 0456ea16d8 eloop: Remove global user data pointer
This is not really needed since all signal handlers can use a context
pointer provided during signal handler registration.
2009-12-19 19:22:16 +02:00
Jouni Malinen 9969e5a46a Make hostapd_for_each_interface() take context pointer as argument
This removes need for using eloop_get_user_data().
2009-12-19 19:07:31 +02:00
Jouni Malinen 930f704aac Add backtrace support for debugging
WPA_TRACE=y can now be used to enable internal backtrace support that
will provide more details about implementation errors, e.g., when some
resources are not released correctly. In addition, this will print out
a backtrace automatically if SIGSEGV is received.
2009-12-19 18:40:54 +02:00
Jouni Malinen 1489e11a94 Make struct radius_msg private to radius.c
This is internal data structure for RADIUS message handling and
external code should not touch it directly.
2009-12-19 17:26:57 +02:00
Jouni Malinen 9e7245bdb4 Change radius_msg_free() to free the buffer
Since all callers were freeing the buffer immediately anyway, move
this operation into radius_msg_free() to reduce code size.
2009-12-19 16:34:41 +02:00
Jouni Malinen b57e086cc1 Mark management frame processing functions to use const buffer 2009-12-13 23:25:30 +02:00
Jouni Malinen ba091c06c5 Mark ieee802_11_parse_elems() input and parsed elems const
In addition, re-order IE pointers and u8 length so that the shorter
length fields are together to allow compiler to optimize structure size.
2009-12-13 23:11:11 +02:00
Jouni Malinen f8b1f69561 Use generic driver events for TX status and RX reporting
Replace driver wrapper calls to hostapd_tx_status(),
hostapd_rx_from_unknown_sta(), hostapd_mgmt_rx(), and
hostapd_mgmt_tx_cb() with new generic driver events
EVENT_TX_STATUS, EVENT_RX_FROM_UNKNOWN, and EVENT_RX_MGMT.

This cleans up lot of the driver wrapper code to be less dependent
on whether it is being used within wpa_supplicant AP mode or hostapd.
2009-12-13 23:05:39 +02:00
Jouni Malinen fcf0f87d97 Replace hostapd_button_pushed() with generic driver event 2009-12-13 21:21:10 +02:00
Jouni Malinen f2dab64ee3 Fix EVENT_FT_RRB_RX processing 2009-12-13 21:19:02 +02:00
Jouni Malinen 1cd973d501 Replace hostapd_michael_mic_failure() with generic driver event 2009-12-13 21:17:11 +02:00
Jouni Malinen 8043e72589 Add BSS ctx to if_add() driver op
This remove the need from driver_test.c to go through internal hostapd
structures to find the appropriate BSS when reporting events on secondary
BSSes.
2009-12-13 18:54:11 +02:00
Jouni Malinen 9b5d2b8b9c Merge hostapd/sta_flags.h into sta_info.h
The separate header file is not needed since none of the driver wrappers
include it anymore. Move the WLAN_STA_* definitions back to be together
with struct sta_info definition.
2009-12-13 11:41:46 +02:00
Jouni Malinen 0de39516ae Map STA flags into values defined in driver.h
This removes need for including hostapd/sta_flags.h into driver
wrappers and removes any remaining dependencies between driver flags
and internal hostapd flags.
2009-12-13 11:35:39 +02:00
Jouni Malinen a34325dde9 Remove unneeded hostapd_wmm_sta_config()
The WMM STA flag is already taken care of by handle_assoc_cb() and there
is no point trying to do this unless hostapd is taking care MLME
processing, so no need to call this from drv_callbacks.c.
2009-12-13 11:14:21 +02:00
Jouni Malinen 60c8cfb4fb Remove usused flags parameter from sta_add() driver op 2009-12-13 11:05:22 +02:00
Jouni Malinen af586419fd Add more WPA/IEEE 802.1X parameters into set_ieee8021x() driver op
This gets rid of the need to touch internal hostapd data structures
directly from the driver wrappers.
2009-12-12 23:50:29 +02:00
Jouni Malinen e3bd3912ca Change set_ieee8021x driver op to use parameters structure
This makes it easier to extent the set of parameters passed to
this driver wrapper function.
2009-12-12 23:32:44 +02:00
Jouni Malinen 08fd8c15a0 Replace direct driver call to wpa_ft_rrb_rx() with driver event
This avoids need to include hostapd/wpa.h into the driver wrappers.
2009-12-12 22:43:26 +02:00
Jouni Malinen 50b5bf4eda Remove obsolete Prism54.org driver support (driver_prism54.c)
The Prism54.org project seems have been dead for a while and it does not
look like this driver would ever be maintained again. Furthermore, it is
difficult to find a version that would work with the driver_prism54.c
wrapper and there is another driver for these card in the Linux kernel
tree.

The hostapd integration in driver_prism54.c is quite different from the
other driver wrappers and would require major effort to get it cleaned
up. Since there does not seem to be any real users for the cleaned up
version, there does not seem to be justification to spend this effort on
the wrapper. This old code is making it much more difficult to clean up
the driver interface and at this point, the best option seems to be to
remove the driver wrappers. Should someone really still need this, the
old code will continue to be available in hostapd 0.6.x.
2009-12-12 20:52:12 +02:00
Jouni Malinen 0531006644 driver_wired: Move STA entry processing away from driver wrapper
Get rid of hostapd/sta_info.h dependency by introducing a new driver
callback function for hostapd.
2009-12-12 20:39:25 +02:00
Jouni Malinen 7e683ceeb4 WPS: Handle Selected Registrar as a union of info from all Registrars
Instead of using the latest selected registrar change, collect selected
registrar information separately from all registrars and use the union
of this information when building the WPS IE for Beacon and Probe
Response frames.

Note: SetSelectedRegistrar UPnP action does not include a unique
identifier, so the ER matching routine is based only on the IP address
of the ER. In theory, there could be multiple ERs using the same IP
address (but different port or URL), so there may be some corner cases
that would not always match the correct ER entry at the AP. Anyway, this
is not really expected to occur in normal use cases and even if it did
happen, the selected registrar information is not any worse than it was
before when only the last change from any registrar for being
advertized.
2009-12-12 16:54:59 +02:00
Jouni Malinen 5e9c730a2b WPS: Remove unnecessary GetDevice and PutMessage callbacks
These callbacks can be handled internally within core WPS code, so there
is no need to go through wps_hostapd.c with a callback function that is
just calling back into the core WPS code.
2009-12-12 16:47:39 +02:00
Jouni Malinen d0d45d8276 WPS: Remove unnecessary SetSelectedRegistrar callback
This can be handled internally within core WPS code, so there is no
need to go through wps_hostapd.c with a callback function that is just
calling back into the core WPS code.
2009-12-12 16:46:33 +02:00
Jouni Malinen 50ceddcfd6 Fix dh_groups.o build for some configurations
Need to include dh_groups.o in the build even if not all DH groups
are included. Only internal crypto build case was doing this properly.
2009-12-11 17:24:42 +02:00
Jouni Malinen 616ea674c8 Fix hostapd build without RADIUS server 2009-12-11 16:29:28 +02:00
Jouni Malinen 9008a3e44d Merge get_seqnum_igtk() driver op with get_seqnum()
IEEE 802.11w uses distinct key indexes (4 and 5) so the same
get_seqnum() handler can be used to fetch packet number for both
TKIP/CCMP and BIP(using IGTK).

Since the new get_seqnum_igtk() handler was not actually implemented by
any driver wrapper, this may also fix BIP/IGTK sequence number reporting
with driver_nl80211.c.
2009-12-11 00:15:54 +02:00
Jouni Malinen 3484a18a13 hostapd: Remove unused bridge_packets configuration option
There was code for configuring this, but no driver wrapper actually
implements the actual setting. Remove this for now to reduce potential
confusion and to simply the driver interface.
2009-12-09 22:06:43 +02:00
Jouni Malinen fb7842aa51 Remove struct hostapd_rate_data from driver API
In addition to the bitrate, the only other variable in this structure
is used internally in hostapd. Move this structure into hostapd.h and
make the driver API use simpler data structure (array of bitrates).
2009-12-09 21:57:50 +02:00
Jouni Malinen 22a7c9d735 Merge bss_add/bss_remove drivers ops into if_add/if_remove
if_add/if_remove can now be used as the generic driver ops for adding
and removing virtual interfaces of various types. In addition,
driver_nl80211.c is now including this code unconditionally, so that
the functions are not limited only for hostapd.
2009-12-09 16:49:28 +02:00
Jouni Malinen b5996353e7 Remove unused if_update() driver op 2009-12-09 15:47:20 +02:00
Jouni Malinen 95272a888c Fix conditional EAP-SIM/AKA DB code selection 2009-12-06 19:48:25 +02:00
Jouni Malinen d45354be53 Move IEEE 802.11n HT management code into a separate file 2009-12-06 19:41:47 +02:00
Jouni Malinen eb53b752df Remove unnecessary CONFIG_IEEE80211N use 2009-12-06 19:17:54 +02:00
Jouni Malinen 644a8f2208 Remove unused phytype RX info variable 2009-12-06 18:54:58 +02:00
Jouni Malinen 22a7f39f23 Remove unused hostapd reconfig code 2009-12-06 18:48:30 +02:00
Jouni Malinen 5c90d47657 Move EAP-SIM DB conditional build into hostapd 2009-12-06 18:23:53 +02:00
Jouni Malinen 74784010af Remove conditional no-RADIUS build from src/radius
Make it responsibility of the src/radius user to handle conditional
build rules.
2009-12-06 17:53:59 +02:00