hostapd: add a package for eapol_test
authorFelix Fietkau <nbd@openwrt.org>
Mon, 19 May 2014 21:58:48 +0000 (21:58 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 19 May 2014 21:58:48 +0000 (21:58 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 40782

package/network/services/hostapd/Makefile
package/network/services/hostapd/patches/200-multicall.patch

index 80e0082..9751af6 100644 (file)
@@ -225,6 +225,15 @@ define Package/hostapd-common-old
   CATEGORY:=Network
 endef
 
+define Package/eapol-test
+  TITLE:=802.1x authentication test utility
+  SECTION:=net
+  CATEGORY:=Network
+  VARIANT:=supplicant-full
+  DEPENDS:=$(DRV_DEPENDS)
+endef
+
+
 ifneq ($(wildcard $(PKG_BUILD_DIR)/.config_*),$(subst .configured_,.config_,$(STAMP_CONFIGURED)))
   define Build/Configure/rebuild
        $(FIND) $(PKG_BUILD_DIR) -name \*.o -or -name \*.a | $(XARGS) rm -f
@@ -309,8 +318,15 @@ define Build/Compile/supplicant
        )
 endef
 
+define Build/Compile/supplicant-full
+       $(call Build/RunMake,wpa_supplicant, \
+               eapol_test \
+       )
+endef
+
 define Build/Compile
        $(Build/Compile/$(LOCAL_TYPE))
+       $(Build/Compile/$(BUILD_VARIANT))
 endef
 
 define Install/hostapd
@@ -369,6 +385,13 @@ ifneq ($(LOCAL_TYPE),hostapd)
   endef
 endif
 
+ifeq ($(BUILD_VARIANT),supplicant-full)
+  define Package/eapol-test/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(CP) $(PKG_BUILD_DIR)/wpa_supplicant/eapol_test $(1)/usr/sbin/
+  endef
+endif
+
 $(eval $(call BuildPackage,hostapd))
 $(eval $(call BuildPackage,hostapd-mini))
 $(eval $(call BuildPackage,wpad))
@@ -380,3 +403,4 @@ $(eval $(call BuildPackage,wpa-cli))
 $(eval $(call BuildPackage,hostapd-utils))
 $(eval $(call BuildPackage,hostapd-common))
 $(eval $(call BuildPackage,hostapd-common-old))
+$(eval $(call BuildPackage,eapol-test))
index 1511b19..b485895 100644 (file)
  #ifdef CONFIG_DRIVER_WEXT
  extern struct wpa_driver_ops wpa_driver_wext_ops; /* driver_wext.c */
  #endif /* CONFIG_DRIVER_WEXT */
+--- a/wpa_supplicant/eapol_test.c
++++ b/wpa_supplicant/eapol_test.c
+@@ -28,8 +28,12 @@
+ #include "ctrl_iface.h"
+ #include "pcsc_funcs.h"
+ #include "wpas_glue.h"
++#include "drivers/driver.h"
++void (*wpa_supplicant_event)(void *ctx, enum wpa_event_type event,
++                           union wpa_event_data *data);
++
+ struct wpa_driver_ops *wpa_drivers[] = { NULL };
+@@ -1140,6 +1144,8 @@ static void usage(void)
+              "option several times.\n");
+ }
++extern void supplicant_event(void *ctx, enum wpa_event_type event,
++                           union wpa_event_data *data);
+ int main(int argc, char *argv[])
+ {
+@@ -1158,6 +1164,7 @@ int main(int argc, char *argv[])
+       if (os_program_init())
+               return -1;
++      wpa_supplicant_event = supplicant_event;
+       hostapd_logger_register_cb(hostapd_logger_cb);
+       os_memset(&eapol_test, 0, sizeof(eapol_test));