summaryrefslogtreecommitdiff
path: root/src/libcharon/encoding/message.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcharon/encoding/message.h')
-rw-r--r--src/libcharon/encoding/message.h41
1 files changed, 39 insertions, 2 deletions
diff --git a/src/libcharon/encoding/message.h b/src/libcharon/encoding/message.h
index 8c1cbcd09..51197308c 100644
--- a/src/libcharon/encoding/message.h
+++ b/src/libcharon/encoding/message.h
@@ -154,6 +154,26 @@ struct message_t {
bool (*get_request) (message_t *this);
/**
+ * Set the version flag in the IKE header.
+ */
+ void (*set_version_flag)(message_t *this);
+
+ /**
+ * Get a reserved bit in the IKE header.
+ *
+ * @param nr reserved bit to get in IKE header, 0-4
+ * @return TRUE if bit is set
+ */
+ bool (*get_reserved_header_bit)(message_t *this, u_int nr);
+
+ /**
+ * Set a reserved bit in the IKE header.
+ *
+ * @param nr reserved bit to set in IKE header, 0-4
+ */
+ void (*set_reserved_header_bit)(message_t *this, u_int nr);
+
+ /**
* Append a payload to the message.
*
* If the payload must be encrypted is not specified here. Encryption
@@ -181,6 +201,11 @@ struct message_t {
chunk_t data);
/**
+ * Disable automatic payload sorting for this message.
+ */
+ void (*disable_sort)(message_t *this);
+
+ /**
* Parses header of message.
*
* Begins parisng of a message created via message_create_from_packet().
@@ -206,8 +231,6 @@ struct message_t {
* @param aead aead transform to verify/decrypt message
* @return
* - SUCCESS if parsing successful
- * - NOT_SUPPORTED if ciritcal unknown payloads found
- * - NOT_SUPPORTED if message type is not supported!
* - PARSE_ERROR if message parsing failed
* - VERIFY_ERROR if message verification failed (bad syntax)
* - FAILED if integrity check failed
@@ -235,6 +258,13 @@ struct message_t {
status_t (*generate) (message_t *this, aead_t *aead, packet_t **packet);
/**
+ * Check if the message has already been encoded using generate().
+ *
+ * @return TRUE if message has been encoded
+ */
+ bool (*is_encoded)(message_t *this);
+
+ /**
* Gets the source host informations.
*
* @warning Returned host_t object is not getting cloned,
@@ -282,6 +312,13 @@ struct message_t {
enumerator_t * (*create_payload_enumerator) (message_t *this);
/**
+ * Remove the payload at the current enumerator position.
+ *
+ * @param enumerator enumerator created by create_payload_enumerator()
+ */
+ void (*remove_payload_at)(message_t *this, enumerator_t *enumerator);
+
+ /**
* Find a payload of a specific type.
*
* Returns the first occurance.