diff options
author | Martin Willi <martin@strongswan.org> | 2006-10-18 11:46:13 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2006-10-18 11:46:13 +0000 |
commit | 60356f3375da67375e48691bb1d732c02d1681a1 (patch) | |
tree | 1bfa3bd28d46c4211a17a831094e7fcbceea8bb6 /src/charon/encoding/payloads/nonce_payload.c | |
parent | 8cdce67afa4bc4b4ff1a05e956db08cddc5dc48e (diff) | |
download | strongswan-60356f3375da67375e48691bb1d732c02d1681a1.tar.bz2 strongswan-60356f3375da67375e48691bb1d732c02d1681a1.tar.xz |
introduced new logging subsystem using bus:
passive listeners can register on the bus
active listeners wait for signals actively
multiplexing allows multiple listeners to receive debug signals
a lot more...
Diffstat (limited to 'src/charon/encoding/payloads/nonce_payload.c')
-rw-r--r-- | src/charon/encoding/payloads/nonce_payload.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/src/charon/encoding/payloads/nonce_payload.c b/src/charon/encoding/payloads/nonce_payload.c index 036bb20b1..8e1fc505e 100644 --- a/src/charon/encoding/payloads/nonce_payload.c +++ b/src/charon/encoding/payloads/nonce_payload.c @@ -60,13 +60,6 @@ struct private_nonce_payload_t { * The contained nonce value. */ chunk_t nonce; - - /** - * @brief Computes the length of this payload. - * - * @param this calling private_nonce_payload_t object - */ - void (*compute_length) (private_nonce_payload_t *this); }; /** @@ -176,20 +169,20 @@ static void set_next_type(private_nonce_payload_t *this,payload_type_t type) } /** - * Implementation of payload_t.get_length. + * recompute the length of the payload. */ -static size_t get_length(private_nonce_payload_t *this) +static void compute_length(private_nonce_payload_t *this) { - this->compute_length(this); - return this->payload_length; + this->payload_length = NONCE_PAYLOAD_HEADER_LENGTH + this->nonce.len; } /** - * Implementation of private_id_payload_t.compute_length. + * Implementation of payload_t.get_length. */ -static void compute_length(private_nonce_payload_t *this) +static size_t get_length(private_nonce_payload_t *this) { - this->payload_length = NONCE_PAYLOAD_HEADER_LENGTH + this->nonce.len; + compute_length(this); + return this->payload_length; } /** @@ -226,9 +219,6 @@ nonce_payload_t *nonce_payload_create() this->public.set_nonce = (void (*) (nonce_payload_t *,chunk_t)) set_nonce; this->public.get_nonce = (chunk_t (*) (nonce_payload_t *)) get_nonce; - /* private functions */ - this->compute_length = compute_length; - /* private variables */ this->critical = FALSE; this->next_payload = NO_PAYLOAD; |