aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/attributes/attribute_manager.c
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2014-11-04 15:11:42 +0100
committerMartin Willi <martin@revosec.ch>2015-02-20 13:34:56 +0100
commita16058a49125ba9db08ee5e1cac929566546a764 (patch)
tree0a1a54f8c33882bd7173f503a8c3f878fa7fb862 /src/libcharon/attributes/attribute_manager.c
parent124490a8e07bca3a9f9f84887768c40947f65713 (diff)
downloadstrongswan-a16058a49125ba9db08ee5e1cac929566546a764.tar.bz2
strongswan-a16058a49125ba9db08ee5e1cac929566546a764.tar.xz
attribute-manager: Pass the full IKE_SA to provider methods
Diffstat (limited to 'src/libcharon/attributes/attribute_manager.c')
-rw-r--r--src/libcharon/attributes/attribute_manager.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/libcharon/attributes/attribute_manager.c b/src/libcharon/attributes/attribute_manager.c
index d166663fc..8b974928a 100644
--- a/src/libcharon/attributes/attribute_manager.c
+++ b/src/libcharon/attributes/attribute_manager.c
@@ -53,20 +53,23 @@ struct private_attribute_manager_t {
typedef struct {
/** attribute group pools */
linked_list_t *pools;
- /** server/peer identity */
- identification_t *id;
+ /** associated IKE_SA */
+ ike_sa_t *ike_sa;
/** requesting/assigned virtual IPs */
linked_list_t *vips;
} enum_data_t;
METHOD(attribute_manager_t, acquire_address, host_t*,
private_attribute_manager_t *this, linked_list_t *pools,
- identification_t *id, host_t *requested)
+ ike_sa_t *ike_sa, host_t *requested)
{
enumerator_t *enumerator;
attribute_provider_t *current;
+ identification_t *id;
host_t *host = NULL;
+ id = ike_sa->get_other_eap_id(ike_sa);
+
this->lock->read_lock(this->lock);
enumerator = this->providers->create_enumerator(this->providers);
while (enumerator->enumerate(enumerator, &current))
@@ -85,12 +88,15 @@ METHOD(attribute_manager_t, acquire_address, host_t*,
METHOD(attribute_manager_t, release_address, bool,
private_attribute_manager_t *this, linked_list_t *pools, host_t *address,
- identification_t *id)
+ ike_sa_t *ike_sa)
{
enumerator_t *enumerator;
attribute_provider_t *current;
+ identification_t *id;
bool found = FALSE;
+ id = ike_sa->get_other_eap_id(ike_sa);
+
this->lock->read_lock(this->lock);
enumerator = this->providers->create_enumerator(this->providers);
while (enumerator->enumerate(enumerator, &current))
@@ -113,19 +119,22 @@ METHOD(attribute_manager_t, release_address, bool,
static enumerator_t *responder_enum_create(attribute_provider_t *provider,
enum_data_t *data)
{
+ identification_t *id;
+
+ id = data->ike_sa->get_other_eap_id(data->ike_sa);
return provider->create_attribute_enumerator(provider, data->pools,
- data->id, data->vips);
+ id, data->vips);
}
METHOD(attribute_manager_t, create_responder_enumerator, enumerator_t*,
private_attribute_manager_t *this, linked_list_t *pools,
- identification_t *id, linked_list_t *vips)
+ ike_sa_t *ike_sa, linked_list_t *vips)
{
enum_data_t *data;
INIT(data,
.pools = pools,
- .id = id,
+ .ike_sa = ike_sa,
.vips = vips,
);
this->lock->read_lock(this->lock);