]> git.proxmox.com Git - mirror_frr.git/blob - lib/spf_backoff.h
Merge pull request #3502 from donaldsharp/socket_to_me_baby
[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 struct spf_backoff;
30 struct thread_master;
31 struct vty;
32
33 struct spf_backoff *spf_backoff_new(struct thread_master *m, const char *name,
34 long init_delay, long short_delay,
35 long long_delay, long holddown,
36 long timetolearn);
37
38 void spf_backoff_free(struct spf_backoff *backoff);
39
40 /* Called whenever an IGP event is received, returns how many
41 * milliseconds routing table computation should be delayed */
42 long spf_backoff_schedule(struct spf_backoff *backoff);
43
44 /* Shows status of SPF backoff instance */
45 void spf_backoff_show(struct spf_backoff *backoff, struct vty *vty,
46 const char *prefix);
47
48 /* Writes out global SPF backoff debug config */
49 int spf_backoff_write_config(struct vty *vty);
50
51 /* Registers global SPF backoff debug commands */
52 void spf_backoff_cmd_init(void);
53
54 /* Accessor functions for SPF backoff parameters */
55 long spf_backoff_init_delay(struct spf_backoff *backoff);
56 long spf_backoff_short_delay(struct spf_backoff *backoff);
57 long spf_backoff_long_delay(struct spf_backoff *backoff);
58 long spf_backoff_holddown(struct spf_backoff *backoff);
59 long spf_backoff_timetolearn(struct spf_backoff *backoff);
60
61 #endif