* Implementation of attribute_manager_t.release_address.
*/
static void release_address(private_attribute_manager_t *this,
- char *pool, host_t *address)
+ char *pool, host_t *address, identification_t *id)
{
enumerator_t *enumerator;
attribute_provider_t *current;
enumerator = this->providers->create_enumerator(this->providers);
while (enumerator->enumerate(enumerator, ¤t))
{
- if (current->release_address(current, pool, address))
+ if (current->release_address(current, pool, address, id))
{
break;
}
private_attribute_manager_t *this = malloc_thing(private_attribute_manager_t);
this->public.acquire_address = (host_t*(*)(attribute_manager_t*, char*, identification_t*,auth_info_t*,host_t*))acquire_address;
- this->public.release_address = (void(*)(attribute_manager_t*, char *, host_t*))release_address;
+ this->public.release_address = (void(*)(attribute_manager_t*, char *, host_t*, identification_t*))release_address;
this->public.add_provider = (void(*)(attribute_manager_t*, attribute_provider_t *provider))add_provider;
this->public.remove_provider = (void(*)(attribute_manager_t*, attribute_provider_t *provider))remove_provider;
this->public.destroy = (void(*)(attribute_manager_t*))destroy;
*
* @param pool pool name from which the address was acquired
* @param address address to release
+ * @param id peer identity to get address for
*/
void (*release_address)(attribute_manager_t *this,
- char *pool, host_t *address);
+ char *pool, host_t *address, identification_t *id);
/**
* Register an attribute provider to the manager.
*
* @param pool name of the pool this address was acquired from
* @param address address to release
+ * @param id peer ID
* @return TRUE if the address has been released by the provider
*/
bool (*release_address)(attribute_provider_t *this,
- char *pool, host_t *address);
+ char *pool, host_t *address, identification_t *id);
};
#endif /* ATTRIBUTE_PROVIDER_H_ @}*/
* Implementation of attribute_provider_t.release_address
*/
static bool release_address(private_sql_attribute_t *this,
- char *name, host_t *address)
+ char *name, host_t *address, identification_t *id)
{
enumerator_t *enumerator;
bool found = FALSE;
time_t now = time(NULL);
this->public.provider.acquire_address = (host_t*(*)(attribute_provider_t *this, char*, identification_t *,auth_info_t *, host_t *))acquire_address;
- this->public.provider.release_address = (bool(*)(attribute_provider_t *this, char*,host_t *))release_address;
+ this->public.provider.release_address = (bool(*)(attribute_provider_t *this, char*,host_t *, identification_t*))release_address;
this->public.destroy = (void(*)(sql_attribute_t*))destroy;
this->db = db;
* Implementation of attribute_provider_t.release_address
*/
static bool release_address(private_stroke_attribute_t *this,
- char *name, host_t *address)
+ char *name, host_t *address, identification_t *id)
{
pool_t *pool;
bool found = FALSE;
private_stroke_attribute_t *this = malloc_thing(private_stroke_attribute_t);
this->public.provider.acquire_address = (host_t*(*)(attribute_provider_t *this, char*, identification_t *,auth_info_t *, host_t *))acquire_address;
- this->public.provider.release_address = (bool(*)(attribute_provider_t *this, char*,host_t *))release_address;
+ this->public.provider.release_address = (bool(*)(attribute_provider_t *this, char*,host_t *, identification_t*))release_address;
this->public.add_pool = (void(*)(stroke_attribute_t*, stroke_msg_t *msg))add_pool;
this->public.del_pool = (void(*)(stroke_attribute_t*, stroke_msg_t *msg))del_pool;
this->public.destroy = (void(*)(stroke_attribute_t*))destroy;
/* release addresses */
for (i = 0; i < ALLOCS; i++)
{
- charon->attributes->release_address(charon->attributes, "test", addr[i]);
+ charon->attributes->release_address(charon->attributes, "test", addr[i], id[i]);
}
/* cleanup */
{
charon->attributes->release_address(charon->attributes,
this->peer_cfg->get_pool(this->peer_cfg),
- this->other_virtual_ip);
+ this->other_virtual_ip, this->other_id);
}
this->other_virtual_ip->destroy(this->other_virtual_ip);
}