pos += written;
len -= written;
}
+ if (payload->get_type(payload) == EXTENSIBLE_AUTHENTICATION)
+ {
+ eap_payload_t *eap = (eap_payload_t*)payload;
+ u_int32_t vendor;
+ eap_type_t type;
+ char method[64] = "";
+
+ type = eap->get_type(eap, &vendor);
+ if (type)
+ {
+ if (vendor)
+ {
+ snprintf(method, sizeof(method), "/%d-%d", type, vendor);
+ }
+ else
+ {
+ snprintf(method, sizeof(method), "/%N",
+ eap_type_short_names, type);
+ }
+ }
+ written = snprintf(pos, len, "/%N%s", eap_code_short_names,
+ eap->get_code(eap), method);
+ if (written >= len || written < 0)
+ {
+ return buf;
+ }
+ pos += written;
+ len -= written;
+ }
}
enumerator->destroy(enumerator);
"EAP_EXPERIMENTAL");
ENUM_END(eap_type_names, EAP_EXPERIMENTAL);
+ENUM_BEGIN(eap_type_short_names, EAP_IDENTITY, EAP_GTC,
+ "ID",
+ "NTF",
+ "NAK",
+ "MD5",
+ "OTP",
+ "GTC");
+ENUM_NEXT(eap_type_short_names, EAP_SIM, EAP_SIM, EAP_GTC,
+ "SIM");
+ENUM_NEXT(eap_type_short_names, EAP_AKA, EAP_AKA, EAP_SIM,
+ "AKA");
+ENUM_NEXT(eap_type_short_names, EAP_MSCHAPV2, EAP_MSCHAPV2, EAP_AKA,
+ "MSCHAPV2");
+ENUM_NEXT(eap_type_short_names, EAP_RADIUS, EAP_EXPERIMENTAL, EAP_MSCHAPV2,
+ "RAD",
+ "EXP",
+ "XP");
+ENUM_END(eap_type_short_names, EAP_EXPERIMENTAL);
+
/*
* See header
*/
"EAP_FAILURE",
);
+ENUM(eap_code_short_names, EAP_REQUEST, EAP_FAILURE,
+ "REQ",
+ "RES",
+ "SUCC",
+ "FAIL",
+);
+
ENUM(eap_role_names, EAP_SERVER, EAP_PEER,
"EAP_SERVER",
"EAP_PEER",
*/
extern enum_name_t *eap_type_names;
+/**
+ * short string enum names for eap_type_t.
+ */
+extern enum_name_t *eap_type_short_names;
+
/**
* Lookup the EAP method type from a string.
*
*/
extern enum_name_t *eap_code_names;
+/**
+ * short string enum names for eap_code_t.
+ */
+extern enum_name_t *eap_code_short_names;
+
/**
* Interface of an EAP method for server and client side.
*