]>
Commit | Line | Data |
---|---|---|
acddc0ed | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
7e24fdf3 DS |
2 | /* |
3 | * Static NHT header. | |
4 | * Copyright (C) 2018 Cumulus Networks, Inc. | |
5 | * Donald Sharp | |
7e24fdf3 DS |
6 | */ |
7 | #ifndef __STATIC_NHT_H__ | |
8 | #define __STATIC_NHT_H__ | |
9 | ||
deca28a3 CH |
10 | #ifdef __cplusplus |
11 | extern "C" { | |
12 | #endif | |
13 | ||
27da3044 DS |
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, | |
6bcc4665 DL |
27 | uint32_t nh_num, afi_t afi, safi_t safi, |
28 | vrf_id_t vrf_id); | |
9fafbd15 DS |
29 | |
30 | /* | |
31 | * For the given tracked nexthop, nhp, mark all routes that use | |
32 | * this route as in starting state again. | |
33 | */ | |
6bcc4665 | 34 | extern void static_nht_reset_start(struct prefix *nhp, afi_t afi, safi_t safi, |
9fafbd15 DS |
35 | vrf_id_t nh_vrf_id); |
36 | ||
37 | /* | |
38 | * For the given prefix, sp, mark it as in a particular state | |
39 | */ | |
6bcc4665 DL |
40 | extern void static_nht_mark_state(struct prefix *sp, safi_t safi, |
41 | vrf_id_t vrf_id, | |
9fafbd15 | 42 | enum static_install_states state); |
b2f6ab67 | 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); | |
deca28a3 CH |
49 | |
50 | #ifdef __cplusplus | |
51 | } | |
52 | #endif | |
53 | ||
7e24fdf3 | 54 | #endif |