2 * OSPF version 2 Neighbor State Machine
3 * From RFC2328 [OSPF Version 2]
4 * Copyright (C) 1999 Toshiaki Takada
6 * This file is part of GNU Zebra.
8 * GNU Zebra is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2, or (at your option) any
13 * GNU Zebra is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with GNU Zebra; see the file COPYING. If not, write to the Free
20 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
24 #ifndef _ZEBRA_OSPF_NSM_H
25 #define _ZEBRA_OSPF_NSM_H
27 /* OSPF Neighbor State Machine State. */
28 #define NSM_DependUpon 0
35 #define NSM_Exchange 7
38 #define OSPF_NSM_STATE_MAX 10
40 /* OSPF Neighbor State Machine Event. */
42 #define NSM_HelloReceived 1
44 #define NSM_TwoWayReceived 3
45 #define NSM_NegotiationDone 4
46 #define NSM_ExchangeDone 5
47 #define NSM_BadLSReq 6
48 #define NSM_LoadingDone 7
50 #define NSM_SeqNumberMismatch 9
51 #define NSM_OneWayReceived 10
52 #define NSM_KillNbr 11
53 #define NSM_InactivityTimer 12
55 #define OSPF_NSM_EVENT_MAX 14
57 /* Macro for OSPF NSM timer turn on. */
58 #define OSPF_NSM_TIMER_ON(T,F,V) \
61 (T) = thread_add_timer (master, (F), nbr, (V)); \
64 /* Macro for OSPF NSM timer turn off. */
65 #define OSPF_NSM_TIMER_OFF(X) \
74 /* Macro for OSPF NSM schedule event. */
75 #define OSPF_NSM_EVENT_SCHEDULE(N,E) \
76 thread_add_event (master, ospf_nsm_event, (N), (E))
78 /* Macro for OSPF NSM execute event. */
79 #define OSPF_NSM_EVENT_EXECUTE(N,E) \
80 thread_execute (master, ospf_nsm_event, (N), (E))
83 extern int ospf_nsm_event (struct thread
*);
84 extern void nsm_change_state (struct ospf_neighbor
*, int);
85 extern void ospf_check_nbr_loading (struct ospf_neighbor
*);
86 extern int ospf_db_summary_isempty (struct ospf_neighbor
*);
87 extern int ospf_db_summary_count (struct ospf_neighbor
*);
88 extern void ospf_db_summary_clear (struct ospf_neighbor
*);
90 #endif /* _ZEBRA_OSPF_NSM_H */