+void
+eapol_print(netdissect_options *ndo,
+ const u_char *cp)
+{
+ const struct eap_frame_t *eap;
+ u_int eap_type, eap_len;
+
+ ndo->ndo_protocol = "eap";
+ eap = (const struct eap_frame_t *)cp;
+ ND_TCHECK_SIZE(eap);
+ eap_type = GET_U_1(eap->type);
+
+ ND_PRINT("%s (%u) v%u, len %u",
+ tok2str(eap_frame_type_values, "unknown", eap_type),
+ eap_type,
+ GET_U_1(eap->version),
+ GET_BE_U_2(eap->length));
+ if (ndo->ndo_vflag < 1)
+ return;
+
+ cp += sizeof(struct eap_frame_t);
+ eap_len = GET_BE_U_2(eap->length);
+
+ switch (eap_type) {
+ case EAP_FRAME_TYPE_PACKET:
+ if (eap_len == 0)
+ goto trunc;
+ ND_PRINT(", ");
+ eap_print(ndo, cp, eap_len);
+ return;