From: Tobias Brunner Date: Tue, 3 Sep 2024 12:51:46 +0000 (+0200) Subject: child-create: Add getter for child config X-Git-Tag: 6.0.0rc1~47^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04c9316db56229cc77733c507f78ada1aff1f85a;p=thirdparty%2Fstrongswan.git child-create: Add getter for child config --- diff --git a/src/libcharon/sa/ikev2/tasks/child_create.c b/src/libcharon/sa/ikev2/tasks/child_create.c index 66a4cabe5b..8933b73a4c 100644 --- a/src/libcharon/sa/ikev2/tasks/child_create.c +++ b/src/libcharon/sa/ikev2/tasks/child_create.c @@ -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, diff --git a/src/libcharon/sa/ikev2/tasks/child_create.h b/src/libcharon/sa/ikev2/tasks/child_create.h index eae39e61ca..96294c17b5 100644 --- a/src/libcharon/sa/ikev2/tasks/child_create.h +++ b/src/libcharon/sa/ikev2/tasks/child_create.h @@ -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); }; /**