From 3fed4160cd23f1767d8980e8cba10bc3933947d5 Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Tue, 25 Jul 2006 20:44:12 +0000 Subject: [ospfd] Additional NSM neighbour state change stats/information 2006-07-25 Paul Jakma * ospf_neigbor.h: (struct ospf_neighbor) Add some additional neighbour state statistics fields, timestamps for progressive and regressive state changes, and pointer to event string for the latter state change. * ospf_nsm.c: (nsm_notice_state_change) Update new state changs history as required. * ospf_vty.c: (show_ip_ospf_neighbor_detail_sub) Print out above new per-neighbour state change stats. --- ospfd/ospf_vty.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'ospfd/ospf_vty.c') diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 44049d8c..912f1d09 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -3155,12 +3155,21 @@ show_ip_ospf_neighbor_detail_sub (struct vty *vty, struct ospf_interface *oi, nbr->priority, LOOKUP (ospf_nsm_state_msg, nbr->state)); /* Show state changes. */ vty_out (vty, " %d state changes%s", nbr->state_change, VTY_NEWLINE); - if (nbr->ts_last_change.tv_sec || nbr->ts_last_change.tv_usec) + if (nbr->ts_last_progress.tv_sec || nbr->ts_last_progress.tv_usec) { - struct timeval res = tv_sub (recent_time, nbr->ts_last_change); - vty_out (vty, " Last state change %s ago, due to %s%s", + struct timeval res = tv_sub (recent_time, nbr->ts_last_progress); + vty_out (vty, " Most recent state change statistics:%s", + VTY_NEWLINE); + vty_out (vty, " Progressive change %s ago%s", + ospf_timeval_dump (&res, timebuf, sizeof(timebuf)), + VTY_NEWLINE); + } + if (nbr->ts_last_regress.tv_sec || nbr->ts_last_regress.tv_usec) + { + struct timeval res = tv_sub (recent_time, nbr->ts_last_regress); + vty_out (vty, " Regressive change %s ago, due to %s%s", ospf_timeval_dump (&res, timebuf, sizeof(timebuf)), - (nbr->last_event_str ? nbr->last_event_str : "??"), + (nbr->last_regress_str ? nbr->last_regress_str : "??"), VTY_NEWLINE); } /* Show Designated Rotuer ID. */ -- cgit v1.2.1