implemented get|set_identifier() for eap_radius_t

This commit is contained in:
Andreas Steffen
2011-04-05 15:57:00 +02:00
parent 07313dbe38
commit ab5e087309
+20 -1
View File
@@ -54,6 +54,11 @@ struct private_eap_radius_t {
*/ */
u_int32_t vendor; u_int32_t vendor;
/**
* EAP message identifier
*/
u_int8_t identifier;
/** /**
* RADIUS client instance * RADIUS client instance
*/ */
@@ -107,7 +112,7 @@ static void add_eap_identity(private_eap_radius_t *this,
hdr = alloca(len); hdr = alloca(len);
hdr->code = EAP_RESPONSE; hdr->code = EAP_RESPONSE;
hdr->identifier = 0; hdr->identifier = this->identifier;
hdr->length = htons(len); hdr->length = htons(len);
hdr->type = EAP_IDENTITY; hdr->type = EAP_IDENTITY;
memcpy(hdr->data, prefix.ptr, prefix.len); memcpy(hdr->data, prefix.ptr, prefix.len);
@@ -351,6 +356,18 @@ METHOD(eap_method_t, get_msk, status_t,
return FAILED; return FAILED;
} }
METHOD(eap_method_t, get_identifier, u_int8_t,
private_eap_radius_t *this)
{
return this->identifier;
}
METHOD(eap_method_t, set_identifier, void,
private_eap_radius_t *this, u_int8_t identifier)
{
this->identifier = identifier;
}
METHOD(eap_method_t, is_mutual, bool, METHOD(eap_method_t, is_mutual, bool,
private_eap_radius_t *this) private_eap_radius_t *this)
{ {
@@ -388,6 +405,8 @@ eap_radius_t *eap_radius_create(identification_t *server, identification_t *peer
.get_type = _get_type, .get_type = _get_type,
.is_mutual = _is_mutual, .is_mutual = _is_mutual,
.get_msk = _get_msk, .get_msk = _get_msk,
.get_identifier = _get_identifier,
.set_identifier = _set_identifier,
.destroy = _destroy, .destroy = _destroy,
}, },
}, },