From: Tobias Brunner Date: Thu, 20 May 2021 08:32:09 +0000 (+0200) Subject: swanctl: Report per-CPU information in --list-sas X-Git-Tag: 6.0.2dr1~5^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f95bdb6fb0f479e4c974d21ed5d54afcbe52609d;p=thirdparty%2Fstrongswan.git swanctl: Report per-CPU information in --list-sas --- diff --git a/src/swanctl/commands/list_sas.c b/src/swanctl/commands/list_sas.c index 321bd044dd..a598f9598e 100755 --- a/src/swanctl/commands/list_sas.c +++ b/src/swanctl/commands/list_sas.c @@ -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"));