]>
git.proxmox.com Git - mirror_frr.git/blob - ospfd/ospf_nsm.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * OSPF version 2 Neighbor State Machine
4 * From RFC2328 [OSPF Version 2]
5 * Copyright (C) 1999 Toshiaki Takada
8 #ifndef _ZEBRA_OSPF_NSM_H
9 #define _ZEBRA_OSPF_NSM_H
13 /* OSPF Neighbor State Machine State. */
14 #define NSM_DependUpon 0
21 #define NSM_Exchange 7
24 #define OSPF_NSM_STATE_MAX 10
26 /* OSPF Neighbor State Machine Event. */
28 #define NSM_HelloReceived 1 /* HelloReceived in the protocol */
30 #define NSM_TwoWayReceived 3
31 #define NSM_NegotiationDone 4
32 #define NSM_ExchangeDone 5
33 #define NSM_BadLSReq 6
34 #define NSM_LoadingDone 7
36 #define NSM_SeqNumberMismatch 9
37 #define NSM_OneWayReceived 10
38 #define NSM_KillNbr 11
39 #define NSM_InactivityTimer 12
41 #define OSPF_NSM_EVENT_MAX 14
43 /* Macro for OSPF NSM timer turn on. */
44 #define OSPF_NSM_TIMER_ON(T,F,V) thread_add_timer (master, (F), nbr, (V), &(T))
46 /* Macro for OSPF NSM schedule event. */
47 #define OSPF_NSM_EVENT_SCHEDULE(N, E) \
48 thread_add_event(master, ospf_nsm_event, (N), (E), NULL)
50 /* Macro for OSPF NSM execute event. */
51 #define OSPF_NSM_EVENT_EXECUTE(N, E) \
52 thread_execute(master, ospf_nsm_event, (N), (E))
55 extern void ospf_nsm_event(struct thread
*);
56 extern void ospf_check_nbr_loading(struct ospf_neighbor
*);
57 extern int ospf_db_summary_isempty(struct ospf_neighbor
*);
58 extern int ospf_db_summary_count(struct ospf_neighbor
*);
59 extern void ospf_db_summary_clear(struct ospf_neighbor
*);
60 extern int nsm_should_adj(struct ospf_neighbor
*nbr
);
61 DECLARE_HOOK(ospf_nsm_change
,
62 (struct ospf_neighbor
* on
, int state
, int oldstate
),
63 (on
, state
, oldstate
));
65 #endif /* _ZEBRA_OSPF_NSM_H */