this->attributes_list->reset(this->attributes_list);
}
}
+
+METHOD(peer_cfg_t, set_dpd_interval, void,
+ private_peer_cfg_t *this, uint32_t interval)
+{
+ this->dpd = interval;
+}
#endif
METHOD(peer_cfg_t, destroy, void,
.add_vendor_attributes_request_list = _add_vendor_attributes_request_list,
.get_next_vendor_attribute_request = _get_next_vendor_attribute_request,
.rewind_vendor_attributes_request_list = _rewind_vendor_attributes_request_list,
+ .set_dpd_interval = _set_dpd_interval,
#endif
#ifdef ME
.is_mediation = _is_mediation,
void (*add_vendor_attributes_request_list)(peer_cfg_t *this, char *buffer);
int (*get_next_vendor_attribute_request)(peer_cfg_t *this);
void (*rewind_vendor_attributes_request_list)(peer_cfg_t *this);
+
+ /**
+ * Set DPD interval
+ */
+ void (*set_dpd_interval)(peer_cfg_t *this, uint32_t interval);
#endif
};
{
DBG1(DBG_CFG, "processed attribute %d", type);
+ if ((type == TIMEOUT_PERIOD_FOR_DPD) && (data.len == 4))
+ {
+ uint32_t interval = ntohl(*((uint32_t*)data.ptr));
+ ike_sa->set_dpd_interval(ike_sa, interval);
+ }
+
result = TRUE;
break;
}
{
return this->mtu;
}
+
+METHOD(ike_sa_t, set_dpd_interval, void,
+ private_ike_sa_t *this, uint32_t interval)
+{
+ DBG1(DBG_IKE, "Set DPD interval to %d seconds", interval);
+
+ if (this->peer_cfg)
+ {
+ this->peer_cfg->set_dpd_interval(this->peer_cfg, interval);
+ }
+}
#endif
#ifdef VOWIFI_USE_TIMER
.get_tun_name = _get_tun_name,
.get_mtu = _get_mtu,
.get_configuration_attributes = _get_configuration_attributes,
+ .set_dpd_interval = _set_dpd_interval,
#endif
#ifdef ME
.act_as_mediation_server = _act_as_mediation_server,
* Get configuration attributes
*/
int (*get_configuration_attributes)(ike_sa_t *this, linked_list_t *list);
+
+ /**
+ * Set DPD interval
+ */
+ void (*set_dpd_interval)(ike_sa_t *this, uint32_t interval);
#endif
};