Addded ike_sa_t.set_statistic to set timestamps from task manager.

This commit is contained in:
Tobias Brunner 2011-11-25 14:48:57 +01:00
parent 38d189eee9
commit 44ff1153e8
2 changed files with 18 additions and 0 deletions

View File

@ -322,6 +322,15 @@ METHOD(ike_sa_t, get_statistic, u_int32_t,
return 0;
}
METHOD(ike_sa_t, set_statistic, void,
private_ike_sa_t *this, statistic_t kind, u_int32_t value)
{
if (kind < STAT_MAX)
{
this->stats[kind] = value;
}
}
METHOD(ike_sa_t, get_my_host, host_t*,
private_ike_sa_t *this)
{
@ -2148,6 +2157,7 @@ ike_sa_t * ike_sa_create(ike_sa_id_t *ike_sa_id, bool initiator,
.set_state = _set_state,
.get_name = _get_name,
.get_statistic = _get_statistic,
.set_statistic = _set_statistic,
.process_message = _process_message,
.initiate = _initiate,
.get_ike_cfg = _get_ike_cfg,

View File

@ -315,6 +315,14 @@ struct ike_sa_t {
*/
u_int32_t (*get_statistic)(ike_sa_t *this, statistic_t kind);
/**
* Set statistic value of the IKE_SA.
*
* @param kind kind of value to update
* @param value value as integer
*/
void (*set_statistic)(ike_sa_t *this, statistic_t kind, u_int32_t value);
/**
* Get the own host address.
*