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

index 8436c66dc637a34a300cc09c2b3ae287295eb9cb..13163dd0f1772d973b46dee7daf92b05d0588220 100644 (file)
@@ -1435,6 +1435,12 @@ METHOD(quick_mode_t, get_mid, uint32_t,
        return this->mid;
 }
 
+METHOD(quick_mode_t, get_config, child_cfg_t*,
+       private_quick_mode_t *this)
+{
+       return this->initiator ? this->config : NULL;
+}
+
 METHOD(quick_mode_t, use_reqid, void,
        private_quick_mode_t *this, uint32_t reqid)
 {
@@ -1534,6 +1540,7 @@ quick_mode_t *quick_mode_create(ike_sa_t *ike_sa, child_cfg_t *config,
                                .destroy = _destroy,
                        },
                        .get_mid = _get_mid,
+                       .get_config = _get_config,
                        .use_reqid = _use_reqid,
                        .use_marks = _use_marks,
                        .use_if_ids = _use_if_ids,
index 2b048940722c78bdc075b6f0f766885e1706c999..23efd341101872d20dea27716f831a36aa28df05 100644 (file)
@@ -47,6 +47,13 @@ struct quick_mode_t {
         */
        uint32_t (*get_mid)(quick_mode_t *this);
 
+       /**
+        * Get the child config of this task as initiator.
+        *
+        * @return                              config for the CHILD_SA, NULL as responder
+        */
+       child_cfg_t *(*get_config)(quick_mode_t *this);
+
        /**
         * Use a specific reqid to install this CHILD_SA.
         *