child-create: Add getter for child config

This commit is contained in:
Tobias Brunner 2024-09-03 14:51:46 +02:00
parent 9d4c7bebfc
commit 04c9316db5
2 changed files with 14 additions and 0 deletions

View File

@ -2504,6 +2504,12 @@ METHOD(child_create_t, set_config, void,
this->config = cfg;
}
METHOD(child_create_t, get_config, child_cfg_t*,
private_child_create_t *this)
{
return this->initiator ? this->config : NULL;
}
METHOD(child_create_t, get_lower_nonce, chunk_t,
private_child_create_t *this)
{
@ -2637,6 +2643,7 @@ child_create_t *child_create_create(ike_sa_t *ike_sa,
.get_child = _get_child,
.get_other_spi = _get_other_spi,
.set_config = _set_config,
.get_config = _get_config,
.get_lower_nonce = _get_lower_nonce,
.use_reqid = _use_reqid,
.use_marks = _use_marks,

View File

@ -116,6 +116,13 @@ struct child_create_t {
* @param cfg configuration to enforce, reference gets owned
*/
void (*set_config)(child_create_t *this, child_cfg_t *cfg);
/**
* Get the child config of this task as initiator.
*
* @return config for the CHILD_SA, NULL as responder
*/
child_cfg_t *(*get_config)(child_create_t *this);
};
/**