]> git.proxmox.com Git - mirror_frr.git/blob - staticd/static_nht.h
Merge pull request #13649 from donaldsharp/unlock_the_node_or_else
[mirror_frr.git] / staticd / static_nht.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * Static NHT header.
4 * Copyright (C) 2018 Cumulus Networks, Inc.
5 * Donald Sharp
6 */
7 #ifndef __STATIC_NHT_H__
8 #define __STATIC_NHT_H__
9
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13
14 /*
15 * When we get notification that nexthop tracking has an answer for
16 * us call this function to find the nexthop we are tracking so it
17 * can be installed or removed.
18 *
19 * sp -> The route we are looking at. If NULL then look at all
20 * routes.
21 * nhp -> The nexthop that is being tracked.
22 * nh_num -> number of valid nexthops.
23 * afi -> The afi we are working in.
24 * vrf_id -> The vrf the nexthop is in.
25 */
26 extern void static_nht_update(struct prefix *sp, struct prefix *nhp,
27 uint32_t nh_num, afi_t afi, safi_t safi,
28 vrf_id_t vrf_id);
29
30 /*
31 * For the given tracked nexthop, nhp, mark all routes that use
32 * this route as in starting state again.
33 */
34 extern void static_nht_reset_start(struct prefix *nhp, afi_t afi, safi_t safi,
35 vrf_id_t nh_vrf_id);
36
37 /*
38 * For the given prefix, sp, mark it as in a particular state
39 */
40 extern void static_nht_mark_state(struct prefix *sp, safi_t safi,
41 vrf_id_t vrf_id,
42 enum static_install_states state);
43
44 /*
45 * For the given nexthop, returns the string
46 */
47 extern void static_get_nh_str(struct static_nexthop *nh, char *nexthop,
48 size_t size);
49
50 #ifdef __cplusplus
51 }
52 #endif
53
54 #endif