Addded ike_sa_t.set_statistic to set timestamps from task manager.
authorTobias Brunner <tobias@strongswan.org>
Fri, 25 Nov 2011 13:48:57 +0000 (14:48 +0100)
committerTobias Brunner <tobias@strongswan.org>
Tue, 20 Mar 2012 16:31:08 +0000 (17:31 +0100)
src/libcharon/sa/ike_sa.c
src/libcharon/sa/ike_sa.h

index 841fde3..50b9d2f 100644 (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,
index 2753fca..832f8f1 100644 (file)
@@ -316,6 +316,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.
         *
         * @return                              host address