ike-rekey: Add method to check if there was a rekey collision
This commit is contained in:
@@ -380,6 +380,13 @@ METHOD(task_t, get_type, task_type_t,
|
|||||||
return TASK_IKE_REKEY;
|
return TASK_IKE_REKEY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
METHOD(ike_rekey_t, did_collide, bool,
|
||||||
|
private_ike_rekey_t *this)
|
||||||
|
{
|
||||||
|
return this->collision &&
|
||||||
|
this->collision->get_type(this->collision) == TASK_IKE_REKEY;
|
||||||
|
}
|
||||||
|
|
||||||
METHOD(ike_rekey_t, collide, void,
|
METHOD(ike_rekey_t, collide, void,
|
||||||
private_ike_rekey_t* this, task_t *other)
|
private_ike_rekey_t* this, task_t *other)
|
||||||
{
|
{
|
||||||
@@ -444,6 +451,7 @@ ike_rekey_t *ike_rekey_create(ike_sa_t *ike_sa, bool initiator)
|
|||||||
.migrate = _migrate,
|
.migrate = _migrate,
|
||||||
.destroy = _destroy,
|
.destroy = _destroy,
|
||||||
},
|
},
|
||||||
|
.did_collide = _did_collide,
|
||||||
.collide = _collide,
|
.collide = _collide,
|
||||||
},
|
},
|
||||||
.ike_sa = ike_sa,
|
.ike_sa = ike_sa,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
|
* Copyright (C) 2016 Tobias Brunner
|
||||||
* Copyright (C) 2007 Martin Willi
|
* Copyright (C) 2007 Martin Willi
|
||||||
* Hochschule fuer Technik Rapperswil
|
* HSR Hochschule fuer Technik Rapperswil
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the
|
* under the terms of the GNU General Public License as published by the
|
||||||
@@ -37,6 +38,13 @@ struct ike_rekey_t {
|
|||||||
*/
|
*/
|
||||||
task_t task;
|
task_t task;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if there was a rekey collision.
|
||||||
|
*
|
||||||
|
* @return TRUE if there was a rekey collision before
|
||||||
|
*/
|
||||||
|
bool (*did_collide)(ike_rekey_t *this);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register a rekeying task which collides with this one.
|
* Register a rekeying task which collides with this one.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user