better split up of library files "types.h" & "definitions.h"

centralized all printf specifier character definitions
reuse of arginfo handlers
more cleanups
fixed more AMD64 issues
added DEBUG_LEVEL compile flag to exclude DBGn() statements
This commit is contained in:
Martin Willi
2006-10-31 12:27:59 +00:00
parent de8b8a8c44
commit db7ef62494
151 changed files with 1094 additions and 1061 deletions
+10 -10
View File
@@ -540,7 +540,7 @@ static status_t get_response(private_create_child_sa_t *this, message_t *request
if (this->ike_sa->get_state(this->ike_sa) == IKE_REKEYING ||
this->ike_sa->get_state(this->ike_sa) == IKE_DELETING)
{
build_notify(NO_ADDITIONAL_SAS, CHUNK_INITIALIZER, response, TRUE);
build_notify(NO_ADDITIONAL_SAS, chunk_empty, response, TRUE);
DBG1(DBG_IKE, "unable to create new CHILD_SAs, as rekeying in progress");
return FAILED;
}
@@ -605,7 +605,7 @@ static status_t get_response(private_create_child_sa_t *this, message_t *request
/* check if we have all payloads */
if (!(sa_request && nonce_request && tsi_request && tsr_request))
{
build_notify(INVALID_SYNTAX, CHUNK_INITIALIZER, response, TRUE);
build_notify(INVALID_SYNTAX, chunk_empty, response, TRUE);
SIG(this->failsig, "request message incomplete, no CHILD_SA created");
return FAILED;
}
@@ -615,7 +615,7 @@ static status_t get_response(private_create_child_sa_t *this, message_t *request
if (this->randomizer->allocate_pseudo_random_bytes(this->randomizer,
NONCE_SIZE, &this->nonce_r) != SUCCESS)
{
build_notify(NO_PROPOSAL_CHOSEN, CHUNK_INITIALIZER, response, TRUE);
build_notify(NO_PROPOSAL_CHOSEN, chunk_empty, response, TRUE);
SIG(this->failsig, "nonce generation failed, no CHILD_SA created");
return FAILED;
}
@@ -649,7 +649,7 @@ static status_t get_response(private_create_child_sa_t *this, message_t *request
if (this->policy == NULL)
{
SIG(this->failsig, "no acceptable policy found, sending TS_UNACCEPTABLE notify");
build_notify(TS_UNACCEPTABLE, CHUNK_INITIALIZER, response, TRUE);
build_notify(TS_UNACCEPTABLE, chunk_empty, response, TRUE);
return FAILED;
}
}
@@ -672,14 +672,14 @@ static status_t get_response(private_create_child_sa_t *this, message_t *request
if (this->proposal == NULL)
{
SIG(this->failsig, "CHILD_SA proposals unacceptable, sending NO_PROPOSAL_CHOSEN notify");
build_notify(NO_PROPOSAL_CHOSEN, CHUNK_INITIALIZER, response, TRUE);
build_notify(NO_PROPOSAL_CHOSEN, chunk_empty, response, TRUE);
return FAILED;
}
/* do we have traffic selectors? */
else if (this->tsi->get_count(this->tsi) == 0 || this->tsr->get_count(this->tsr) == 0)
{
SIG(this->failsig, "CHILD_SA traffic selectors unacceptable, sending TS_UNACCEPTABLE notify");
build_notify(TS_UNACCEPTABLE, CHUNK_INITIALIZER, response, TRUE);
build_notify(TS_UNACCEPTABLE, chunk_empty, response, TRUE);
return FAILED;
}
else
@@ -700,7 +700,7 @@ static status_t get_response(private_create_child_sa_t *this, message_t *request
if (install_child_sa(this, FALSE) != SUCCESS)
{
SIG(this->failsig, "installing CHILD_SA failed, sending NO_PROPOSAL_CHOSEN notify");
build_notify(NO_PROPOSAL_CHOSEN, CHUNK_INITIALIZER, response, TRUE);
build_notify(NO_PROPOSAL_CHOSEN, chunk_empty, response, TRUE);
return FAILED;
}
/* add proposal to sa payload */
@@ -975,9 +975,9 @@ create_child_sa_t *create_child_sa_create(ike_sa_t *ike_sa)
this->requested = 0;
this->rekey_spi = 0;
this->reqid = 0;
this->nonce_i = CHUNK_INITIALIZER;
this->nonce_r = CHUNK_INITIALIZER;
this->nonce_s = CHUNK_INITIALIZER;
this->nonce_i = chunk_empty;
this->nonce_r = chunk_empty;
this->nonce_s = chunk_empty;
this->child_sa = NULL;
this->rekeyed_sa = NULL;
this->lost = FALSE;
+5 -5
View File
@@ -685,7 +685,7 @@ static status_t get_response(private_ike_auth_t *this, message_t *request,
}
else
{
my_id = identification_create_from_encoding(ID_ANY, CHUNK_INITIALIZER);
my_id = identification_create_from_encoding(ID_ANY, chunk_empty);
}
}
@@ -1116,10 +1116,10 @@ ike_auth_t *ike_auth_create(ike_sa_t *ike_sa)
this->message_id = 0;
this->message = NULL;
this->requested = 0;
this->nonce_i = CHUNK_INITIALIZER;
this->nonce_r = CHUNK_INITIALIZER;
this->init_request = CHUNK_INITIALIZER;
this->init_response = CHUNK_INITIALIZER;
this->nonce_i = chunk_empty;
this->nonce_r = chunk_empty;
this->init_request = chunk_empty;
this->init_response = chunk_empty;
this->child_sa = NULL;
this->proposal = NULL;
this->tsi = NULL;
+4 -4
View File
@@ -1099,8 +1099,8 @@ ike_sa_init_t *ike_sa_init_create(ike_sa_t *ike_sa)
this->message = NULL;
this->requested = 0;
this->diffie_hellman = NULL;
this->nonce_i = CHUNK_INITIALIZER;
this->nonce_r = CHUNK_INITIALIZER;
this->nonce_i = chunk_empty;
this->nonce_r = chunk_empty;
this->connection = NULL;
this->policy = NULL;
this->proposal = NULL;
@@ -1108,8 +1108,8 @@ ike_sa_init_t *ike_sa_init_create(ike_sa_t *ike_sa)
this->reqid = 0;
this->randomizer = randomizer_create();
this->nat_hasher = hasher_create(HASH_SHA1);
this->natd_src_hash = CHUNK_INITIALIZER;
this->natd_dst_hash = CHUNK_INITIALIZER;
this->natd_src_hash = chunk_empty;
this->natd_dst_hash = chunk_empty;
this->natd_src_seen = FALSE;
this->natd_dst_seen = FALSE;
this->natd_src_matched = FALSE;
+9 -9
View File
@@ -445,7 +445,7 @@ static status_t get_response(private_rekey_ike_sa_t *this, message_t *request,
/* if we already initiate a delete, we do not allow rekeying */
if (this->ike_sa->get_state(this->ike_sa) == IKE_DELETING)
{
build_notify(NO_PROPOSAL_CHOSEN, CHUNK_INITIALIZER, response, TRUE);
build_notify(NO_PROPOSAL_CHOSEN, chunk_empty, response, TRUE);
DBG1(DBG_IKE, "unable to rekey, as delete in progress. Sending NO_PROPOSAL_CHOSEN");
return FAILED;
}
@@ -459,7 +459,7 @@ static status_t get_response(private_rekey_ike_sa_t *this, message_t *request,
state == CHILD_REKEYING ||
state == CHILD_DELETING)
{
build_notify(NO_PROPOSAL_CHOSEN, CHUNK_INITIALIZER, response, TRUE);
build_notify(NO_PROPOSAL_CHOSEN, chunk_empty, response, TRUE);
DBG1(DBG_IKE, "unable to rekey, one CHILD_SA is half open. Sending NO_PROPOSAL_CHOSEN");
iterator->destroy(iterator);
return FAILED;
@@ -482,7 +482,7 @@ static status_t get_response(private_rekey_ike_sa_t *this, message_t *request,
if (this->connection == NULL)
{
DBG1(DBG_IKE, "no connection found to rekey IKE_SA, sending NO_RROPOSAL_CHOSEN");
build_notify(NO_PROPOSAL_CHOSEN, CHUNK_INITIALIZER, response, TRUE);
build_notify(NO_PROPOSAL_CHOSEN, chunk_empty, response, TRUE);
return FAILED;
}
}
@@ -527,7 +527,7 @@ static status_t get_response(private_rekey_ike_sa_t *this, message_t *request,
/* check if we have all payloads */
if (!(sa_request && nonce_request && ke_request))
{
build_notify(INVALID_SYNTAX, CHUNK_INITIALIZER, response, TRUE);
build_notify(INVALID_SYNTAX, chunk_empty, response, TRUE);
DBG1(DBG_IKE, "request message incomplete, IKE_SA rekeying failed");
return FAILED;
}
@@ -537,7 +537,7 @@ static status_t get_response(private_rekey_ike_sa_t *this, message_t *request,
if (this->randomizer->allocate_pseudo_random_bytes(this->randomizer,
NONCE_SIZE, &this->nonce_r) != SUCCESS)
{
build_notify(NO_PROPOSAL_CHOSEN, CHUNK_INITIALIZER, response, TRUE);
build_notify(NO_PROPOSAL_CHOSEN, chunk_empty, response, TRUE);
return FAILED;
}
nonce_response = nonce_payload_create();
@@ -561,7 +561,7 @@ static status_t get_response(private_rekey_ike_sa_t *this, message_t *request,
if (this->proposal == NULL)
{
DBG1(DBG_IKE, "no proposals acceptable to rekey IKE_SA, sending NO_PROPOSAL_CHOSEN");
build_notify(NO_PROPOSAL_CHOSEN, CHUNK_INITIALIZER, response, TRUE);
build_notify(NO_PROPOSAL_CHOSEN, chunk_empty, response, TRUE);
return FAILED;
}
@@ -874,9 +874,9 @@ rekey_ike_sa_t *rekey_ike_sa_create(ike_sa_t *ike_sa)
this->message_id = 0;
this->message = NULL;
this->requested = 0;
this->nonce_i = CHUNK_INITIALIZER;
this->nonce_r = CHUNK_INITIALIZER;
this->nonce_s = CHUNK_INITIALIZER;
this->nonce_i = chunk_empty;
this->nonce_r = chunk_empty;
this->nonce_s = chunk_empty;
this->new_sa = NULL;
this->lost = FALSE;
this->connection = NULL;
+1 -1
View File
@@ -25,7 +25,7 @@
typedef struct transaction_t transaction_t;
#include <types.h>
#include <library.h>
#include <encoding/message.h>
#include <sa/ike_sa.h>