Committer: Mircea Gherzan <mircea.gherzan@xxxxxxxxxxxxxx> Date: 30/05/2010 at 20:04:38 Revision: 4629 Revision-id: mircea.gherzan@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Branch nick: trunk Log: lib: remove some unused parameters. Modified: M lib/core/builder.c M lib/core/builder.h M lib/core/common_defines.h M lib/core/conf.c M lib/core/debug.c M lib/core/debug.h === modified file 'lib/core/builder.c' --- lib/core/builder.c 2010-05-30 16:01:32 +0000 +++ lib/core/builder.c 2010-05-30 17:04:14 +0000 @@ -70,6 +70,7 @@ #include <stdlib.h> #include "hipd/input.h" +#include "lib/core/common_defines.h" #include "lib/tool/checksum.h" #include "config.h" #include "builder.h" @@ -156,8 +157,7 @@ static void hip_build_endpoint(struct endpoint_hip *endpoint, const struct endpoint_hip *endpoint_hdr, const char *hostname, - const unsigned char *key_rr, - unsigned int key_rr_len) + const unsigned char *key_rr) { HIP_ASSERT(endpoint_hdr->length == sizeof(struct endpoint_hip) + hip_get_param_total_len(&endpoint_hdr->id.host_id) - @@ -632,7 +632,7 @@ * * @return 1 if parameter type is valid, or 0 if parameter type is invalid */ -static int hip_check_userspace_param_type(const struct hip_tlv_common *param) +static int hip_check_userspace_param_type(const struct hip_tlv_common *param UNUSED) { return 1; } @@ -1310,7 +1310,7 @@ /* Search for one supported transform */ hip_transform_suite_t suite; - suite = hip_get_param_transform_suite_id(param, 0); + suite = hip_get_param_transform_suite_id(param); if (suite == 0) { HIP_ERROR("Could not find suitable %s transform\n", type == HIP_PARAM_HIP_TRANSFORM ? "HIP" : "ESP"); @@ -2113,7 +2113,7 @@ */ int hip_build_param_from(struct hip_common *msg, const struct in6_addr *addr, - const in_port_t not_used) + const in_port_t not_used UNUSED) { struct hip_from from; int err = 0; @@ -2745,12 +2745,10 @@ * retrieve a suite id from a transform structure. * * @param transform_tlv a pointer to a transform structure - * @param index the index of the suite ID in transform_tlv * @return the suite id on transform_tlv on index * @todo Remove index and rename. */ -hip_transform_suite_t hip_get_param_transform_suite_id(const void *transform_tlv, - const uint16_t idx) +hip_transform_suite_t hip_get_param_transform_suite_id(const void *transform_tlv) { /** @todo Why do we have hip_select_esp_transform separately? */ @@ -3786,8 +3784,7 @@ hip_build_endpoint(*endpoint, &endpoint_hdr, hostname, - dsa_key_rr, - dsa_key_rr_len); + dsa_key_rr); out_err: @@ -3844,8 +3841,7 @@ hip_build_endpoint(*endpoint, &endpoint_hdr, hostname, - rsa_key_rr, - rsa_key_rr_len); + rsa_key_rr); out_err: @@ -3860,8 +3856,6 @@ * Translate a host id into a HIT * * @param any_key a pointer to DSA or RSA key in OpenSSL format - * @param any_key_rr currently unused - * @param hit_type currently unused * @param hit the resulting HIT will be stored here * @param is_public 0 if the host id constains the private key * or 1 otherwise @@ -3869,8 +3863,6 @@ * @return zero on success and negative on failure */ static int hip_any_key_to_hit(void *any_key, - unsigned char *any_key_rr, - int hit_type, hip_hit_t *hit, int is_public, int is_dsa) @@ -3967,68 +3959,52 @@ * translate a public RSA key to a HIT * * @param rsa_key the RSA key in OpenSSL format - * @param rsa currently unused - * @param type currently unused * @param hit the resulting HIT will be stored here * @return zero on success and negative on failure */ int hip_public_rsa_to_hit(RSA *rsa_key, - unsigned char *rsa, - int type, struct in6_addr *hit) { - return hip_any_key_to_hit(rsa_key, rsa, type, hit, 1, 0); + return hip_any_key_to_hit(rsa_key, hit, 1, 0); } /** * translate a private RSA key to a HIT * * @param rsa_key the RSA key in OpenSSL format - * @param rsa currently unused - * @param type currently unused * @param hit the resulting HIT will be stored here * @return zero on success and negative on failure */ int hip_private_rsa_to_hit(RSA *rsa_key, - unsigned char *rsa, - int type, struct in6_addr *hit) { - return hip_any_key_to_hit(rsa_key, rsa, type, hit, 0, 0); + return hip_any_key_to_hit(rsa_key, hit, 0, 0); } /** * translate a public DSA key to a HIT * * @param dsa_key the DSA key in OpenSSL format - * @param dsa currently unused - * @param type currently unused * @param hit the resulting HIT will be stored here * @return zero on success and negative on failure */ int hip_public_dsa_to_hit(DSA *dsa_key, - unsigned char *dsa, - int type, struct in6_addr *hit) { - return hip_any_key_to_hit(dsa_key, dsa, type, hit, 1, 1); + return hip_any_key_to_hit(dsa_key, hit, 1, 1); } /** * translate a private DSA key to a HIT * * @param dsa_key the DSA key in OpenSSL format - * @param dsa currently unused - * @param type currently unused * @param hit the resulting HIT will be stored here * @return zero on success and negative on failure */ int hip_private_dsa_to_hit(DSA *dsa_key, - unsigned char *dsa, - int type, struct in6_addr *hit) { - return hip_any_key_to_hit(dsa_key, dsa, type, hit, 0, 1); + return hip_any_key_to_hit(dsa_key, hit, 0, 1); } /** === modified file 'lib/core/builder.h' --- lib/core/builder.h 2010-05-20 16:14:34 +0000 +++ lib/core/builder.h 2010-05-30 17:04:14 +0000 @@ -194,8 +194,7 @@ int hip_get_param_host_id_di_type_len(struct hip_host_id *, const char **, int *); char *hip_get_param_host_id_hostname(struct hip_host_id *); hip_tlv_len_t hip_get_param_total_len(const void *); -hip_transform_suite_t hip_get_param_transform_suite_id(const void *, - const uint16_t); +hip_transform_suite_t hip_get_param_transform_suite_id(const void *); hip_tlv_type_t hip_get_param_type(const void *); uint16_t hip_get_msg_checksum(struct hip_common *msg); const char *hip_message_type_name(const uint8_t); @@ -233,20 +232,12 @@ struct hip_crypto_key *); int hip_public_rsa_to_hit(RSA *rsa_key, - unsigned char *rsa, - int type, struct in6_addr *hit); int hip_private_rsa_to_hit(RSA *rsa_key, - unsigned char *rsa, - int type, struct in6_addr *hit); int hip_public_dsa_to_hit(DSA *dsa_key, - unsigned char *dsa, - int type, struct in6_addr *hit); int hip_private_dsa_to_hit(DSA *dsa_key, - unsigned char *dsa, - int type, struct in6_addr *hit); int hip_build_param_nat_pacing(struct hip_common *msg, uint32_t min_ta); === modified file 'lib/core/common_defines.h' --- lib/core/common_defines.h 2010-04-21 16:35:42 +0000 +++ lib/core/common_defines.h 2010-05-30 17:04:14 +0000 @@ -11,6 +11,13 @@ #include <stdint.h> +/** unused attribute marking */ +#ifdef __GNUC__ +# define UNUSED __attribute__((unused)) +#else +# define UNUSED +#endif + /*********** ESP structures *************/ struct hip_esp { === modified file 'lib/core/conf.c' --- lib/core/conf.c 2010-05-26 10:28:47 +0000 +++ lib/core/conf.c 2010-05-30 17:04:14 +0000 @@ -172,12 +172,11 @@ * * @param msg input/output message for the query/response for hipd * @param opt "all" to query for all HITs or "default" for the default - * @param optc currently 1 * @param send_only 1 if no response from hipd should be requrested, or 0 if * should block for a response from hipd * @return zero for success and negative on error */ -static int hip_get_hits(hip_common_t *msg, const char *opt, int optc, int send_only) +static int hip_get_hits(hip_common_t *msg, const char *opt, int send_only) { int err = 0; struct hip_tlv_common *current_param = NULL; @@ -279,7 +278,6 @@ * Flush all run-time host identities from hipd * * @param msg input/output message for the query/response for hipd - * @param action unused * @param opt currently unused * @param optc currently unused * @param send_only 1 if no response from hipd should be requrested, or 0 if @@ -288,7 +286,6 @@ * @note this does not flush the host identities from disk */ static int hip_conf_handle_hi_del_all(hip_common_t *msg, - int action, const char *opt[], int optc, int send_only) === modified file 'lib/core/debug.c' --- lib/core/debug.c 2010-05-26 10:28:47 +0000 +++ lib/core/debug.c 2010-05-30 17:04:14 +0000 @@ -633,7 +633,6 @@ /** * print a socket address structure * - * @param file the file from where the debug call was made * @param line the line of the debug call in the source file * @param function the name of function where the debug call is located * @param prefix the prefix string will printed before the sockaddr @@ -644,8 +643,7 @@ * HIP_DEBUG_SOCKADDR macro instead. * @note Currently this function supports only INET and INET6 addresses. */ -void hip_print_sockaddr(const char *file, int line, const char *function, - const char *prefix, +void hip_print_sockaddr(int line, const char *function, const char *prefix, const struct sockaddr *sockaddr) { const char *default_str = "<unknown>"; === modified file 'lib/core/debug.h' --- lib/core/debug.h 2010-05-26 10:28:47 +0000 +++ lib/core/debug.h 2010-05-30 17:04:14 +0000 @@ -356,8 +356,7 @@ const char *prefix, const void *str, int len); -void hip_print_sockaddr(const char *file, - int line, +void hip_print_sockaddr(int line, const char *function, const char *prefix, const struct sockaddr *sockaddr);