Add new debug message level for excessive information

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).
This commit is contained in:
Jouni Malinen 2010-07-05 12:21:48 -07:00
parent cc91e07e57
commit 2d8bf73298
4 changed files with 16 additions and 13 deletions

View file

@ -256,8 +256,9 @@ void handle_probe_req(struct hostapd_data *hapd,
ieee802_11_print_ssid(ssid_txt, elems.ssid, ieee802_11_print_ssid(ssid_txt, elems.ssid,
elems.ssid_len); elems.ssid_len);
wpa_printf(MSG_MSGDUMP, "Probe Request from " MACSTR wpa_printf(MSG_MSGDUMP, "Probe Request from " MACSTR
" for foreign SSID '%s'", " for foreign SSID '%s' (DA " MACSTR ")",
MAC2STR(mgmt->sa), ssid_txt); MAC2STR(mgmt->sa), ssid_txt,
MAC2STR(mgmt->da));
} }
return; return;
} }
@ -332,7 +333,7 @@ void handle_probe_req(struct hostapd_data *hapd,
os_free(resp); 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), "SSID", MAC2STR(mgmt->sa),
elems.ssid_len == 0 ? "broadcast" : "our"); elems.ssid_len == 0 ? "broadcast" : "our");
} }

View 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); handle_assoc_cb(hapd, mgmt, len, 1, ok);
break; break;
case WLAN_FC_STYPE_PROBE_RESP: case WLAN_FC_STYPE_PROBE_RESP:
wpa_printf(MSG_DEBUG, "mgmt::proberesp cb"); wpa_printf(MSG_EXCESSIVE, "mgmt::proberesp cb");
break; break;
case WLAN_FC_STYPE_DEAUTH: case WLAN_FC_STYPE_DEAUTH:
/* ignore */ /* ignore */

View file

@ -75,7 +75,7 @@ static int ieee802_11_parse_vendor_specific(const u8 *pos, size_t elen,
elems->wmm_tspec_len = elen; elems->wmm_tspec_len = elen;
break; break;
default: default:
wpa_printf(MSG_MSGDUMP, "unknown WMM " wpa_printf(MSG_EXCESSIVE, "unknown WMM "
"information element ignored " "information element ignored "
"(subtype=%d len=%lu)", "(subtype=%d len=%lu)",
pos[4], (unsigned long) elen); 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; elems->wps_ie_len = elen;
break; break;
default: default:
wpa_printf(MSG_MSGDUMP, "Unknown Microsoft " wpa_printf(MSG_EXCESSIVE, "Unknown Microsoft "
"information element ignored " "information element ignored "
"(type=%d len=%lu)\n", "(type=%d len=%lu)",
pos[3], (unsigned long) elen); pos[3], (unsigned long) elen);
return -1; 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; elems->vendor_ht_cap_len = elen;
break; break;
default: default:
wpa_printf(MSG_MSGDUMP, "Unknown Broadcom " wpa_printf(MSG_EXCESSIVE, "Unknown Broadcom "
"information element ignored " "information element ignored "
"(type=%d len=%lu)\n", "(type=%d len=%lu)",
pos[3], (unsigned long) elen); pos[3], (unsigned long) elen);
return -1; return -1;
} }
break; break;
default: default:
wpa_printf(MSG_MSGDUMP, "unknown vendor specific information " wpa_printf(MSG_EXCESSIVE, "unknown vendor specific "
"element ignored (vendor OUI %02x:%02x:%02x " "information element ignored (vendor OUI "
"len=%lu)", "%02x:%02x:%02x len=%lu)",
pos[0], pos[1], pos[2], (unsigned long) elen); pos[0], pos[1], pos[2], (unsigned long) elen);
return -1; return -1;
} }

View file

@ -20,7 +20,9 @@
/* Debugging function - conditional printf and hex dump. Driver wrappers can /* Debugging function - conditional printf and hex dump. Driver wrappers can
* use these for debugging purposes. */ * 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 #ifdef CONFIG_NO_STDOUT_DEBUG