]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Nest: Minor formatting changes
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Fri, 8 Dec 2017 14:16:47 +0000 (15:16 +0100)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Fri, 8 Dec 2017 14:16:47 +0000 (15:16 +0100)
nest/iface.c
nest/proto.c
nest/rt-show.c

index 5e0a2450fc5ebceaf509ac78dde4517ed70518eb..a876e9ff5131e0dc019d0bd1ec4610cf5cf22738 100644 (file)
@@ -880,7 +880,7 @@ if_show_summary(void)
 {
   struct iface *i;
 
-  cli_msg(-2005,  "%-10s %-6s %-18s %s", "Interface", "State", "IPv4 address", "IPv6 address");
+  cli_msg(-2005, "%-10s %-6s %-18s %s", "Interface", "State", "IPv4 address", "IPv6 address");
   WALK_LIST(i, iface_list)
     {
       byte a4[IPA_MAX_TEXT_LENGTH + 17];
index a2a2bc7e55f33c13bd7bb25bfc1332c8154f7b37..d76505179b3bd13f751b1fff69e87cab23e2a7ce 100644 (file)
@@ -1662,13 +1662,14 @@ proto_cmd_show(struct proto *p, uintptr_t verbose, int cnt)
 
   /* First protocol - show header */
   if (!cnt)
-    cli_msg(-2002, "name     proto    table    state  since       info");
+    cli_msg(-2002, "%-10s %-10s %-10s %-6s %-12s  %s",
+           "Name", "Proto", "Table", "State", "Since", "Info");
 
   buf[0] = 0;
   if (p->proto->get_status)
     p->proto->get_status(p, buf);
   tm_format_time(tbuf, &config->tf_proto, p->last_state_change);
-  cli_msg(-1002, "%-8s %-8s %-8s %-5s  %-10s  %s",
+  cli_msg(-1002, "%-10s %-10s %-10s %-6s %-12s  %s",
          p->name,
          p->proto->name,
          p->main_channel ? p->main_channel->table->name : "---",
index 9989afa4929f5b8597ac174cc005c8ef5469ac08..41a141a2602d6f8cf7d985041f5cebe9a551c6ce 100644 (file)
@@ -63,7 +63,7 @@ rt_show_rte(struct cli *c, byte *ia, rte *e, struct rt_show_data *d, ea_list *tm
   if (d->last_table != d->tab)
     rt_show_table(c, d);
 
-  cli_printf(c, -1007, "%-18s %s [%s %s%s]%s%s", ia, rta_dest_name(a->dest),
+  cli_printf(c, -1007, "%-20s %s [%s %s%s]%s%s", ia, rta_dest_name(a->dest),
             a->src->proto->name, tm, from, primary ? (sync_error ? " !" : " *") : "", info);
 
   if (a->dest == RTD_UNICAST)
@@ -71,6 +71,7 @@ rt_show_rte(struct cli *c, byte *ia, rte *e, struct rt_show_data *d, ea_list *tm
     {
       char mpls[MPLS_MAX_LABEL_STACK*12 + 5], *lsp = mpls;
       char *onlink = (nh->flags & RNF_ONLINK) ? " onlink" : "";
+      char weight[16] = "";
 
       if (nh->labels)
         {
@@ -81,11 +82,14 @@ rt_show_rte(struct cli *c, byte *ia, rte *e, struct rt_show_data *d, ea_list *tm
       *lsp = '\0';
 
       if (a->nh.next)
-       cli_printf(c, -1007, "\tvia %I%s on %s%s weight %d",
-                  nh->gw, mpls, nh->iface->name, onlink, nh->weight + 1);
+       bsprintf(weight, " weight %d", nh->weight + 1);
+
+      if (ipa_nonzero(nh->gw))
+       cli_printf(c, -1007, "\tvia %I on %s%s%s%s",
+                  nh->gw, nh->iface->name, mpls, onlink, weight);
       else
-       cli_printf(c, -1007, "\tvia %I%s on %s%s",
-                  nh->gw, mpls, nh->iface->name, onlink);
+       cli_printf(c, -1007, "\tdev %s%s%s",
+                  nh->iface->name, mpls,  onlink, weight);
     }
 
   if (d->verbose)