]> git.proxmox.com Git - mirror_frr.git/blob - lib/spf_backoff.h
Merge pull request #5625 from qlyoung/fix-zapi-ipset-name-nullterm
[mirror_frr.git] / lib / spf_backoff.h
1 /*
2 * This is an implementation of the IETF SPF delay algorithm
3 * as explained in draft-ietf-rtgwg-backoff-algo-04
4 *
5 * Created: 25-01-2017 by S. Litkowski
6 *
7 * Copyright (C) 2017 Orange Labs http://www.orange.com/
8 * Copyright (C) 2017 by Christian Franke, Open Source Routing / NetDEF Inc.
9 *
10 * This file is part of FreeRangeRouting (FRR)
11 *
12 * FRR is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2, or (at your option) any
15 * later version.
16 *
17 * FRR is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License along
23 * with this program; see the file COPYING; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 */
26 #ifndef _ZEBRA_SPF_BACKOFF_H
27 #define _ZEBRA_SPF_BACKOFF_H
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 struct spf_backoff;
34 struct thread_master;
35 struct vty;
36
37 struct spf_backoff *spf_backoff_new(struct thread_master *m, const char *name,
38 long init_delay, long short_delay,
39 long long_delay, long holddown,
40 long timetolearn);
41
42 void spf_backoff_free(struct spf_backoff *backoff);
43
44 /* Called whenever an IGP event is received, returns how many
45 * milliseconds routing table computation should be delayed */
46 long spf_backoff_schedule(struct spf_backoff *backoff);
47
48 /* Shows status of SPF backoff instance */
49 void spf_backoff_show(struct spf_backoff *backoff, struct vty *vty,
50 const char *prefix);
51
52 /* Writes out global SPF backoff debug config */
53 int spf_backoff_write_config(struct vty *vty);
54
55 /* Registers global SPF backoff debug commands */
56 void spf_backoff_cmd_init(void);
57
58 /* Accessor functions for SPF backoff parameters */
59 long spf_backoff_init_delay(struct spf_backoff *backoff);
60 long spf_backoff_short_delay(struct spf_backoff *backoff);
61 long spf_backoff_long_delay(struct spf_backoff *backoff);
62 long spf_backoff_holddown(struct spf_backoff *backoff);
63 long spf_backoff_timetolearn(struct spf_backoff *backoff);
64
65 #ifdef __cplusplus
66 }
67 #endif
68
69 #endif