]> git.ipfire.org Git - thirdparty/hostap.git/blobdiff - hostapd/hostapd.c
Make HOSTAPD_DUMP_STATE configurable with CONFIG_NO_DUMP_STATE
[thirdparty/hostap.git] / hostapd / hostapd.c
index 47986b71c8e10d1e199caf31c22a78d857ebcb40..7799316c6b6e364d6023ac4c7c8d9628dbd13a3d 100644 (file)
@@ -190,119 +190,6 @@ int handle_reload_iface(struct hostapd_iface *iface, void *ctx)
 }
 
 
-#ifdef HOSTAPD_DUMP_STATE
-/**
- * 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;
-       int i;
-       char *buf;
-
-       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));
-       fprintf(f, "num_sta=%d num_sta_non_erp=%d "
-               "num_sta_no_short_slot_time=%d\n"
-               "num_sta_no_short_preamble=%d\n",
-               hapd->num_sta, hapd->iface->num_sta_non_erp,
-               hapd->iface->num_sta_no_short_slot_time,
-               hapd->iface->num_sta_no_short_preamble);
-
-       for (sta = hapd->sta_list; sta != NULL; sta = sta->next) {
-               fprintf(f, "\nSTA=" MACSTR "\n", MAC2STR(sta->addr));
-
-               fprintf(f,
-                       "  AID=%d flags=0x%x %s%s%s%s%s%s%s%s%s%s%s%s%s%s\n"
-                       "  capability=0x%x listen_interval=%d\n",
-                       sta->aid,
-                       sta->flags,
-                       (sta->flags & WLAN_STA_AUTH ? "[AUTH]" : ""),
-                       (sta->flags & WLAN_STA_ASSOC ? "[ASSOC]" : ""),
-                       (sta->flags & WLAN_STA_PS ? "[PS]" : ""),
-                       (sta->flags & WLAN_STA_TIM ? "[TIM]" : ""),
-                       (sta->flags & WLAN_STA_PERM ? "[PERM]" : ""),
-                       (sta->flags & WLAN_STA_AUTHORIZED ? "[AUTHORIZED]" :
-                        ""),
-                       (sta->flags & WLAN_STA_PENDING_POLL ? "[PENDING_POLL" :
-                        ""),
-                       (sta->flags & WLAN_STA_SHORT_PREAMBLE ?
-                        "[SHORT_PREAMBLE]" : ""),
-                       (sta->flags & WLAN_STA_PREAUTH ? "[PREAUTH]" : ""),
-                       (sta->flags & WLAN_STA_WMM ? "[WMM]" : ""),
-                       (sta->flags & WLAN_STA_MFP ? "[MFP]" : ""),
-                       (sta->flags & WLAN_STA_WPS ? "[WPS]" : ""),
-                       (sta->flags & WLAN_STA_MAYBE_WPS ? "[MAYBE_WPS]" : ""),
-                       (sta->flags & WLAN_STA_NONERP ? "[NonERP]" : ""),
-                       sta->capability,
-                       sta->listen_interval);
-
-               fprintf(f, "  supported_rates=");
-               for (i = 0; i < sta->supported_rates_len; i++)
-                       fprintf(f, "%02x ", sta->supported_rates[i]);
-               fprintf(f, "\n");
-
-               fprintf(f,
-                       "  timeout_next=%s\n",
-                       (sta->timeout_next == STA_NULLFUNC ? "NULLFUNC POLL" :
-                        (sta->timeout_next == STA_DISASSOC ? "DISASSOC" :
-                         "DEAUTH")));
-
-               ieee802_1x_dump_state(f, "  ", sta);
-       }
-
-       buf = os_malloc(4096);
-       if (buf) {
-               int count = radius_client_get_mib(hapd->radius, buf, 4096);
-               if (count < 0)
-                       count = 0;
-               else if (count > 4095)
-                       count = 4095;
-               buf[count] = '\0';
-               fprintf(f, "%s", buf);
-
-               count = radius_server_get_mib(hapd->radius_srv, buf, 4096);
-               if (count < 0)
-                       count = 0;
-               else if (count > 4095)
-                       count = 4095;
-               buf[count] = '\0';
-               fprintf(f, "%s", buf);
-               os_free(buf);
-       }
-       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;
-}
-#endif /* HOSTAPD_DUMP_STATE */
-
-
 static void hostapd_broadcast_key_clear_iface(struct hostapd_data *hapd,
                                              char *ifname)
 {