diff options
author | Paul Jakma <paul.jakma@sun.com> | 2006-07-11 17:57:25 +0000 |
---|---|---|
committer | Paul Jakma <paul.jakma@sun.com> | 2006-07-11 17:57:25 +0000 |
commit | 90c33177f53ae36a8765f5f27bf34a90663806d3 (patch) | |
tree | 1439091ac03207b7cbe204c4fc57ea821144fba2 /ospfd/ospf_vty.c | |
parent | 3d63f38064f646129ddc67410cfdbbee8538f5cc (diff) |
[ospfd] record timestamp and event of last NSM state change for neighbour
2006-07-10 Paul Jakma <paul.jakma@sun.com>
* ospf_nsm.c: (ospf_nsm_event) Record state change timestamp
and event in nbr struct.
* ospf_neighbor.h: (struct ospf_neighbor) Add fields to record
timestamp of last NSM change and event.
* ospf_vty.c: (show_ip_ospf_neighbor_detail_sub) Print
last state change timestamp and event, if available.
Diffstat (limited to 'ospfd/ospf_vty.c')
-rw-r--r-- | ospfd/ospf_vty.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index ec002017..44049d8c 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -3155,7 +3155,14 @@ 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) + { + struct timeval res = tv_sub (recent_time, nbr->ts_last_change); + vty_out (vty, " Last state change %s ago, due to %s%s", + ospf_timeval_dump (&res, timebuf, sizeof(timebuf)), + (nbr->last_event_str ? nbr->last_event_str : "??"), + VTY_NEWLINE); + } /* Show Designated Rotuer ID. */ vty_out (vty, " DR is %s,", inet_ntoa (nbr->d_router)); /* Show Backup Designated Rotuer ID. */ |