summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_nsm.c
diff options
context:
space:
mode:
authorAndrew J. Schorr <ajschorr@alumni.princeton.edu>2006-06-29 20:20:52 +0000
committerAndrew J. Schorr <ajschorr@alumni.princeton.edu>2006-06-29 20:20:52 +0000
commitd7e60dd7a9f0213aaa82d256a78ab74887946e53 (patch)
tree2e3488591d1ac48d10ddca05fa4cd68e3611f583 /ospfd/ospf_nsm.c
parent5f41e90e49b8ced6b5adac3933736067d2b24584 (diff)
downloadquagga-d7e60dd7a9f0213aaa82d256a78ab74887946e53.tar.bz2
quagga-d7e60dd7a9f0213aaa82d256a78ab74887946e53.tar.xz
[ospfd] Implement new ospf router subcommand "log-adjacency-changes [detail]"
2006-06-28 Erik Muller <erikm@internap.com> * ospfd.h: Define 2 new struct ospf config flags: OSPF_LOG_ADJACENCY_CHANGES and OSPF_LOG_ADJACENCY_DETAIL * ospf_nsm.c (nsm_change_state): Log adjacency changes if requested. * ospf_vty.c (ospf_log_adjacency_changes): New command function to implement ospf subcommand "log-adjacency-changes [detail]". (no_ospf_log_adjacency_changes) Turn off log-adjacency-changes. (show_ip_ospf) Show whether adjacency changes are logged. (ospf_config_write) Add "log-adjacency-changes [detail]" to config. (ospf_vty_init) Add ospf_log_adjacency_changes and no_ospf_log_adjacency_changes. * ospfd.texi: Document new ospf router subcommand "log-adjacency-changes [detail]".
Diffstat (limited to 'ospfd/ospf_nsm.c')
-rw-r--r--ospfd/ospf_nsm.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/ospfd/ospf_nsm.c b/ospfd/ospf_nsm.c
index 8a93f0e6..878ab567 100644
--- a/ospfd/ospf_nsm.c
+++ b/ospfd/ospf_nsm.c
@@ -697,7 +697,17 @@ nsm_change_state (struct ospf_neighbor *nbr, int state)
if (oi->type == OSPF_IFTYPE_VIRTUALLINK)
vl_area = ospf_area_lookup_by_area_id (oi->ospf, oi->vl_data->vl_area_id);
-
+
+ /* Optionally notify about adjacency changes */
+ if (CHECK_FLAG(oi->ospf->config, OSPF_LOG_ADJACENCY_CHANGES) &&
+ (old_state != state) &&
+ (CHECK_FLAG(oi->ospf->config, OSPF_LOG_ADJACENCY_DETAIL) ||
+ (state == NSM_Full) || (state < old_state)))
+ zlog_notice("AdjChg: Nbr %s on %s: %s -> %s",
+ inet_ntoa (nbr->router_id), IF_NAME (nbr->oi),
+ LOOKUP (ospf_nsm_state_msg, old_state),
+ LOOKUP (ospf_nsm_state_msg, state));
+
#ifdef HAVE_SNMP
/* Terminal state or regression */
if ((state == NSM_Full) || (state == NSM_TwoWay) || (state < old_state))