From 79b9c1d6c5ebf296d29e11f4a5f25c0bf60f896c Mon Sep 17 00:00:00 2001 From: Jan Hutter Date: Tue, 29 Nov 2005 10:19:27 +0000 Subject: - implemented compute length function --- Source/charon/encoding/payloads/nonce_payload.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Source/charon/encoding/payloads/nonce_payload.c') diff --git a/Source/charon/encoding/payloads/nonce_payload.c b/Source/charon/encoding/payloads/nonce_payload.c index e6ea14745..5070e1987 100644 --- a/Source/charon/encoding/payloads/nonce_payload.c +++ b/Source/charon/encoding/payloads/nonce_payload.c @@ -192,6 +192,14 @@ static size_t get_length(private_nonce_payload_t *this) return this->payload_length; } +/** + * Implementation of private_id_payload_t.compute_length. + */ +static void compute_length(private_nonce_payload_t *this) +{ + this->payload_length = NONCE_PAYLOAD_HEADER_LENGTH + this->nonce.len; +} + /** * Implementation of payload_t.destroy and nonce_payload_t.destroy. */ @@ -226,6 +234,9 @@ nonce_payload_t *nonce_payload_create() this->public.set_nonce = (status_t (*) (nonce_payload_t *,chunk_t)) set_nonce; this->public.get_nonce = (void (*) (nonce_payload_t *,chunk_t*)) get_nonce; + /* private functions */ + this->compute_length = compute_length; + /* private variables */ this->critical = FALSE; this->next_payload = NO_PAYLOAD; -- cgit v1.2.3