rather than having a separate table; this makes it clearer that unknown
manaagement frame types already have a message printed, and that you
have to add a call to print that if a new management frame type is
created.
#ifndef lint
static const char rcsid[] _U_ =
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-802_11.c,v 1.35 2005-07-30 18:48:35 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-802_11.c,v 1.36 2005-07-30 21:37:20 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#endif
#ifdef HAVE_CONFIG_H
static const char *auth_alg_text[]={"Open System","Shared Key","EAP"};
#define NUM_AUTH_ALGS (sizeof auth_alg_text / sizeof auth_alg_text[0])
static const char *auth_alg_text[]={"Open System","Shared Key","EAP"};
#define NUM_AUTH_ALGS (sizeof auth_alg_text / sizeof auth_alg_text[0])
-static const char *subtype_text[16]={
- "Assoc Request",
- "Assoc Response",
- "ReAssoc Request",
- "ReAssoc Response",
- "Probe Request",
- "Probe Response",
- "",
- "",
- "Beacon",
- "ATIM",
- "Disassociation",
- "Authentication",
- "DeAuthentication",
- "",
- "",
- ""
-};
-
static const char *status_text[] = {
"Succesful", /* 0 */
"Unspecified failure", /* 1 */
static const char *status_text[] = {
"Succesful", /* 0 */
"Unspecified failure", /* 1 */
mgmt_body_print(u_int16_t fc, const struct mgmt_header_t *pmh,
const u_char *p)
{
mgmt_body_print(u_int16_t fc, const struct mgmt_header_t *pmh,
const u_char *p)
{
- printf("%s", subtype_text[FC_SUBTYPE(fc)]);
-
switch (FC_SUBTYPE(fc)) {
case ST_ASSOC_REQUEST:
switch (FC_SUBTYPE(fc)) {
case ST_ASSOC_REQUEST:
+ printf("Assoc Request");
return handle_assoc_request(p);
case ST_ASSOC_RESPONSE:
return handle_assoc_request(p);
case ST_ASSOC_RESPONSE:
+ printf("Assoc Response");
return handle_assoc_response(p);
case ST_REASSOC_REQUEST:
return handle_assoc_response(p);
case ST_REASSOC_REQUEST:
+ printf("ReAssoc Request");
return handle_reassoc_request(p);
case ST_REASSOC_RESPONSE:
return handle_reassoc_request(p);
case ST_REASSOC_RESPONSE:
+ printf("ReAssoc Response");
return handle_reassoc_response(p);
case ST_PROBE_REQUEST:
return handle_reassoc_response(p);
case ST_PROBE_REQUEST:
+ printf("Probe Request");
return handle_probe_request(p);
case ST_PROBE_RESPONSE:
return handle_probe_request(p);
case ST_PROBE_RESPONSE:
+ printf("Probe Response");
return handle_probe_response(p);
case ST_BEACON:
return handle_probe_response(p);
case ST_BEACON:
return handle_beacon(p);
case ST_ATIM:
return handle_beacon(p);
case ST_ATIM:
return handle_atim();
case ST_DISASSOC:
return handle_atim();
case ST_DISASSOC:
+ printf("Disassociation");
return handle_disassoc(p);
case ST_AUTH:
return handle_disassoc(p);
case ST_AUTH:
+ printf("Authentication");
if (!TTEST2(*p, 3))
return 0;
if ((p[0] == 0 ) && (p[1] == 0) && (p[2] == 0)) {
if (!TTEST2(*p, 3))
return 0;
if ((p[0] == 0 ) && (p[1] == 0) && (p[2] == 0)) {
}
return handle_auth(p);
case ST_DEAUTH:
}
return handle_auth(p);
case ST_DEAUTH:
+ printf("DeAuthentication");
return handle_deauth(pmh, p);
break;
default:
return handle_deauth(pmh, p);
break;
default: