Skip to content

Commit

Permalink
Align layout and formatting of 'show pim rp' and 'show pim crp'
Browse files Browse the repository at this point in the history
Signed-off-by: Joachim Wiberg <[email protected]>
  • Loading branch information
troglobit committed Oct 21, 2020
1 parent 0100d7f commit e641bb5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions doc/TODO.org
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand All @@ -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;
Expand All @@ -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"
Expand Down

0 comments on commit e641bb5

Please sign in to comment.