From 02d3cba7ce48790f8f1e940d0db5c74f0c8347ea Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Wed, 16 Nov 2005 16:12:03 +0000 Subject: [PATCH] - added exchange types --- Source/charon/payloads/ike_header.c | 14 ++++++++++++-- Source/charon/payloads/ike_header.h | 7 ++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Source/charon/payloads/ike_header.c b/Source/charon/payloads/ike_header.c index 3a1f23ff97..6f9a16bc98 100644 --- a/Source/charon/payloads/ike_header.c +++ b/Source/charon/payloads/ike_header.c @@ -93,7 +93,17 @@ struct private_ike_header_s { */ u_int32_t length; }; - + +/** + * mappings used to get strings for exchange_type_t + */ +mapping_t exchange_type_m[] = { + {EXCHANGE_TYPE_UNDEFINED, "EXCHANGE_TYPE_UNDEFINED"}, + {IKE_SA_INIT, "IKE_SA_INIT"}, + {IKE_AUTH, "IKE_AUTH"}, + {CREATE_CHILD_SA, "CREATE_CHILD_SA"}, + {INFORMATIONAL, "INFORMATIONAL"} +}; /** @@ -368,7 +378,7 @@ ike_header_t *ike_header_create() this->next_payload = 0; this->maj_version = IKE_MAJOR_VERSION; this->min_version = IKE_MINOR_VERSION; - this->exchange_type = NOT_SET; + this->exchange_type = EXCHANGE_TYPE_UNDEFINED; this->flags.initiator = TRUE; this->flags.version = HIGHER_VERSION_SUPPORTED_FLAG; this->flags.response = FALSE; diff --git a/Source/charon/payloads/ike_header.h b/Source/charon/payloads/ike_header.h index 628f2d6f08..520002c565 100644 --- a/Source/charon/payloads/ike_header.h +++ b/Source/charon/payloads/ike_header.h @@ -59,10 +59,9 @@ typedef enum exchange_type_e exchange_type_t; enum exchange_type_e{ /** - * NOT_SET, not a official message type :-) + * EXCHANGE_TYPE_UNDEFINED, not a official message type :-) */ - NOT_SET = 0, - + EXCHANGE_TYPE_UNDEFINED = 240, /** * IKE_SA_INIT */ @@ -81,6 +80,8 @@ enum exchange_type_e{ INFORMATIONAL = 37 }; +extern mapping_t exchange_type_m[]; + /** * Object representing an IKEv2-Header *