print-eap.c (313537) | print-eap.c (327234) |
---|---|
1/* 2 * Copyright (c) 2004 - Michael Richardson <mcr@xelerance.com> 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that: (1) source code distributions 6 * retain the above copyright notice and this paragraph in its entirety, (2) 7 * distributions including binary code include the above copyright notice and 8 * this paragraph in its entirety in the documentation or other materials --- 168 unchanged lines hidden (view full) --- 177 eap->version, 178 EXTRACT_16BITS(eap->length))); 179 180 tptr += sizeof(const struct eap_frame_t); 181 tlen -= sizeof(const struct eap_frame_t); 182 183 switch (eap->type) { 184 case EAP_FRAME_TYPE_PACKET: | 1/* 2 * Copyright (c) 2004 - Michael Richardson <mcr@xelerance.com> 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that: (1) source code distributions 6 * retain the above copyright notice and this paragraph in its entirety, (2) 7 * distributions including binary code include the above copyright notice and 8 * this paragraph in its entirety in the documentation or other materials --- 168 unchanged lines hidden (view full) --- 177 eap->version, 178 EXTRACT_16BITS(eap->length))); 179 180 tptr += sizeof(const struct eap_frame_t); 181 tlen -= sizeof(const struct eap_frame_t); 182 183 switch (eap->type) { 184 case EAP_FRAME_TYPE_PACKET: |
185 ND_TCHECK_8BITS(tptr); |
|
185 type = *(tptr); | 186 type = *(tptr); |
187 ND_TCHECK_16BITS(tptr+2); |
|
186 len = EXTRACT_16BITS(tptr+2); 187 ND_PRINT((ndo, ", %s (%u), id %u, len %u", 188 tok2str(eap_code_values, "unknown", type), 189 type, 190 *(tptr+1), 191 len)); 192 193 ND_TCHECK2(*tptr, len); 194 195 if (type <= 2) { /* For EAP_REQUEST and EAP_RESPONSE only */ | 188 len = EXTRACT_16BITS(tptr+2); 189 ND_PRINT((ndo, ", %s (%u), id %u, len %u", 190 tok2str(eap_code_values, "unknown", type), 191 type, 192 *(tptr+1), 193 len)); 194 195 ND_TCHECK2(*tptr, len); 196 197 if (type <= 2) { /* For EAP_REQUEST and EAP_RESPONSE only */ |
198 ND_TCHECK_8BITS(tptr+4); |
|
196 subtype = *(tptr+4); 197 ND_PRINT((ndo, "\n\t\t Type %s (%u)", | 199 subtype = *(tptr+4); 200 ND_PRINT((ndo, "\n\t\t Type %s (%u)", |
198 tok2str(eap_type_values, "unknown", *(tptr+4)), 199 *(tptr + 4))); | 201 tok2str(eap_type_values, "unknown", subtype), 202 subtype)); |
200 201 switch (subtype) { 202 case EAP_TYPE_IDENTITY: 203 if (len - 5 > 0) { 204 ND_PRINT((ndo, ", Identity: ")); 205 safeputs(ndo, tptr + 5, len - 5); 206 } 207 break; --- 9 unchanged lines hidden (view full) --- 217 count = 5; 218 219 /* 220 * one or more octets indicating 221 * the desired authentication 222 * type one octet per type 223 */ 224 while (count < len) { | 203 204 switch (subtype) { 205 case EAP_TYPE_IDENTITY: 206 if (len - 5 > 0) { 207 ND_PRINT((ndo, ", Identity: ")); 208 safeputs(ndo, tptr + 5, len - 5); 209 } 210 break; --- 9 unchanged lines hidden (view full) --- 220 count = 5; 221 222 /* 223 * one or more octets indicating 224 * the desired authentication 225 * type one octet per type 226 */ 227 while (count < len) { |
228 ND_TCHECK_8BITS(tptr+count); |
|
225 ND_PRINT((ndo, " %s (%u),", 226 tok2str(eap_type_values, "unknown", *(tptr+count)), 227 *(tptr + count))); 228 count++; 229 } 230 break; 231 232 case EAP_TYPE_TTLS: | 229 ND_PRINT((ndo, " %s (%u),", 230 tok2str(eap_type_values, "unknown", *(tptr+count)), 231 *(tptr + count))); 232 count++; 233 } 234 break; 235 236 case EAP_TYPE_TTLS: |
233 ND_PRINT((ndo, " TTLSv%u", 234 EAP_TTLS_VERSION(*(tptr + 5)))); /* fall through */ | |
235 case EAP_TYPE_TLS: | 237 case EAP_TYPE_TLS: |
238 ND_TCHECK_8BITS(tptr + 5); 239 if (subtype == EAP_TYPE_TTLS) 240 ND_PRINT((ndo, " TTLSv%u", 241 EAP_TTLS_VERSION(*(tptr + 5)))); |
|
236 ND_PRINT((ndo, " flags [%s] 0x%02x,", 237 bittok2str(eap_tls_flags_values, "none", *(tptr+5)), 238 *(tptr + 5))); 239 240 if (EAP_TLS_EXTRACT_BIT_L(*(tptr+5))) { | 242 ND_PRINT((ndo, " flags [%s] 0x%02x,", 243 bittok2str(eap_tls_flags_values, "none", *(tptr+5)), 244 *(tptr + 5))); 245 246 if (EAP_TLS_EXTRACT_BIT_L(*(tptr+5))) { |
247 ND_TCHECK_32BITS(tptr + 6); |
|
241 ND_PRINT((ndo, " len %u", EXTRACT_32BITS(tptr + 6))); 242 } 243 break; 244 245 case EAP_TYPE_FAST: | 248 ND_PRINT((ndo, " len %u", EXTRACT_32BITS(tptr + 6))); 249 } 250 break; 251 252 case EAP_TYPE_FAST: |
253 ND_TCHECK_8BITS(tptr + 5); |
|
246 ND_PRINT((ndo, " FASTv%u", 247 EAP_TTLS_VERSION(*(tptr + 5)))); 248 ND_PRINT((ndo, " flags [%s] 0x%02x,", 249 bittok2str(eap_tls_flags_values, "none", *(tptr+5)), 250 *(tptr + 5))); 251 252 if (EAP_TLS_EXTRACT_BIT_L(*(tptr+5))) { | 254 ND_PRINT((ndo, " FASTv%u", 255 EAP_TTLS_VERSION(*(tptr + 5)))); 256 ND_PRINT((ndo, " flags [%s] 0x%02x,", 257 bittok2str(eap_tls_flags_values, "none", *(tptr+5)), 258 *(tptr + 5))); 259 260 if (EAP_TLS_EXTRACT_BIT_L(*(tptr+5))) { |
261 ND_TCHECK_32BITS(tptr + 6); |
|
253 ND_PRINT((ndo, " len %u", EXTRACT_32BITS(tptr + 6))); 254 } 255 256 /* FIXME - TLV attributes follow */ 257 break; 258 259 case EAP_TYPE_AKA: 260 case EAP_TYPE_SIM: | 262 ND_PRINT((ndo, " len %u", EXTRACT_32BITS(tptr + 6))); 263 } 264 265 /* FIXME - TLV attributes follow */ 266 break; 267 268 case EAP_TYPE_AKA: 269 case EAP_TYPE_SIM: |
270 ND_TCHECK_8BITS(tptr + 5); |
|
261 ND_PRINT((ndo, " subtype [%s] 0x%02x,", 262 tok2str(eap_aka_subtype_values, "unknown", *(tptr+5)), 263 *(tptr + 5))); 264 265 /* FIXME - TLV attributes follow */ 266 break; 267 268 case EAP_TYPE_MD5_CHALLENGE: --- 26 unchanged lines hidden --- | 271 ND_PRINT((ndo, " subtype [%s] 0x%02x,", 272 tok2str(eap_aka_subtype_values, "unknown", *(tptr+5)), 273 *(tptr + 5))); 274 275 /* FIXME - TLV attributes follow */ 276 break; 277 278 case EAP_TYPE_MD5_CHALLENGE: --- 26 unchanged lines hidden --- |