diff options
author | Martin Willi <martin@strongswan.org> | 2006-03-23 15:25:43 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2006-03-23 15:25:43 +0000 |
commit | dec598220b9a293c4ec75e593ab642a8945fa4fc (patch) | |
tree | a97247afbdb29e2b071933f8c9667a7ffa03cca3 /Source/charon/config | |
parent | 3264ce50b912f2aba09d2d8e7ee7ed9d364d9e46 (diff) | |
download | strongswan-dec598220b9a293c4ec75e593ab642a8945fa4fc.tar.bz2 strongswan-dec598220b9a293c4ec75e593ab642a8945fa4fc.tar.xz |
- rewrite of logger_manager, uses now one instance per context
- cleanups for logger here and there
- removed critical flag check in payload verification (conformance to IKEv2)
- so thats and theres everywere... ;-)
Diffstat (limited to 'Source/charon/config')
-rw-r--r-- | Source/charon/config/connection.c | 4 | ||||
-rw-r--r-- | Source/charon/config/proposal.c | 26 | ||||
-rw-r--r-- | Source/charon/config/proposal.h | 8 |
3 files changed, 19 insertions, 19 deletions
diff --git a/Source/charon/config/connection.c b/Source/charon/config/connection.c index e0b29ac2f..24f16a044 100644 --- a/Source/charon/config/connection.c +++ b/Source/charon/config/connection.c @@ -205,7 +205,7 @@ static diffie_hellman_group_t get_dh_group(private_connection_t *this) while (iterator->has_next(iterator)) { iterator->current(iterator, (void**)&proposal); - proposal->get_algorithm(proposal, IKE, DIFFIE_HELLMAN_GROUP, &algo); + proposal->get_algorithm(proposal, PROTO_IKE, DIFFIE_HELLMAN_GROUP, &algo); if (algo) { iterator->destroy(iterator); @@ -229,7 +229,7 @@ static bool check_dh_group(private_connection_t *this, diffie_hellman_group_t dh while (prop_iter->has_next(prop_iter)) { prop_iter->current(prop_iter, (void**)&proposal); - alg_iter = proposal->create_algorithm_iterator(proposal, IKE, DIFFIE_HELLMAN_GROUP); + alg_iter = proposal->create_algorithm_iterator(proposal, PROTO_IKE, DIFFIE_HELLMAN_GROUP); while (alg_iter->has_next(alg_iter)) { alg_iter->current(alg_iter, (void**)&algo); diff --git a/Source/charon/config/proposal.c b/Source/charon/config/proposal.c index e5a8a64cc..760d58061 100644 --- a/Source/charon/config/proposal.c +++ b/Source/charon/config/proposal.c @@ -32,10 +32,10 @@ * String mappings for protocol_id_t. */ mapping_t protocol_id_m[] = { - {UNDEFINED_PROTOCOL_ID, "UNDEFINED_PROTOCOL_ID"}, - {IKE, "IKE"}, - {AH, "AH"}, - {ESP, "ESP"}, + {PROTO_NONE, "PROTO_NONE"}, + {PROTO_IKE, "PROTO_IKE"}, + {PROTO_AH, "PROTO_AH"}, + {PROTO_ESP, "PROTO_ESP"}, {MAPPING_END, NULL} }; @@ -159,7 +159,7 @@ static protocol_proposal_t *get_protocol_proposal(private_proposal_t *this, prot proto_proposal->prf_algos = linked_list_create(); proto_proposal->dh_groups = linked_list_create(); proto_proposal->esns = linked_list_create(); - if (proto == IKE) + if (proto == PROTO_IKE) { proto_proposal->spi.len = 8; } @@ -446,15 +446,15 @@ static proposal_t *select_proposal(private_proposal_t *this, private_proposal_t iterator->destroy(iterator); /* apply spis from "other" */ - spi = other->public.get_spi(&(other->public), AH); + spi = other->public.get_spi(&(other->public), PROTO_AH); if (spi) { - selected->set_spi(selected, AH, spi); + selected->set_spi(selected, PROTO_AH, spi); } - spi = other->public.get_spi(&(other->public), ESP); + spi = other->public.get_spi(&(other->public), PROTO_ESP); if (spi) { - selected->set_spi(selected, ESP, spi); + selected->set_spi(selected, PROTO_ESP, spi); } /* everything matched, return new proposal */ @@ -477,8 +477,8 @@ static void get_protocols(private_proposal_t *this, protocol_id_t ids[2]) iterator_t *iterator = this->protocol_proposals->create_iterator(this->protocol_proposals, TRUE); u_int i = 0; - ids[0] = UNDEFINED_PROTOCOL_ID; - ids[1] = UNDEFINED_PROTOCOL_ID; + ids[0] = PROTO_NONE; + ids[1] = PROTO_NONE; while (iterator->has_next(iterator)) { protocol_proposal_t *proto_prop; @@ -501,7 +501,7 @@ static void set_spi(private_proposal_t *this, protocol_id_t proto, u_int64_t spi protocol_proposal_t *proto_proposal = get_protocol_proposal(this, proto, FALSE); if (proto_proposal) { - if (proto == AH || proto == ESP) + if (proto == PROTO_AH || proto == PROTO_ESP) { *((u_int32_t*)proto_proposal->spi.ptr) = (u_int32_t)spi; } @@ -520,7 +520,7 @@ static u_int64_t get_spi(private_proposal_t *this, protocol_id_t proto) protocol_proposal_t *proto_proposal = get_protocol_proposal(this, proto, FALSE); if (proto_proposal) { - if (proto == AH || proto == ESP) + if (proto == PROTO_AH || proto == PROTO_ESP) { return (u_int64_t)*((u_int32_t*)proto_proposal->spi.ptr); } diff --git a/Source/charon/config/proposal.h b/Source/charon/config/proposal.h index e2a4856e9..9c75406cc 100644 --- a/Source/charon/config/proposal.h +++ b/Source/charon/config/proposal.h @@ -41,10 +41,10 @@ typedef enum protocol_id_t protocol_id_t; * @ingroup config */ enum protocol_id_t { - UNDEFINED_PROTOCOL_ID = 201, - IKE = 1, - AH = 2, - ESP = 3, + PROTO_NONE = 0, + PROTO_IKE = 1, + PROTO_AH = 2, + PROTO_ESP = 3, }; /** |