aboutsummaryrefslogtreecommitdiffstats
path: root/Source/charon/message.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/charon/message.h')
-rw-r--r--Source/charon/message.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/Source/charon/message.h b/Source/charon/message.h
index 906c5410a..1d29cbf54 100644
--- a/Source/charon/message.h
+++ b/Source/charon/message.h
@@ -25,7 +25,23 @@
#include "types.h"
#include "packet.h"
+#include "ike_sa_id.h"
+
+/**
+ * Major version of IKEv2-Protocol. Always 2
+ */
+#define IKE_V2_MAJOR_VERSION 2
+
+/**
+ * Minor version of IKEv2-Protocol. Always 0
+ */
+#define IKE_V2_MINOR_VERSION 0
+
+/**
+ * Flag in IKEv2-Header. Always 0
+ */
+#define HIGHER_VERSION_SUPPORTED_FLAG 0
/**
* @brief Different types of IKE-Exchanges.
*
@@ -68,6 +84,53 @@ typedef struct message_s message_t;
struct message_s {
/**
+ * @brief Sets the Message ID of the message.
+ *
+ * @param this message_t object
+ * @param message_id message_id to set
+ * @return SUCCESS
+ */
+ status_t (*set_message_id) (message_t *this,u_int32_t message_id);
+
+ /**
+ * @brief Gets the Message ID of the message.
+ *
+ * @param this message_t object
+ * @return message_id type of the message
+ */
+ u_int32_t (*get_message_id) (message_t *this);
+
+ /**
+ * @brief Sets the IKE_SA ID of the message.
+ *
+ * @warning ike_sa_id gets cloned internaly and
+ * so can be destroyed afterwards.
+ *
+ * @param this message_t object
+ * @param ike_sa_id ike_sa_id to set
+ * @return
+ * - SUCCESS
+ * - OUT_OF_RES
+ * @return SUCCESS
+ */
+ status_t (*set_ike_sa_id) (message_t *this,ike_sa_id_t * ike_sa_id);
+
+ /**
+ * @brief Gets the IKE_SA ID of the message.
+ *
+ * @warning The returned ike_sa_id is a clone of the internal one.
+ * So it has to be destroyed by the caller.
+ *
+ * @param this message_t object
+ * @param ike_sa_id pointer to ike_sa_id pointer which will be set
+ * @return
+ * - SUCCESS
+ * - OUT_OF_RES
+ * - FAILED if no ike_sa_id is set
+ */
+ status_t (*get_ike_sa_id) (message_t *this,ike_sa_id_t **ike_sa_id);
+
+ /**
* @brief Sets the exchange type of the message.
*
* @param this message_t object