summaryrefslogtreecommitdiff
path: root/ospfd/ospf_nsm.h
diff options
context:
space:
mode:
authorPaul Jakma <paul.jakma@sun.com>2006-07-10 07:45:13 +0000
committerPaul Jakma <paul.jakma@sun.com>2006-07-10 07:45:13 +0000
commit1f2c2743ac188b909114a1bf054a9a41a0cd5635 (patch)
treea55fdbddb1c4f5ea4476fd44ccf2fb988cafd819 /ospfd/ospf_nsm.h
parentaa2737a08a284953908e131894accd25bf627d53 (diff)
[ospfd] cleanup NSM neighbour delete through a new Deleted NSM state
2006-07-07 Paul Jakma <paul.jakma@sun.com> * ospf_nsm.h: Add a NSM_Deleted neighbour state, to act as dummy state indicating the neighbour is to be deleted. * ospf_nsm.c: (general) Use the NSM_Deleted state to delete neighbours, thus allowing code to be slightly more obvious in its flow. (nsm_timer_set) Add NSM_Deleted. Add another timer the code missed. (nsm_kill_nbr) No need for special case call to nsm_change_state anymore. Make the assert and error-handling for same case more readable (Andrew Schorr) Remove the call to ospf_nbr_delete, nsm_change_state can do this generally now via NSM_Deleted. (struct ... NSM) Add the dummy NSM_Deleted state, the 3 events that can lead to nsm_kill_nbr all now transition the NBR to NSM_Deleted and the general change_state function can be left to do the work. (ospf_nsm_event) Special casing of events and early-return can be removed now. On transition into Deleted, delete the nbr. * ospf_dump.c: (ospf_nsm_state_msg) Add Deleted.
Diffstat (limited to 'ospfd/ospf_nsm.h')
-rw-r--r--ospfd/ospf_nsm.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/ospfd/ospf_nsm.h b/ospfd/ospf_nsm.h
index fe42f7a0..1121dae6 100644
--- a/ospfd/ospf_nsm.h
+++ b/ospfd/ospf_nsm.h
@@ -26,15 +26,16 @@
/* OSPF Neighbor State Machine State. */
#define NSM_DependUpon 0
-#define NSM_Down 1
-#define NSM_Attempt 2
-#define NSM_Init 3
-#define NSM_TwoWay 4
-#define NSM_ExStart 5
-#define NSM_Exchange 6
-#define NSM_Loading 7
-#define NSM_Full 8
-#define OSPF_NSM_STATE_MAX 9
+#define NSM_Deleted 1
+#define NSM_Down 2
+#define NSM_Attempt 3
+#define NSM_Init 4
+#define NSM_TwoWay 5
+#define NSM_ExStart 6
+#define NSM_Exchange 7
+#define NSM_Loading 8
+#define NSM_Full 9
+#define OSPF_NSM_STATE_MAX 10
/* OSPF Neighbor State Machine Event. */
#define NSM_NoEvent 0