------------------------------------------------------------ revno: 5175 committer: Rene Hummen <rene.hummen@xxxxxxxxxxxxxxxxx> branch nick: mobility-fixes timestamp: Fri 2010-11-19 18:28:54 +0100 message: moved hip_get_locator_item to where it is used modified: lib/core/builder.c lib/core/builder.h modules/update/hipd/update.c -- lp:~hipl-core/hipl/mobility-fixes https://code.launchpad.net/~hipl-core/hipl/mobility-fixes Your team HIPL core team is subscribed to branch lp:~hipl-core/hipl/mobility-fixes. To unsubscribe from this branch go to https://code.launchpad.net/~hipl-core/hipl/mobility-fixes/+edit-subscription
=== modified file 'lib/core/builder.c' --- lib/core/builder.c 2010-11-19 17:23:54 +0000 +++ lib/core/builder.c 2010-11-19 17:28:54 +0000 @@ -3899,33 +3899,6 @@ } /** - * Retreive a @c LOCATOR ADDRESS ITEM@c from a list. - * - * @param item_list a pointer to the first item in the list - * @param idx the index of the item in the list - * @return the locator addres item - */ -union hip_locator_info_addr *hip_get_locator_item(void *item_list, int idx) -{ - int i = 0; - struct hip_locator_info_addr_item *temp; - char *result; - result = (char *) item_list; - - - for (i = 0; i <= idx - 1; i++) { - temp = (struct hip_locator_info_addr_item *) result; - if (temp->locator_type == HIP_LOCATOR_LOCATOR_TYPE_ESP_SPI || - temp->locator_type == HIP_LOCATOR_LOCATOR_TYPE_IPV6) { - result += sizeof(struct hip_locator_info_addr_item); - } else { - result += sizeof(struct hip_locator_info_addr_item2); - } - } - return (union hip_locator_info_addr *) result; -} - -/** * retrieve a IP address from a locator item structure * * @param item a pointer to the item === modified file 'lib/core/builder.h' --- lib/core/builder.h 2010-11-19 17:23:54 +0000 +++ lib/core/builder.h 2010-11-19 17:28:54 +0000 @@ -186,7 +186,6 @@ *hip_dh_select_key(struct hip_diffie_hellman *); uint8_t hip_get_host_id_algo(const struct hip_host_id *); int hip_get_locator_addr_item_count(const struct hip_locator *); -union hip_locator_info_addr *hip_get_locator_item(void *item_list, int index); int hip_get_lifetime_value(time_t seconds, uint8_t *lifetime); int hip_get_lifetime_seconds(uint8_t lifetime, time_t *seconds); int hip_check_network_msg_len(const struct hip_common *msg); === modified file 'modules/update/hipd/update.c' --- modules/update/hipd/update.c 2010-11-19 17:10:37 +0000 +++ modules/update/hipd/update.c 2010-11-19 17:28:54 +0000 @@ -627,6 +627,33 @@ } /** + * Retreive a @c LOCATOR ADDRESS ITEM@c from a list. + * + * @param item_list a pointer to the first item in the list + * @param idx the index of the item in the list + * @return the locator addres item + */ +static union hip_locator_info_addr *hip_get_locator_item(void *item_list, int idx) +{ + int i = 0; + struct hip_locator_info_addr_item *temp; + char *result; + result = (char *) item_list; + + + for (i = 0; i <= idx - 1; i++) { + temp = (struct hip_locator_info_addr_item *) result; + if (temp->locator_type == HIP_LOCATOR_LOCATOR_TYPE_ESP_SPI || + temp->locator_type == HIP_LOCATOR_LOCATOR_TYPE_IPV6) { + result += sizeof(struct hip_locator_info_addr_item); + } else { + result += sizeof(struct hip_locator_info_addr_item2); + } + } + return (union hip_locator_info_addr *) result; +} + +/** * process a LOCATOR paramter * * @param ha the related host association