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_nsm.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'ospfd/ospf_nsm.c') diff --git a/ospfd/ospf_nsm.c b/ospfd/ospf_nsm.c index ff0a52d0..8329a4f3 100644 --- a/ospfd/ospf_nsm.c +++ b/ospfd/ospf_nsm.c @@ -615,8 +615,14 @@ nsm_notice_state_change (struct ospf_neighbor *nbr, int next_state, int event) LOOKUP (ospf_nsm_state_msg, next_state), ospf_nsm_event_str [event]); - nbr->ts_last_change = recent_time; - nbr->last_event_str = ospf_nsm_event_str [event]; + /* Advance in NSM */ + if (next_state > nbr->state) + nbr->ts_last_progress = recent_time; + else /* regression in NSM */ + { + nbr->ts_last_regress = recent_time; + nbr->last_regress_str = ospf_nsm_event_str [event]; + } #ifdef HAVE_SNMP /* Terminal state or regression */ -- cgit v1.2.3