return this->close_action;
}
-METHOD(child_cfg_t, get_ke_method, key_exchange_method_t,
- private_child_cfg_t *this)
+METHOD(child_cfg_t, get_algorithm, uint16_t,
+ private_child_cfg_t *this, transform_type_t type)
{
enumerator_t *enumerator;
proposal_t *proposal;
- uint16_t method = KE_NONE;
+ uint16_t alg = 0;
enumerator = this->proposals->create_enumerator(this->proposals);
while (enumerator->enumerate(enumerator, &proposal))
{
- if (proposal->get_algorithm(proposal, KEY_EXCHANGE_METHOD, &method,
- NULL))
+ if (proposal->get_algorithm(proposal, type, &alg, NULL))
{
break;
}
}
enumerator->destroy(enumerator);
- return method;
+ return alg;
}
METHOD(child_cfg_t, get_inactivity, uint32_t,
.get_dpd_action = _get_dpd_action,
.get_close_action = _get_close_action,
.get_lifetime = _get_lifetime,
- .get_ke_method = _get_ke_method,
+ .get_algorithm = _get_algorithm,
.get_inactivity = _get_inactivity,
.get_reqid = _get_reqid,
.get_if_id = _get_if_id,
action_t (*get_close_action) (child_cfg_t *this);
/**
- * Get the key exchange method to use for CHILD_SA setup.
+ * Get the first algorithm of a certain transform type that's contained in
+ * any of the configured proposals.
*
- * @return key exchange method to use
+ * For instance, use with KEY_EXCHANGE_METHOD to get the KE method to use
+ * for the CHILD_SA initiation.
+ *
+ * @param type transform type to look for
+ * @return algorithm identifier (0 for none)
*/
- key_exchange_method_t (*get_ke_method)(child_cfg_t *this);
+ uint16_t (*get_algorithm)(child_cfg_t *this, transform_type_t type);
/**
* Get the inactivity timeout value.