From e641bb557983ff4b79e7267ad8226a44254bca1a Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Wed, 21 Oct 2020 20:55:20 +0200 Subject: [PATCH] Align layout and formatting of 'show pim rp' and 'show pim crp' Signed-off-by: Joachim Wiberg --- doc/TODO.org | 3 +-- src/ipc.c | 12 ++++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/doc/TODO.org b/doc/TODO.org index b878a6ff..a4940db3 100644 --- a/doc/TODO.org +++ b/doc/TODO.org @@ -5,7 +5,7 @@ that came up at the right moment to be written down. * pimd 3.0 release: -** Fix layouts of =show pim rp= and =show pim crp= +** DONE Fix layouts of =show pim rp= and =show pim crp= They are too different to make sense. Align on one common format, for example the following. Notice the column changes in both outputs and @@ -21,7 +21,6 @@ Group Address RP Address Prio Holdtime Expires 232/8 169.254.0.1 1 Static Never 224/4 192.168.122.1 20 75 0h1m10s - ** DONE Shared pimctl with pimd-dense ** DONE Update man page + split into a pimd.conf(5) ** TODO Automatically add IP alias as altnet diff --git a/src/ipc.c b/src/ipc.c index 49c7f4b3..36b3cb39 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -375,7 +375,7 @@ static int show_rp(FILE *fp) grp_mask_t *grp; if (grp_mask_list) - fprintf(fp, "Group Address RP Address Type Prio Holdtime =\n"); + fprintf(fp, "Group Address RP Address Prio Holdtime Type=\n"); for (grp = grp_mask_list; grp; grp = grp->next) { struct rp_grp_entry *rp_grp = grp->grp_rp_next; @@ -398,9 +398,9 @@ static int show_rp(FILE *fp) snprintf(htstr, sizeof(htstr), "%d", ht); } - fprintf(fp, "%-15s %-7s %4d %8s\n", + fprintf(fp, "%-15s %4d %8s %-7s\n", inet_fmt(rp_grp->rp->rpentry->address, s1, sizeof(s1)), - type, rp_grp->priority, htstr); + rp_grp->priority, htstr, type); rp_grp = rp_grp->grp_rp_next; } @@ -415,7 +415,7 @@ static int show_crp(FILE *fp) struct cand_rp *rp; if (cand_rp_list) - fprintf(fp, "RP Address Group Address Prio Holdtime Expires =\n"); + fprintf(fp, "Group Address RP Address Prio Holdtime Expires =\n"); for (rp = cand_rp_list; rp; rp = rp->next) { struct rp_grp_entry *rp_grp = rp->rp_grp_next; @@ -428,9 +428,9 @@ static int show_crp(FILE *fp) else snprintf(buf, sizeof(buf), "%8d", entry->adv_holdtime); - fprintf(fp, "%-15s %-18s %4d %s %s\n", - inet_fmt(entry->address, s1, sizeof(s1)), + fprintf(fp, "%-18s %-15s %4d %s %s\n", netname(grp->group_addr, grp->group_mask), + inet_fmt(entry->address, s1, sizeof(s1)), rp_grp->priority, buf, PIM_HELLO_HOLDTIME_FOREVER == rp_grp->holdtime ? "Never"