Commit graph

535 commits

Author SHA1 Message Date
Jouni Malinen 1b56c26c40 Get rid of direct hostapd_for_each_interface() calls
src/ap/*.c must not call functions in hostapd or wpa_supplicant
directories directly, so avoid this by using a callback function
pointer.
2009-12-25 20:12:26 +02:00
Jouni Malinen 70db2ab308 Move rest of the generic AP mode functionality into src/ap 2009-12-25 20:06:07 +02:00
Jouni Malinen 8c5fe31fe8 Move driver deinitialization away from hostapd.c
This matches with the earlier change of moving driver initialization
and allows more control on how the driver context is managed.
2009-12-25 18:32:44 +02:00
Jouni Malinen a4f2110934 Clean up some of the hostapd.h function prototype definitions
Not all prototypes in hostapd.h really belong there. This is an initial
step in cleaning that up.
2009-12-25 14:20:35 +02:00
Jouni Malinen 0aef3ec832 Move hostapd_prune_associations() into ap/utils.c 2009-12-25 14:06:26 +02:00
Jouni Malinen c442055ecf Move WPA authenticator glue code into a separate file 2009-12-25 14:02:17 +02:00
Jouni Malinen 2586bc64d0 Move authentication server setup into separate file 2009-12-25 13:43:43 +02:00
Jouni Malinen ad44e244b1 Move iapp.c into src/ap 2009-12-25 13:04:45 +02:00
Jouni Malinen 0e2d35c614 Move ctrl_iface_ap.c into src/ap 2009-12-25 12:25:55 +02:00
Jouni Malinen e5f2b59c7e Move hostapd driver initialization away from hostapd.c
This makes it easier to customize AP mode initialization for
wpa_supplicant.
2009-12-25 12:21:11 +02:00
Jouni Malinen bee07ce805 hostapd: Do not call eloop_terminate() on interface setup failure
The caller is able to handle the error code properly and there is no
need to forcefully stop the eloop run here.
2009-12-25 11:51:20 +02:00
Jouni Malinen 32da61d9c9 Move wps_hostapd.c into src/ap 2009-12-25 01:26:37 +02:00
Jouni Malinen 1057d78eb8 Move generic AP functionality implementation into src/ap
This code can be shared by both hostapd and wpa_supplicant and this
is an initial step in getting the generic code moved to be under the
src directories. Couple of generic files still remain under the
hostapd directory due to direct dependencies to files there. Once the
dependencies have been removed, they will also be moved to the src/ap
directory to allow wpa_supplicant to be built without requiring anything
from the hostapd directory.
2009-12-25 01:12:50 +02:00
Jouni Malinen 6d1278e998 Remove direct driver calls from tkip_countermeasures.c 2009-12-25 00:39:22 +02:00
Jouni Malinen 2ce86d9d72 Remove direct driver calls from ieee802_11.c 2009-12-25 00:35:10 +02:00
Jouni Malinen bdee6fceb9 Remove direct driver calls from sta_info.c 2009-12-25 00:30:16 +02:00
Jouni Malinen 36592d31c1 Remove direct driver calls from vlan_init.c 2009-12-25 00:17:07 +02:00
Jouni Malinen 677449b97e Remove direct driver calls from beacon.c 2009-12-25 00:10:31 +02:00
Jouni Malinen 2f3e0bd4d4 Remove need for direct driver calls from ieee802_11_auth.c 2009-12-24 23:49:19 +02:00
Jouni Malinen d24df7c33d Avoid direct call to hostapd_new_assoc_sta from ieee802_11.c 2009-12-24 23:42:13 +02:00
Jouni Malinen a2de634d1c Removed hostapd_new_assoc_sta() from driver wrapper API
This is not called directly by any of the driver wrappers anymore, so
the function can be removed from driver.h and drv_callbacks.c.
2009-12-24 23:30:32 +02:00
Jouni Malinen 94709ea358 Avoid a direct call to drv_callbacks.c from beacon.c 2009-12-24 23:20:53 +02:00
Jouni Malinen 010401fe65 Move hostapd_set_drv_ieee8021x() into ap_drv_ops 2009-12-24 23:17:11 +02:00
Jouni Malinen 4c2ddda495 Move hostapd-to-driver flag mapping to be within ap_drv_ops.c 2009-12-24 23:11:16 +02:00
Jouni Malinen d3b86aed73 Move wpa_drivers dependency into config_file.c
This cleans up config.o from driver wrapper dependencies.
2009-12-24 22:50:17 +02:00
Jouni Malinen a3d4fafa41 Remove direct driver calls from accounting.c 2009-12-24 22:24:57 +02:00
Jouni Malinen 41d719d6e0 Move hostapd configuration parser into separate file
config.c includes now only the generic helper functions that are needed
both for hostapd and the AP mode operations in wpa_supplicant.
hostapd/config_file.c is only needed for hostapd.
2009-12-24 21:05:40 +02:00
Jouni Malinen 45cefa0bf3 Move more driver ops into struct hostapd_driver_ops
This removes need to include driver_i.h into ieee802_1x.c.
2009-12-24 20:41:30 +02:00
Jouni Malinen 579bc0e64c Move hostapd_set_privacy() call to hostapd.c
IEEE 802.1X code does not need to know about this driver configuration
mechanism and all the other calls were already in hostapd.c.
2009-12-24 20:18:55 +02:00
Jouni Malinen c90933d2a3 Use hostapd driver op wrapper for send_mgmt_frame 2009-12-24 20:13:44 +02:00
Jouni Malinen 14f7938660 Merge driver ops set_wps_beacon_ie and set_wps_probe_resp_ie
set_ap_wps_ie() is not used to set WPS IE for both Beacon and Probe
Response frames with a single call. In addition, struct wpabuf is used
instead of separate u8* and length fields. This avoids duplicated
allocation of the IEs and simplifies code in general.
2009-12-24 19:46:06 +02:00
Jouni Malinen bf65bc638f hostapd: Use separate driver operations abstraction
It would be bettet to avoid including driver_i.h, i.e., direct driver
operation calls from hostapd components. This is an initial step in
that direction for WPS IE updates.
2009-12-24 16:15:22 +02:00
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