]> git.proxmox.com Git - mirror_frr.git/blob - lib/spf_backoff.h
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / lib / spf_backoff.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * This is an implementation of the IETF SPF delay algorithm
4 * as explained in draft-ietf-rtgwg-backoff-algo-04
5 *
6 * Created: 25-01-2017 by S. Litkowski
7 *
8 * Copyright (C) 2017 Orange Labs http://www.orange.com/
9 * Copyright (C) 2017 by Christian Franke, Open Source Routing / NetDEF Inc.
10 *
11 * This file is part of FRRouting (FRR)
12 */
13 #ifndef _ZEBRA_SPF_BACKOFF_H
14 #define _ZEBRA_SPF_BACKOFF_H
15
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19
20 struct spf_backoff;
21 struct thread_master;
22 struct vty;
23
24 struct spf_backoff *spf_backoff_new(struct thread_master *m, const char *name,
25 long init_delay, long short_delay,
26 long long_delay, long holddown,
27 long timetolearn);
28
29 void spf_backoff_free(struct spf_backoff *backoff);
30
31 /* Called whenever an IGP event is received, returns how many
32 * milliseconds routing table computation should be delayed */
33 long spf_backoff_schedule(struct spf_backoff *backoff);
34
35 /* Shows status of SPF backoff instance */
36 void spf_backoff_show(struct spf_backoff *backoff, struct vty *vty,
37 const char *prefix);
38
39 /* Writes out global SPF backoff debug config */
40 int spf_backoff_write_config(struct vty *vty);
41
42 /* Registers global SPF backoff debug commands */
43 void spf_backoff_cmd_init(void);
44
45 /* Accessor functions for SPF backoff parameters */
46 long spf_backoff_init_delay(struct spf_backoff *backoff);
47 long spf_backoff_short_delay(struct spf_backoff *backoff);
48 long spf_backoff_long_delay(struct spf_backoff *backoff);
49 long spf_backoff_holddown(struct spf_backoff *backoff);
50 long spf_backoff_timetolearn(struct spf_backoff *backoff);
51
52 #ifdef __cplusplus
53 }
54 #endif
55
56 #endif