]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Remove hostapd dump_file functionality
authorJouni Malinen <j@w1.fi>
Thu, 2 Jan 2014 16:15:07 +0000 (18:15 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 2 Jan 2014 16:15:07 +0000 (18:15 +0200)
This debugging mechanism has now been deprecated by the control
interface commands that can be used to fetch same internal information
from hostapd in a more convenient way. Leave the empty USR1 signal
handler and configuration file parameter for backwards compatibility.
They can be removed in future versions of hostapd.

Signed-hostap: Jouni Malinen <j@w1.fi>

hostapd/Android.mk
hostapd/Makefile
hostapd/android.config
hostapd/config_file.c
hostapd/defconfig
hostapd/dump_state.c [deleted file]
hostapd/dump_state.h [deleted file]
hostapd/hostapd.conf
hostapd/main.c
src/ap/ap_config.c
src/ap/ap_config.h

index bc0273e0c50084e27413326a9bf7652a325d87aa..c6cdecf5ae7adc11d557cd76a9bf94c2bc43c60e 100644 (file)
@@ -137,8 +137,9 @@ OBJS += src/eapol_auth/eapol_auth_sm.c
 
 
 ifndef CONFIG_NO_DUMP_STATE
-# define HOSTAPD_DUMP_STATE to include SIGUSR1 handler for dumping state to
-# a file (undefine it, if you want to save in binary size)
+# define HOSTAPD_DUMP_STATE to include support for dumping internal state
+# through control interface commands (undefine it, if you want to save in
+# binary size)
 L_CFLAGS += -DHOSTAPD_DUMP_STATE
 OBJS += dump_state.c
 OBJS += src/eapol_auth/eapol_auth_dump.c
index 753781406ee7e51786f63a3fab4ffaa519322bfd..5bf91ba32c3288e2d437341a8eb7cf33d99c08ec 100644 (file)
@@ -119,10 +119,10 @@ LIBS_n += -lgcov
 endif
 
 ifndef CONFIG_NO_DUMP_STATE
-# define HOSTAPD_DUMP_STATE to include SIGUSR1 handler for dumping state to
-# a file (undefine it, if you want to save in binary size)
+# define HOSTAPD_DUMP_STATE to include support for dumping internal state
+# through control interface commands (undefine it, if you want to save in
+# binary size)
 CFLAGS += -DHOSTAPD_DUMP_STATE
-OBJS += dump_state.o
 OBJS += ../src/eapol_auth/eapol_auth_dump.o
 endif
 
index 51d6656f159fe6084608b35cb93f005b09b8922f..81a2e2cebd200ed005c11cf256415a46945868a1 100644 (file)
@@ -157,7 +157,7 @@ CONFIG_NO_RADIUS=y
 # Remove support for VLANs
 #CONFIG_NO_VLAN=y
 
-# Remove support for dumping state into a file on SIGUSR1 signal
+# Remove support for dumping internal state through control interface commands
 # This can be used to reduce binary size at the cost of disabling a debugging
 # option.
 #CONFIG_NO_DUMP_STATE=y
index fa1a7fb4bb258843f2e78b6cae2d0e40ecf5727e..41988345bdd4795f12074843bd657a822eee73d4 100644 (file)
@@ -1631,7 +1631,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                } else if (os_strcmp(buf, "logger_stdout") == 0) {
                        bss->logger_stdout = atoi(pos);
                } else if (os_strcmp(buf, "dump_file") == 0) {
-                       bss->dump_log_name = os_strdup(pos);
+                       wpa_printf(MSG_INFO, "Line %d: DEPRECATED: 'dump_file' configuration variable is not used anymore",
+                                  line);
                } else if (os_strcmp(buf, "ssid") == 0) {
                        bss->ssid.ssid_len = os_strlen(pos);
                        if (bss->ssid.ssid_len > HOSTAPD_MAX_SSID_LEN ||
index a9c8bdcef31dce8c92434be75b232103f85d975a..60f2c04ec0eb2a002cb8032d27cb5f6b5a3b18fc 100644 (file)
@@ -179,7 +179,7 @@ CONFIG_IPV6=y
 # Note: This requires libnl 3.1 or newer.
 #CONFIG_VLAN_NETLINK=y
 
-# Remove support for dumping state into a file on SIGUSR1 signal
+# Remove support for dumping internal state through control interface commands
 # This can be used to reduce binary size at the cost of disabling a debugging
 # option.
 #CONFIG_NO_DUMP_STATE=y
diff --git a/hostapd/dump_state.c b/hostapd/dump_state.c
deleted file mode 100644 (file)
index fb25c15..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * hostapd / State dump
- * Copyright (c) 2002-2009, Jouni Malinen <j@w1.fi>
- *
- * This software may be distributed under the terms of the BSD license.
- * See README for more details.
- */
-
-#include "utils/includes.h"
-#include <time.h>
-
-#include "utils/common.h"
-#include "eapol_auth/eapol_auth_sm.h"
-#include "eapol_auth/eapol_auth_sm_i.h"
-#include "eap_server/eap.h"
-#include "ap/hostapd.h"
-#include "ap/ap_config.h"
-#include "ap/sta_info.h"
-#include "dump_state.h"
-#include "ap/ap_drv_ops.h"
-
-
-static void ieee802_1x_dump_state(FILE *f, struct sta_info *sta)
-{
-       struct eapol_state_machine *sm = sta->eapol_sm;
-       char buf[4096];
-       int res;
-
-       if (sm == NULL)
-               return;
-       res = eapol_auth_dump_state(sm, buf, sizeof(buf));
-       if (res > 0)
-               fprintf(f, "%s", buf);
-}
-
-
-/**
- * hostapd_dump_state - SIGUSR1 handler to dump hostapd state to a text file
- */
-static void hostapd_dump_state(struct hostapd_data *hapd)
-{
-       FILE *f;
-       time_t now;
-       struct sta_info *sta;
-
-       if (!hapd->conf->dump_log_name) {
-               wpa_printf(MSG_DEBUG, "Dump file not defined - ignoring dump "
-                          "request");
-               return;
-       }
-
-       wpa_printf(MSG_DEBUG, "Dumping hostapd state to '%s'",
-                  hapd->conf->dump_log_name);
-       f = fopen(hapd->conf->dump_log_name, "w");
-       if (f == NULL) {
-               wpa_printf(MSG_WARNING, "Could not open dump file '%s' for "
-                          "writing.", hapd->conf->dump_log_name);
-               return;
-       }
-
-       time(&now);
-       fprintf(f, "hostapd state dump - %s", ctime(&now));
-
-       for (sta = hapd->sta_list; sta != NULL; sta = sta->next) {
-               fprintf(f, "\nSTA=" MACSTR "\n", MAC2STR(sta->addr));
-               ieee802_1x_dump_state(f, sta);
-       }
-
-       fclose(f);
-}
-
-
-int handle_dump_state_iface(struct hostapd_iface *iface, void *ctx)
-{
-       size_t i;
-
-       for (i = 0; i < iface->num_bss; i++)
-               hostapd_dump_state(iface->bss[i]);
-
-       return 0;
-}
diff --git a/hostapd/dump_state.h b/hostapd/dump_state.h
deleted file mode 100644 (file)
index a209d65..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * hostapd / State dump
- * Copyright (c) 2002-2009, Jouni Malinen <j@w1.fi>
- *
- * This software may be distributed under the terms of the BSD license.
- * See README for more details.
- */
-
-#ifndef DUMP_STATE_H
-#define DUMP_STATE_H
-
-int handle_dump_state_iface(struct hostapd_iface *iface, void *ctx);
-
-#endif /* DUMP_STATE_H */
index 9b70d0fbe8321a8d9d181bade178de40dc652937..da7817f423c7e68e3bc2dfe89396f5621fb97648 100644 (file)
@@ -51,9 +51,6 @@ logger_syslog_level=2
 logger_stdout=-1
 logger_stdout_level=2
 
-# Dump file for state information (on SIGUSR1)
-dump_file=/tmp/hostapd.dump
-
 # Interface for separate control program. If this is specified, hostapd
 # will create this directory and a UNIX domain socket for listening to requests
 # from external programs (CLI/GUI, etc.) for status information and
index 196bccc7108b3ed5244ec429fa83682df0c38b47..edb5a11d3c4a25fa358d1df271cf0535684f5888 100644 (file)
@@ -25,7 +25,6 @@
 #include "ap/ap_drv_ops.h"
 #include "config_file.h"
 #include "eap_register.h"
-#include "dump_state.h"
 #include "ctrl_iface.h"
 
 
@@ -295,10 +294,7 @@ static void handle_reload(int sig, void *signal_ctx)
 
 static void handle_dump_state(int sig, void *signal_ctx)
 {
-#ifdef HOSTAPD_DUMP_STATE
-       struct hapd_interfaces *interfaces = signal_ctx;
-       hostapd_for_each_interface(interfaces, handle_dump_state_iface, NULL);
-#endif /* HOSTAPD_DUMP_STATE */
+       /* Not used anymore - ignore signal */
 }
 #endif /* CONFIG_NATIVE_WINDOWS */
 
index 5033c5567cb272636deaac58603e4ab022def668..a29f4d0e0b87c4659fa17b2f2f1849ba95e32c1c 100644 (file)
@@ -433,7 +433,6 @@ void hostapd_config_free_bss(struct hostapd_bss_config *conf)
        }
        os_free(conf->eap_user_sqlite);
 
-       os_free(conf->dump_log_name);
        os_free(conf->eap_req_id_text);
        os_free(conf->accept_mac);
        os_free(conf->deny_mac);
index 09b2778e0ddb9cdbbb17e6036e6598ca322c6398..af30ac49a24c564ee65183c4711b240e2b4f791f 100644 (file)
@@ -189,8 +189,6 @@ struct hostapd_bss_config {
        unsigned int logger_syslog; /* module bitfield */
        unsigned int logger_stdout; /* module bitfield */
 
-       char *dump_log_name; /* file name for state dump (SIGUSR1) */
-
        int max_num_sta; /* maximum number of STAs in station table */
 
        int dtim_period;