]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
child-create: Add getter for child config
authorTobias Brunner <tobias@strongswan.org>
Tue, 3 Sep 2024 12:51:46 +0000 (14:51 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 18 Sep 2024 09:53:17 +0000 (11:53 +0200)
src/libcharon/sa/ikev2/tasks/child_create.c
src/libcharon/sa/ikev2/tasks/child_create.h

index 66a4cabe5b0cf2589f11d78bb41b79464e1c1346..8933b73a4cf6f010459199c2d588b03bfb2746dd 100644 (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,
index eae39e61cad57215aa82a63eff9a7ba4f5fe5fc4..96294c17b559b51170063baf26076a98c5bbed79 100644 (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);
 };
 
 /**