2 * OSPF flap dampening by Manav Bhatia
5 * This file is part of GNU Zebra.
7 * GNU Zebra is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2, or (at your option) any
12 * GNU Zebra is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Zebra; see the file COPYING. If not, write to the Free
19 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
24 * Flap Damping (target e.g. link/route)
27 #define HAVE_OSPF6_DAMP
42 /* Structure maintained per target basis */
43 struct ospf6_damp_info
45 /* identifier to decide which target */
49 /* do we damping this info */
54 time_t t_start
; /* First flap (down event) time */
55 time_t t_updated
; /* Last time the penalty was updated */
57 /* index and double-link for reuse list */
59 struct ospf6_damp_info
*next
;
60 struct ospf6_damp_info
*prev
;
62 /* the last event that we are avoiding */
63 int (*event
) (void *target
);
65 damp_event_t event_type
;
66 damp_event_t target_status
;
69 #define OSPF6_DAMP_TYPE_ROUTE 0
70 #define OSPF6_DAMP_TYPE_MAX 1
72 /* Global Configuration Parameters */
73 struct ospf6_damp_config
75 /* is damping enabled ? */
78 /* configurable parameters */
82 u_int t_hold
; /* Maximum hold down time */
84 /* Non configurable parameters */
87 u_int default_penalty
;
88 u_int ceiling
; /* Max value a penalty can attain */
91 int decay_array_size
; /* Calculated using config parameters */
92 double *decay_array
; /* Storage for decay values */
94 int reuse_index_array_size
; /* Size of reuse index array */
95 int *reuse_index_array
;
97 int reuse_list_size
; /* Number of reuse lists */
98 struct ospf6_damp_info
**reuse_list_array
;
101 int ospf6_damp_reuse_timer (struct thread
*);
102 void ospf6_damp_event_up (u_short type
, struct prefix
*name
,
103 int (*exec_up
) (void *), void *target
);
104 void ospf6_damp_event_down (u_short type
, struct prefix
*name
,
105 int (*exec_down
) (void *), void *target
);
107 void ospf6_damp_config_write (struct vty
*);
108 void ospf6_damp_init ();