From 45b06d91ae142abca79ff977042214b81b290e57 Mon Sep 17 00:00:00 2001 From: Jan Hutter Date: Thu, 17 Nov 2005 08:45:40 +0000 Subject: [PATCH] - introduced new functions for version fetching --- Source/charon/message.h | 51 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/Source/charon/message.h b/Source/charon/message.h index 6b0984bdd..28e4f2f1d 100644 --- a/Source/charon/message.h +++ b/Source/charon/message.h @@ -40,6 +40,40 @@ typedef struct message_s message_t; struct message_s { + /** + * @brief Sets the IKE major version of the message. + * + * @param this message_t object + * @param major_version major version to set + * @return SUCCESS + */ + status_t (*set_major_version) (message_t *this,u_int8_t major_version); + + /** + * @brief Gets the IKE major version of the message. + * + * @param this message_t object + * @return major version of the message + */ + u_int8_t (*get_major_version) (message_t *this); + + /** + * @brief Sets the IKE minor version of the message. + * + * @param this message_t object + * @param minor_version minor version to set + * @return SUCCESS + */ + status_t (*set_minor_version) (message_t *this,u_int8_t minor_version); + + /** + * @brief Gets the IKE minor version of the message. + * + * @param this message_t object + * @return minor version of the message + */ + u_int8_t (*get_minor_version) (message_t *this); + /** * @brief Sets the Message ID of the message. * @@ -160,7 +194,7 @@ struct message_s { */ /** - * @brief Parses and verifies header of message + * @brief Parses header of message * * @param this message_t object * @return @@ -168,9 +202,20 @@ struct message_s { * - NOT_SUPPORTED if payload_type is not supported * - OUT_OF_RES if out of ressources * - PARSE_ERROR if corrupted/invalid data found - * - VERIFY_ERROR if header contains wrong values */ - status_t (*parse_and_verify_header) (message_t *this); + status_t (*parse_header) (message_t *this); + + /** + * @brief Parses body of message + * + * @param this message_t object + * @return + * - SUCCESS if header could be parsed + * - NOT_SUPPORTED if payload_type is not supported + * - OUT_OF_RES if out of ressources + * - PARSE_ERROR if corrupted/invalid data found + */ + status_t (*parse_body) (message_t *this); status_t (*generate) (message_t *this, packet_t **packet); status_t (*get_source) (message_t *this, host_t **host);