|
@@ -1746,6 +1746,45 @@ static int hostapd_ctrl_get_alloc_fail(struct hostapd_data *hapd,
|
|
#endif /* WPA_TRACE_BFD */
|
|
#endif /* WPA_TRACE_BFD */
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+static int hostapd_ctrl_test_fail(struct hostapd_data *hapd, char *cmd)
|
|
|
|
+{
|
|
|
|
+#ifdef WPA_TRACE_BFD
|
|
|
|
+ extern char wpa_trace_test_fail_func[256];
|
|
|
|
+ extern unsigned int wpa_trace_test_fail_after;
|
|
|
|
+ char *pos;
|
|
|
|
+
|
|
|
|
+ wpa_trace_test_fail_after = atoi(cmd);
|
|
|
|
+ pos = os_strchr(cmd, ':');
|
|
|
|
+ if (pos) {
|
|
|
|
+ pos++;
|
|
|
|
+ os_strlcpy(wpa_trace_test_fail_func, pos,
|
|
|
|
+ sizeof(wpa_trace_test_fail_func));
|
|
|
|
+ } else {
|
|
|
|
+ wpa_trace_test_fail_after = 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+#else /* WPA_TRACE_BFD */
|
|
|
|
+ return -1;
|
|
|
|
+#endif /* WPA_TRACE_BFD */
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+static int hostapd_ctrl_get_fail(struct hostapd_data *hapd,
|
|
|
|
+ char *buf, size_t buflen)
|
|
|
|
+{
|
|
|
|
+#ifdef WPA_TRACE_BFD
|
|
|
|
+ extern char wpa_trace_test_fail_func[256];
|
|
|
|
+ extern unsigned int wpa_trace_test_fail_after;
|
|
|
|
+
|
|
|
|
+ return os_snprintf(buf, buflen, "%u:%s", wpa_trace_test_fail_after,
|
|
|
|
+ wpa_trace_test_fail_func);
|
|
|
|
+#else /* WPA_TRACE_BFD */
|
|
|
|
+ return -1;
|
|
|
|
+#endif /* WPA_TRACE_BFD */
|
|
|
|
+}
|
|
|
|
+
|
|
#endif /* CONFIG_TESTING_OPTIONS */
|
|
#endif /* CONFIG_TESTING_OPTIONS */
|
|
|
|
|
|
|
|
|
|
@@ -2079,6 +2118,11 @@ static void hostapd_ctrl_iface_receive(int sock, void *eloop_ctx,
|
|
} else if (os_strcmp(buf, "GET_ALLOC_FAIL") == 0) {
|
|
} else if (os_strcmp(buf, "GET_ALLOC_FAIL") == 0) {
|
|
reply_len = hostapd_ctrl_get_alloc_fail(hapd, reply,
|
|
reply_len = hostapd_ctrl_get_alloc_fail(hapd, reply,
|
|
reply_size);
|
|
reply_size);
|
|
|
|
+ } else if (os_strncmp(buf, "TEST_FAIL ", 10) == 0) {
|
|
|
|
+ if (hostapd_ctrl_test_fail(hapd, buf + 10) < 0)
|
|
|
|
+ reply_len = -1;
|
|
|
|
+ } else if (os_strcmp(buf, "GET_FAIL") == 0) {
|
|
|
|
+ reply_len = hostapd_ctrl_get_fail(hapd, reply, reply_size);
|
|
#endif /* CONFIG_TESTING_OPTIONS */
|
|
#endif /* CONFIG_TESTING_OPTIONS */
|
|
} else if (os_strncmp(buf, "CHAN_SWITCH ", 12) == 0) {
|
|
} else if (os_strncmp(buf, "CHAN_SWITCH ", 12) == 0) {
|
|
if (hostapd_ctrl_iface_chan_switch(hapd->iface, buf + 12))
|
|
if (hostapd_ctrl_iface_chan_switch(hapd->iface, buf + 12))
|