]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
swanctl: Report per-CPU information in --list-sas
authorTobias Brunner <tobias@strongswan.org>
Thu, 20 May 2021 08:32:09 +0000 (10:32 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 28 May 2025 14:35:27 +0000 (16:35 +0200)
src/swanctl/commands/list_sas.c

index 321bd044dd000478daea71461f0fa8a896d8b6d9..a598f9598e904571cc02e90d829742bc857406b0 100755 (executable)
@@ -129,9 +129,18 @@ CALLBACK(child_sas, int,
        ret = vici_parse_cb(res, NULL, sa_values, sa_list, child);
        if (ret == 0)
        {
-               printf("  %s: #%s, reqid %s, %s, %s%s, %s:",
+               printf("  %s: #%s, reqid %s",
                        child->get(child, "name"), child->get(child, "uniqueid"),
-                       child->get(child, "reqid"), child->get(child, "state"),
+                       child->get(child, "reqid"));
+
+               if (child->get(child, "per-cpu-sas"))
+               {
+                       printf(", cpu %s",
+                                  child->get(child, "cpu") ?: "-");
+               }
+
+               printf(", %s, %s%s, %s:",
+                       child->get(child, "state"),
                        child->get(child, "mode"),
                        child->get(child, "encap") ? "-in-UDP" : "",
                        child->get(child, "protocol"));