diff options
author | Tobias Brunner <tobias@strongswan.org> | 2011-10-04 15:58:16 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2011-10-04 15:59:20 +0200 |
commit | 055a823d08ec2deacb293a41a07c33f721e444ac (patch) | |
tree | 5ca72dba79cc55e0d16b3ffb88bfb94dc12e6cfe /src/libcharon | |
parent | bdc8d0aa90eb77301855160113cceb36a7501033 (diff) | |
download | strongswan-055a823d08ec2deacb293a41a07c33f721e444ac.tar.bz2 strongswan-055a823d08ec2deacb293a41a07c33f721e444ac.tar.xz |
Made create_endpoint_notify_create() private.
Diffstat (limited to 'src/libcharon')
-rw-r--r-- | src/libcharon/encoding/payloads/endpoint_notify.c | 24 | ||||
-rw-r--r-- | src/libcharon/encoding/payloads/endpoint_notify.h | 15 |
2 files changed, 18 insertions, 21 deletions
diff --git a/src/libcharon/encoding/payloads/endpoint_notify.c b/src/libcharon/encoding/payloads/endpoint_notify.c index 69bf43a7b..1ead0a052 100644 --- a/src/libcharon/encoding/payloads/endpoint_notify.c +++ b/src/libcharon/encoding/payloads/endpoint_notify.c @@ -76,6 +76,11 @@ ENUM(me_endpoint_type_names, HOST, RELAYED, ); /** + * Forward declaration + */ +static private_endpoint_notify_t *endpoint_notify_create(); + +/** * Helper functions to parse integer values */ static status_t parse_uint8(u_int8_t **cur, u_int8_t *top, u_int8_t *val) @@ -273,7 +278,7 @@ METHOD(endpoint_notify_t, clone_, endpoint_notify_t*, { private_endpoint_notify_t *clone; - clone = (private_endpoint_notify_t*)endpoint_notify_create(); + clone = endpoint_notify_create(); clone->priority = this->priority; clone->type = this->type; clone->family = this->family; @@ -299,10 +304,10 @@ METHOD(endpoint_notify_t, destroy, void, free(this); } -/* - * Described in header +/** + * Creates an empty endpoint notify */ -endpoint_notify_t *endpoint_notify_create() +static private_endpoint_notify_t *endpoint_notify_create() { private_endpoint_notify_t *this; @@ -322,17 +327,16 @@ endpoint_notify_t *endpoint_notify_create() .type = NO_TYPE, ); - return &this->public; + return this; } /** * Described in header */ -endpoint_notify_t *endpoint_notify_create_from_host(me_endpoint_type_t type, host_t *host, host_t *base) +endpoint_notify_t *endpoint_notify_create_from_host(me_endpoint_type_t type, + host_t *host, host_t *base) { - private_endpoint_notify_t *this; - - this = (private_endpoint_notify_t*)endpoint_notify_create(); + private_endpoint_notify_t *this = endpoint_notify_create(); this->type = type; switch(type) @@ -397,7 +401,7 @@ endpoint_notify_t *endpoint_notify_create_from_payload(notify_payload_t *notify) return NULL; } - this = (private_endpoint_notify_t*)endpoint_notify_create(); + this = endpoint_notify_create(); data = notify->get_notification_data(notify); if (parse_notification_data(this, data) != SUCCESS) diff --git a/src/libcharon/encoding/payloads/endpoint_notify.h b/src/libcharon/encoding/payloads/endpoint_notify.h index 120eef49a..853aadf3d 100644 --- a/src/libcharon/encoding/payloads/endpoint_notify.h +++ b/src/libcharon/encoding/payloads/endpoint_notify.h @@ -125,7 +125,7 @@ struct endpoint_notify_t { /** * Generates a notification payload from this endpoint. * - * @return built notify_payload_t + * @return built notify_payload_t */ notify_payload_t *(*build_notify) (endpoint_notify_t *this); @@ -143,19 +143,12 @@ struct endpoint_notify_t { }; /** - * Creates an empty endpoint_notify_t object. - * - * @return created endpoint_notify_t object - */ -endpoint_notify_t *endpoint_notify_create(void); - - -/** * Creates an endpoint_notify_t object from a host. * * @param type the endpoint type * @param host host to base the notify on (gets cloned) - * @param base base of the endpoint, applies only to reflexive endpoints (gets cloned) + * @param base base of the endpoint, applies only to reflexive + * endpoints (gets cloned) * @return created endpoint_notify_t object */ endpoint_notify_t *endpoint_notify_create_from_host(me_endpoint_type_t type, @@ -166,7 +159,7 @@ endpoint_notify_t *endpoint_notify_create_from_host(me_endpoint_type_t type, * * @param notify the notify payload * @return - created endpoint_notify_t object - * - NULL if invalid payload + * - NULL if invalid payload */ endpoint_notify_t *endpoint_notify_create_from_payload(notify_payload_t *notify); |