aboutsummaryrefslogtreecommitdiffstats
path: root/Source/charon/payloads
diff options
context:
space:
mode:
Diffstat (limited to 'Source/charon/payloads')
-rw-r--r--Source/charon/payloads/ike_header.c13
-rw-r--r--Source/charon/payloads/ike_header.h9
2 files changed, 16 insertions, 6 deletions
diff --git a/Source/charon/payloads/ike_header.c b/Source/charon/payloads/ike_header.c
index 2591a25ca..f02caf9bf 100644
--- a/Source/charon/payloads/ike_header.c
+++ b/Source/charon/payloads/ike_header.c
@@ -68,14 +68,14 @@ encoding_rule_t ike_header_encodings[] = {
-status_t destroy(payload_t *this)
+static status_t destroy(ike_header_t *this)
{
allocator_free(this);
return SUCCESS;
}
-status_t get_encoding_rules(payload_t *this, encoding_rule_t **rules, size_t *rule_count)
+static status_t get_encoding_rules(payload_t *this, encoding_rule_t **rules, size_t *rule_count)
{
*rules = ike_header_encodings;
*rule_count = sizeof(ike_header_encodings) / sizeof(encoding_rule_t);
@@ -83,17 +83,17 @@ status_t get_encoding_rules(payload_t *this, encoding_rule_t **rules, size_t *ru
return SUCCESS;
}
-payload_type_t get_type(payload_t *this)
+static payload_type_t get_type(payload_t *this)
{
return HEADER;
}
-payload_type_t get_next_type(payload_t *this)
+static payload_type_t get_next_type(payload_t *this)
{
return (((ike_header_t*)this)->next_payload);
}
-size_t get_length(payload_t *this)
+static size_t get_length(payload_t *this)
{
return sizeof(ike_header_t);
}
@@ -111,7 +111,8 @@ ike_header_t *ike_header_create()
this->payload_interface.get_length = get_length;
this->payload_interface.get_next_type = get_next_type;
this->payload_interface.get_type = get_type;
- this->payload_interface.destroy = destroy;
+ this->payload_interface.destroy = (status_t (*) (payload_t *))destroy;
+ this->destroy = destroy;
return this;
}
diff --git a/Source/charon/payloads/ike_header.h b/Source/charon/payloads/ike_header.h
index 9aef9529a..57a0d637d 100644
--- a/Source/charon/payloads/ike_header.h
+++ b/Source/charon/payloads/ike_header.h
@@ -96,6 +96,15 @@ struct ike_header_s {
* Length of the whole IKEv2-Message (header and all payloads)
*/
u_int32_t length;
+
+ /**
+ * @brief Destroys a ike_haeder payload and all included substructures.
+ *
+ * @param this payload to destroy
+ * @return
+ * SUCCESS in any case
+ */
+ status_t (*destroy) (ike_header_t *this);
};
/**