Browse Source

* isis_lsp.c: Better output of detailed LSP printout and fixed TE IPv4
reachibility metric display.

hasso 16 years ago
parent
commit
96e30387f1
2 changed files with 15 additions and 9 deletions
  1. 5 0
      isisd/ChangeLog
  2. 10 9
      isisd/isis_lsp.c

+ 5 - 0
isisd/ChangeLog

@@ -1,3 +1,8 @@
+2005-09-19 Hasso Tepper <hasso at quagga.net>
+
+	* isis_lsp.c: Better output of detailed LSP printout and fixed TE IPv4
+	  reachibility metric display.
+
 2005-09-19 Hasso Tepper <hasso at quagga.net>
 
 	* isis_tlv.h: Cleanup comment about TLVs we should support, remove info

+ 10 - 9
isisd/isis_lsp.c

@@ -795,7 +795,7 @@ lsp_print_detail (dnode_t * node, struct vty *vty, char dynhost)
     for (ALL_LIST_ELEMENTS (lsp->tlv_data.is_neighs, lnode, lnnode, is_neigh))
       {
 	lspid_print (is_neigh->neigh_id, LSPid, dynhost, 0);
-	vty_out (vty, "  Metric: %d IS %s%s",
+	vty_out (vty, "  Metric: %-10d IS %s%s",
 		 is_neigh->metrics.metric_default, LSPid, VTY_NEWLINE);
       }
   
@@ -808,7 +808,7 @@ lsp_print_detail (dnode_t * node, struct vty *vty, char dynhost)
 	      sizeof (ipv4_reach_prefix));
       memcpy (ipv4_reach_mask, inet_ntoa (ipv4_reach->mask),
 	      sizeof (ipv4_reach_mask));
-      vty_out (vty, "  Metric: %d IP %s %s%s",
+      vty_out (vty, "  Metric: %-10d IP-Internal %s %s%s",
 	       ipv4_reach->metrics.metric_default, ipv4_reach_prefix,
 	       ipv4_reach_mask, VTY_NEWLINE);
     }
@@ -822,7 +822,7 @@ lsp_print_detail (dnode_t * node, struct vty *vty, char dynhost)
 	      sizeof (ipv4_reach_prefix));
       memcpy (ipv4_reach_mask, inet_ntoa (ipv4_reach->mask),
 	      sizeof (ipv4_reach_mask));
-      vty_out (vty, "  Metric: %d IP-External %s %s%s",
+      vty_out (vty, "  Metric: %-10d IP-External %s %s%s",
 	       ipv4_reach->metrics.metric_default, ipv4_reach_prefix,
 	       ipv4_reach_mask, VTY_NEWLINE);
     }
@@ -839,11 +839,11 @@ lsp_print_detail (dnode_t * node, struct vty *vty, char dynhost)
       inet_ntop (AF_INET6, &in6, (char *)buff, BUFSIZ);
       if ((ipv6_reach->control_info &&
 	   CTRL_INFO_DISTRIBUTION) == DISTRIBUTION_INTERNAL)
-	vty_out (vty, "  Metric: %d IPv6-Intern %s/%d%s",
+	vty_out (vty, "  Metric: %-10d IPv6-Internal %s/%d%s",
 		 ntohl (ipv6_reach->metric),
 		 buff, ipv6_reach->prefix_len, VTY_NEWLINE);
       else
-	vty_out (vty, "  Metric: %d IPv6-Extern %s/%d%s",
+	vty_out (vty, "  Metric: %-10d IPv6-External %s/%d%s",
 		 ntohl (ipv6_reach->metric),
 		 buff, ipv6_reach->prefix_len, VTY_NEWLINE);
     }
@@ -854,10 +854,11 @@ lsp_print_detail (dnode_t * node, struct vty *vty, char dynhost)
     for (ALL_LIST_ELEMENTS (lsp->tlv_data.te_is_neighs, lnode, 
                             lnnode, te_is_neigh))
     {
-      /* FIXME: metric display is wrong. */
+      uint32_t metric;
+      memcpy (&metric, te_is_neigh->te_metric, 3);
       lspid_print (te_is_neigh->neigh_id, LSPid, dynhost, 0);
-      vty_out (vty, "  Metric: %d extd-IS %s%s",
-	       te_is_neigh->te_metric[0], LSPid, VTY_NEWLINE);
+      vty_out (vty, "  Metric: %-10d IS-Extended %s%s",
+	       ntohl (metric << 8), LSPid, VTY_NEWLINE);
     }
 
   /* TE IPv4 tlv */
@@ -866,7 +867,7 @@ lsp_print_detail (dnode_t * node, struct vty *vty, char dynhost)
                             lnnode, te_ipv4_reach))
     {
       /* FIXME: There should be better way to output this stuff. */
-      vty_out (vty, "  Metric: %d extd-IP %s/%d%s",
+      vty_out (vty, "  Metric: %-10d IP-Extended %s/%d%s",
 	       ntohl (te_ipv4_reach->te_metric),
 	       inet_ntoa (newprefix2inaddr (&te_ipv4_reach->prefix_start,
 					    te_ipv4_reach->control)),