]>
git.proxmox.com Git - mirror_frr.git/blob - ospfd/ospf_nsm.h
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 along
19 * with this program; see the file COPYING; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 #ifndef _ZEBRA_OSPF_NSM_H
24 #define _ZEBRA_OSPF_NSM_H
28 /* OSPF Neighbor State Machine State. */
29 #define NSM_DependUpon 0
36 #define NSM_Exchange 7
39 #define OSPF_NSM_STATE_MAX 10
41 /* OSPF Neighbor State Machine Event. */
43 #define NSM_PacketReceived 1 /* HelloReceived in the protocol */
45 #define NSM_TwoWayReceived 3
46 #define NSM_NegotiationDone 4
47 #define NSM_ExchangeDone 5
48 #define NSM_BadLSReq 6
49 #define NSM_LoadingDone 7
51 #define NSM_SeqNumberMismatch 9
52 #define NSM_OneWayReceived 10
53 #define NSM_KillNbr 11
54 #define NSM_InactivityTimer 12
56 #define OSPF_NSM_EVENT_MAX 14
58 /* Macro for OSPF NSM timer turn on. */
59 #define OSPF_NSM_TIMER_ON(T,F,V) thread_add_timer (master, (F), nbr, (V), &(T))
61 /* Macro for OSPF NSM timer turn off. */
62 #define OSPF_NSM_TIMER_OFF(X) thread_cancel(&(X))
64 /* Macro for OSPF NSM schedule event. */
65 #define OSPF_NSM_EVENT_SCHEDULE(N, E) \
66 thread_add_event(master, ospf_nsm_event, (N), (E), NULL)
68 /* Macro for OSPF NSM execute event. */
69 #define OSPF_NSM_EVENT_EXECUTE(N, E) \
70 thread_execute(master, ospf_nsm_event, (N), (E))
73 extern int ospf_nsm_event(struct thread
*);
74 extern void ospf_check_nbr_loading(struct ospf_neighbor
*);
75 extern int ospf_db_summary_isempty(struct ospf_neighbor
*);
76 extern int ospf_db_summary_count(struct ospf_neighbor
*);
77 extern void ospf_db_summary_clear(struct ospf_neighbor
*);
78 extern int nsm_should_adj(struct ospf_neighbor
*nbr
);
79 DECLARE_HOOK(ospf_nsm_change
,
80 (struct ospf_neighbor
* on
, int state
, int oldstate
),
81 (on
, state
, oldstate
));
83 #endif /* _ZEBRA_OSPF_NSM_H */