From 96e30387f164148fe47da6d4481283a61d761c97 Mon Sep 17 00:00:00 2001 From: hasso Date: Mon, 19 Sep 2005 06:35:47 +0000 Subject: * isis_lsp.c: Better output of detailed LSP printout and fixed TE IPv4 reachibility metric display. --- isisd/ChangeLog | 5 +++++ isisd/isis_lsp.c | 19 ++++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/isisd/ChangeLog b/isisd/ChangeLog index 402477b6..3735b4fc 100644 --- a/isisd/ChangeLog +++ b/isisd/ChangeLog @@ -1,3 +1,8 @@ +2005-09-19 Hasso Tepper + + * isis_lsp.c: Better output of detailed LSP printout and fixed TE IPv4 + reachibility metric display. + 2005-09-19 Hasso Tepper * isis_tlv.h: Cleanup comment about TLVs we should support, remove info diff --git a/isisd/isis_lsp.c b/isisd/isis_lsp.c index 26c46a2f..d02f3833 100644 --- a/isisd/isis_lsp.c +++ b/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)), -- cgit v1.2.1