]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
vici: Report per-CPU SA information
authorTobias Brunner <tobias@strongswan.org>
Thu, 20 May 2021 08:19:41 +0000 (10:19 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 28 May 2025 14:35:27 +0000 (16:35 +0200)
src/libcharon/plugins/vici/README.md
src/libcharon/plugins/vici/vici_query.c

index a43c603991b796bf9482b7fa61d2540eb577b776..985fb4a24e56a9936fe7afba6ccdef27ed9edd59 100644 (file)
@@ -819,6 +819,8 @@ command.
                                        mark-mask-out = <hex encoded outbound Netfilter mark mask>
                                        if-id-in = <hex encoded inbound XFRM interface ID>
                                        if-id-out = <hex encoded outbound XFRM interface ID>
+                                       per-cpu-sas = <yes if per-CPU SAs enabled>
+                                       cpu = <CPU ID of per-CPU SA>
                                        label = <hex encoded security label>
                                        encr-alg = <ESP encryption algorithm name, if any>
                                        encr-keysize = <ESP encryption key size, if applicable>
index bb02121072c2645ab8b3de1833ecbff9f592dec7..43e3f441377a24136d3bf70bc552932129216728 100644 (file)
@@ -200,7 +200,7 @@ static void list_child_ipsec(vici_builder_t *b, child_sa_t *child)
 {
        proposal_t *proposal;
        uint16_t alg, ks;
-       uint32_t if_id;
+       uint32_t if_id, cpu;
 
        b->add_kv(b, "protocol", "%N", protocol_id_names,
                          child->get_protocol(child));
@@ -229,6 +229,15 @@ static void list_child_ipsec(vici_builder_t *b, child_sa_t *child)
        {
                b->add_kv(b, "if-id-out", "%.8x", if_id);
        }
+       if (child->use_per_cpu(child))
+       {
+               b->add_kv(b, "per-cpu-sas", "yes");
+       }
+       cpu = child->get_cpu(child);
+       if (cpu != CPU_ID_MAX)
+       {
+               b->add_kv(b, "cpu", "%u", cpu);
+       }
 
        proposal = child->get_proposal(child);
        if (proposal)