ND_TCHECK_SIZE(eap);
eap_type = EXTRACT_U_1(eap->type);
- /* in non-verbose mode just lets print the basic info */
- if (ndo->ndo_vflag < 1) {
- ND_PRINT("%s (%u) v%u, len %u",
- tok2str(eap_frame_type_values, "unknown", eap_type),
- eap_type,
- EXTRACT_U_1(eap->version),
- EXTRACT_BE_U_2(eap->length));
- return;
- }
-
ND_PRINT("%s (%u) v%u, len %u",
tok2str(eap_frame_type_values, "unknown", eap_type),
eap_type,
EXTRACT_U_1(eap->version),
EXTRACT_BE_U_2(eap->length));
+ if (ndo->ndo_vflag < 1)
+ return;
+
tptr += sizeof(struct eap_frame_t);
tlen -= sizeof(struct eap_frame_t);
ND_TCHECK_LEN(tptr, len);
- if (type <= 2) { /* For EAP_REQUEST and EAP_RESPONSE only */
+ if (type == EAP_REQUEST || type == EAP_RESPONSE) {
+ /* RFC 3748 Section 4.1 */
ND_TCHECK_1(tptr + 4);
subtype = EXTRACT_U_1(tptr + 4);
ND_PRINT("\n\t\t Type %s (%u)",
return;
trunc:
- ND_PRINT("\n\t[|EAP]");
+ nd_print_trunc(ndo);
}