aboutsummaryrefslogtreecommitdiffstats
path: root/Source/charon/encoding/payloads/id_payload.c
diff options
context:
space:
mode:
authorJan Hutter <jhutter@hsr.ch>2005-11-29 11:16:15 +0000
committerJan Hutter <jhutter@hsr.ch>2005-11-29 11:16:15 +0000
commit2326633550ee256c0dfda5dc2111811dc0877a58 (patch)
tree25f23c505383d649aa00ddbcaeabc9df249760ab /Source/charon/encoding/payloads/id_payload.c
parent0e96f7d8c3aefaa1717f4c30e66fdc459d3f2ecc (diff)
downloadstrongswan-2326633550ee256c0dfda5dc2111811dc0877a58.tar.bz2
strongswan-2326633550ee256c0dfda5dc2111811dc0877a58.tar.xz
- added and tested auth_payload_t class
Diffstat (limited to 'Source/charon/encoding/payloads/id_payload.c')
-rw-r--r--Source/charon/encoding/payloads/id_payload.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/Source/charon/encoding/payloads/id_payload.c b/Source/charon/encoding/payloads/id_payload.c
index 9691522f0..6201dcce1 100644
--- a/Source/charon/encoding/payloads/id_payload.c
+++ b/Source/charon/encoding/payloads/id_payload.c
@@ -81,13 +81,6 @@ struct private_id_payload_t {
* The contained id data value.
*/
chunk_t id_data;
-
- /**
- * @brief Computes the length of this payload.
- *
- * @param this calling private_id_payload_t object
- */
- void (*compute_length) (private_id_payload_t *this);
};
/**
@@ -196,7 +189,6 @@ static void set_next_type(private_id_payload_t *this,payload_type_t type)
*/
static size_t get_length(private_id_payload_t *this)
{
- this->compute_length(this);
return this->payload_length;
}
@@ -227,6 +219,7 @@ static void set_data (private_id_payload_t *this, chunk_t data)
}
this->id_data.ptr = allocator_clone_bytes(data.ptr,data.len);
this->id_data.len = data.len;
+ this->payload_length = ID_PAYLOAD_HEADER_LENGTH + this->id_data.len;
}
/**
@@ -261,14 +254,6 @@ static void set_initiator (private_id_payload_t *this,bool is_initiator)
}
/**
- * Implementation of private_id_payload_t.compute_length.
- */
-static void compute_length(private_id_payload_t *this)
-{
- this->payload_length = ID_PAYLOAD_HEADER_LENGTH + this->id_data.len;
-}
-
-/**
* Implementation of payload_t.destroy and id_payload_t.destroy.
*/
static void destroy(private_id_payload_t *this)
@@ -305,10 +290,7 @@ id_payload_t *id_payload_create(bool is_initiator)
this->public.get_data = (chunk_t (*) (id_payload_t *)) get_data;
this->public.get_initiator = (bool (*) (id_payload_t *)) get_initiator;
this->public.set_initiator = (void (*) (id_payload_t *,bool)) set_initiator;
-
- /* private functions */
- this->compute_length = compute_length;
-
+
/* private variables */
this->critical = FALSE;
this->next_payload = NO_PAYLOAD;