swanctl: Report interface IDs in --list-sas

This commit is contained in:
Tobias Brunner
2019-04-04 09:31:38 +02:00
parent aa841dbbfc
commit 19b6d9a622
+32 -8
View File
@@ -166,12 +166,24 @@ CALLBACK(child_sas, int,
printf(" in %s%s%s", child->get(child, "spi-in"), printf(" in %s%s%s", child->get(child, "spi-in"),
child->get(child, "cpi-in") ? "/" : "", child->get(child, "cpi-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")); printf(" (");
if (child->get(child, "mark-mask-in")) 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(")"); printf(")");
} }
@@ -186,12 +198,24 @@ CALLBACK(child_sas, int,
printf(" out %s%s%s", child->get(child, "spi-out"), printf(" out %s%s%s", child->get(child, "spi-out"),
child->get(child, "cpi-out") ? "/" : "", child->get(child, "cpi-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")); printf(" (");
if (child->get(child, "mark-mask-out")) if (child->get(child, "mark-out"))
{ {
printf("/0x%s", child->get(child, "mark-mask-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, "if-id-out"));
} }
printf(")"); printf(")");
} }