From: Tobias Brunner Date: Tue, 12 Feb 2019 15:20:12 +0000 (+0100) Subject: swanctl: Report interface IDs in --list-sas X-Git-Tag: 5.8.0rc1~41^2~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19b6d9a62268017ab806f3aa0d3ff41e7ecd6514;p=thirdparty%2Fstrongswan.git swanctl: Report interface IDs in --list-sas --- diff --git a/src/swanctl/commands/list_sas.c b/src/swanctl/commands/list_sas.c index 232f03cc2a..ca2436dd2f 100644 --- a/src/swanctl/commands/list_sas.c +++ b/src/swanctl/commands/list_sas.c @@ -166,12 +166,24 @@ CALLBACK(child_sas, int, printf(" in %s%s%s", child->get(child, "spi-in"), child->get(child, "cpi-in") ? "/" : "", child->get(child, "cpi-in") ?: ""); - if (child->get(child, "mark-in")) + if (child->get(child, "mark-in") || child->get(child, "if-id-in")) { - printf(" (0x%s", child->get(child, "mark-in")); - if (child->get(child, "mark-mask-in")) + printf(" ("); + if (child->get(child, "mark-in")) { - printf("/0x%s", child->get(child, "mark-mask-in")); + printf("0x%s", child->get(child, "mark-in")); + if (child->get(child, "mark-mask-in")) + { + printf("/0x%s", child->get(child, "mark-mask-in")); + } + } + else + { + printf("-"); + } + if (child->get(child, "if-id-in")) + { + printf("|0x%s", child->get(child, "if-id-in")); } printf(")"); } @@ -186,12 +198,24 @@ CALLBACK(child_sas, int, printf(" out %s%s%s", child->get(child, "spi-out"), child->get(child, "cpi-out") ? "/" : "", child->get(child, "cpi-out") ?: ""); - if (child->get(child, "mark-out")) + if (child->get(child, "mark-out") || child->get(child, "if-id-out")) { - printf(" (0x%s", child->get(child, "mark-out")); - if (child->get(child, "mark-mask-out")) + printf(" ("); + if (child->get(child, "mark-out")) + { + printf("0x%s", child->get(child, "mark-out")); + if (child->get(child, "mark-mask-out")) + { + printf("/0x%s", child->get(child, "mark-mask-out")); + } + } + else + { + printf("-"); + } + if (child->get(child, "if-id-out")) { - printf("/0x%s", child->get(child, "mark-mask-out")); + printf("|0x%s", child->get(child, "if-id-out")); } printf(")"); }