Add new debug message level for excessive information
authorJouni Malinen <j@w1.fi>
Mon, 5 Jul 2010 19:21:48 +0000 (12:21 -0700)
committerJouni Malinen <j@w1.fi>
Mon, 5 Jul 2010 19:21:48 +0000 (12:21 -0700)
Some frequent debug prints are of limited use and make debug output
difficult to read. Make them use a new debug level so that -dd
provides more readable output (-ddd can now be used to enable
the excessive debug prints).

src/ap/beacon.c
src/ap/ieee802_11.c
src/common/ieee802_11_common.c
src/utils/wpa_debug.h

index bdc2c0a..9091c2f 100644 (file)
@@ -256,8 +256,9 @@ void handle_probe_req(struct hostapd_data *hapd,
                        ieee802_11_print_ssid(ssid_txt, elems.ssid,
                                              elems.ssid_len);
                        wpa_printf(MSG_MSGDUMP, "Probe Request from " MACSTR
-                                  " for foreign SSID '%s'",
-                                  MAC2STR(mgmt->sa), ssid_txt);
+                                  " for foreign SSID '%s' (DA " MACSTR ")",
+                                  MAC2STR(mgmt->sa), ssid_txt,
+                                  MAC2STR(mgmt->da));
                }
                return;
        }
@@ -332,7 +333,7 @@ void handle_probe_req(struct hostapd_data *hapd,
 
        os_free(resp);
 
-       wpa_printf(MSG_MSGDUMP, "STA " MACSTR " sent probe request for %s "
+       wpa_printf(MSG_EXCESSIVE, "STA " MACSTR " sent probe request for %s "
                   "SSID", MAC2STR(mgmt->sa),
                   elems.ssid_len == 0 ? "broadcast" : "our");
 }
index 4d7d885..166de44 100644 (file)
@@ -1689,7 +1689,7 @@ void ieee802_11_mgmt_cb(struct hostapd_data *hapd, const u8 *buf, size_t len,
                handle_assoc_cb(hapd, mgmt, len, 1, ok);
                break;
        case WLAN_FC_STYPE_PROBE_RESP:
-               wpa_printf(MSG_DEBUG, "mgmt::proberesp cb");
+               wpa_printf(MSG_EXCESSIVE, "mgmt::proberesp cb");
                break;
        case WLAN_FC_STYPE_DEAUTH:
                /* ignore */
index 96ef5b6..dc88568 100644 (file)
@@ -75,7 +75,7 @@ static int ieee802_11_parse_vendor_specific(const u8 *pos, size_t elen,
                                elems->wmm_tspec_len = elen;
                                break;
                        default:
-                               wpa_printf(MSG_MSGDUMP, "unknown WMM "
+                               wpa_printf(MSG_EXCESSIVE, "unknown WMM "
                                           "information element ignored "
                                           "(subtype=%d len=%lu)",
                                           pos[4], (unsigned long) elen);
@@ -88,9 +88,9 @@ static int ieee802_11_parse_vendor_specific(const u8 *pos, size_t elen,
                        elems->wps_ie_len = elen;
                        break;
                default:
-                       wpa_printf(MSG_MSGDUMP, "Unknown Microsoft "
+                       wpa_printf(MSG_EXCESSIVE, "Unknown Microsoft "
                                   "information element ignored "
-                                  "(type=%d len=%lu)\n",
+                                  "(type=%d len=%lu)",
                                   pos[3], (unsigned long) elen);
                        return -1;
                }
@@ -103,18 +103,18 @@ static int ieee802_11_parse_vendor_specific(const u8 *pos, size_t elen,
                        elems->vendor_ht_cap_len = elen;
                        break;
                default:
-                       wpa_printf(MSG_MSGDUMP, "Unknown Broadcom "
+                       wpa_printf(MSG_EXCESSIVE, "Unknown Broadcom "
                                   "information element ignored "
-                                  "(type=%d len=%lu)\n",
+                                  "(type=%d len=%lu)",
                                   pos[3], (unsigned long) elen);
                        return -1;
                }
                break;
 
        default:
-               wpa_printf(MSG_MSGDUMP, "unknown vendor specific information "
-                          "element ignored (vendor OUI %02x:%02x:%02x "
-                          "len=%lu)",
+               wpa_printf(MSG_EXCESSIVE, "unknown vendor specific "
+                          "information element ignored (vendor OUI "
+                          "%02x:%02x:%02x len=%lu)",
                           pos[0], pos[1], pos[2], (unsigned long) elen);
                return -1;
        }
index 6e5e79e..9dace70 100644 (file)
@@ -20,7 +20,9 @@
 /* Debugging function - conditional printf and hex dump. Driver wrappers can
  * use these for debugging purposes. */
 
-enum { MSG_MSGDUMP, MSG_DEBUG, MSG_INFO, MSG_WARNING, MSG_ERROR };
+enum {
+       MSG_EXCESSIVE, MSG_MSGDUMP, MSG_DEBUG, MSG_INFO, MSG_WARNING, MSG_ERROR
+};
 
 #ifdef CONFIG_NO_STDOUT_DEBUG