bus: Add a handle_vips() hook invoked after handling configuration attributes

Similar to assign_vips() used by a peer assigning virtual IPs to the other peer,
the handle_vips() hook gets invoked on a peers after receiving attributes. On
release of the same attributes the hook gets invoked again.

This is useful to inspect handled attributes, as the ike_updown() hook is
invoked after authentication, when attributes have not been handled yet.
This commit is contained in:
Martin Willi
2014-06-17 15:14:51 +02:00
parent 7fc98a840b
commit eef7427b0f
6 changed files with 53 additions and 0 deletions
+1
View File
@@ -2168,6 +2168,7 @@ METHOD(ike_sa_t, destroy, void,
}
/* remove attributes first, as we pass the IKE_SA to the handler */
charon->bus->handle_vips(charon->bus, &this->public, FALSE);
while (array_remove(this->attributes, ARRAY_TAIL, &entry))
{
if (entry.handler)
@@ -441,6 +441,8 @@ static void install_vips(private_mode_config_t *this)
}
}
enumerator->destroy(enumerator);
charon->bus->handle_vips(charon->bus, this->ike_sa, TRUE);
}
METHOD(task_t, process_r, status_t,
@@ -446,6 +446,8 @@ METHOD(task_t, process_i, status_t,
}
}
enumerator->destroy(enumerator);
charon->bus->handle_vips(charon->bus, this->ike_sa, TRUE);
return SUCCESS;
}
return NEED_MORE;