- changed memory allocator functions to own allocator calls

This commit is contained in:
Jan Hutter
2005-11-09 09:11:06 +00:00
parent c1ca1ee042
commit 7953866962
22 changed files with 606 additions and 606 deletions
+31 -31
View File
@@ -1,9 +1,9 @@
/**
* @file ike_sa.c
*
*
* @brief Class ike_sa_t. An object of this type is managed by an
* ike_sa_manager_t-object and represents an IKE_SA
*
*
*/
/*
@@ -37,26 +37,26 @@ enum ike_sa_state_e{
* IKE_SA is is not in a state
*/
NO_STATE,
/**
* A IKE_SA_INIT-message was sent: role initiator
*/
IKE_SA_INIT_REQUESTED,
/**
* A IKE_SA_INIT-message was replied: role responder
*/
IKE_SA_INIT_RESPONDED,
/**
* An IKE_AUTH-message was sent after a successful
* An IKE_AUTH-message was sent after a successful
* IKE_SA_INIT-exchange: role initiator
*/
IKE_AUTH_REQUESTED,
/**
* An IKE_AUTH-message was replied: role responder.
* In this state, all the informations for an IKE_SA
* In this state, all the informations for an IKE_SA
* and one CHILD_SA are known.
*/
IKE_SA_INITIALIZED
@@ -67,26 +67,26 @@ enum ike_sa_state_e{
* Private data of an message_t object
*/
typedef struct private_ike_sa_s private_ike_sa_t;
struct private_ike_sa_s {
struct private_ike_sa_s {
/**
* Public part of a ike_sa_t object
*/
ike_sa_t public;
/* Private values */
/**
* Identifier for the current IKE_SA
*/
ike_sa_id_t *ike_sa_id;
/**
* Linked List containing the child sa's of the current IKE_SA
*/
linked_list_t *child_sas;
/**
* Current state of the IKE_SA
*/
@@ -108,7 +108,7 @@ static status_t process_message (private_ike_sa_t *this, message_t *message)
static status_t process_configuration (private_ike_sa_t *this,configuration_t *configuration)
{
/*
* @TODO Add configuration processing here
* @TODO Add configuration processing here
*/
return SUCCESS;
}
@@ -130,13 +130,13 @@ static status_t destroy (private_ike_sa_t *this)
{
return FAILED;
}
this->ike_sa_id->destroy(this->ike_sa_id);
this->child_sas->destroy(this->child_sas);
pfree(this);
allocator_free(this);
return SUCCESS;
}
@@ -145,37 +145,37 @@ static status_t destroy (private_ike_sa_t *this)
*/
ike_sa_t * ike_sa_create(ike_sa_id_t *ike_sa_id)
{
private_ike_sa_t *this = alloc_thing(private_ike_sa_t, "private_ike_sa_t");
private_ike_sa_t *this = allocator_alloc_thing(private_ike_sa_t, "private_ike_sa_t");
if (this == NULL)
{
return NULL;
}
/* Public functions */
this->public.process_message = (status_t(*)(ike_sa_t*, message_t*)) process_message;
this->public.process_configuration = (status_t(*)(ike_sa_t*, configuration_t*)) process_configuration;
this->public.get_id = (ike_sa_id_t*(*)(ike_sa_t*)) get_id;
this->public.process_configuration = (status_t(*)(ike_sa_t*, configuration_t*)) process_configuration;
this->public.get_id = (ike_sa_id_t*(*)(ike_sa_t*)) get_id;
this->public.destroy = (status_t(*)(ike_sa_t*))destroy;
/* initialize private fields */
if (ike_sa_id->clone(ike_sa_id,&(this->ike_sa_id)) != SUCCESS)
{
pfree(this);
allocator_free(this);
return NULL;
}
this->child_sas = linked_list_create();
if (this->child_sas == NULL)
{
this->ike_sa_id->destroy(this->ike_sa_id);
pfree(this);
allocator_free(this);
return NULL;
}
/* at creation time, IKE_SA isn't in a specific state */
this->current_state = NO_STATE;
return (&this->public);
return (&this->public);
}