2023-02-08 13:17:09 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2018-05-08 13:58:32 +02:00
|
|
|
/*
|
|
|
|
* Static NHT header.
|
|
|
|
* Copyright (C) 2018 Cumulus Networks, Inc.
|
|
|
|
* Donald Sharp
|
|
|
|
*/
|
|
|
|
#ifndef __STATIC_NHT_H__
|
|
|
|
#define __STATIC_NHT_H__
|
|
|
|
|
2021-05-21 01:22:14 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2019-07-15 22:26:17 +02:00
|
|
|
/*
|
|
|
|
* When we get notification that nexthop tracking has an answer for
|
|
|
|
* us call this function to find the nexthop we are tracking so it
|
|
|
|
* can be installed or removed.
|
|
|
|
*
|
2025-01-27 17:57:54 +01:00
|
|
|
* sp + ssrc_p -> The route we are looking at. If NULL then look at all routes.
|
2019-07-15 22:26:17 +02:00
|
|
|
* nhp -> The nexthop that is being tracked.
|
|
|
|
* nh_num -> number of valid nexthops.
|
|
|
|
* afi -> The afi we are working in.
|
|
|
|
* vrf_id -> The vrf the nexthop is in.
|
|
|
|
*/
|
2025-01-27 17:57:54 +01:00
|
|
|
extern void static_nht_update(const struct prefix *sp, const struct prefix *ssrc_p,
|
|
|
|
struct prefix *nhp, uint32_t nh_num, afi_t afi, safi_t safi,
|
2021-10-04 13:05:18 +02:00
|
|
|
vrf_id_t vrf_id);
|
2019-07-16 14:27:31 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* For the given tracked nexthop, nhp, mark all routes that use
|
|
|
|
* this route as in starting state again.
|
|
|
|
*/
|
2021-10-04 13:05:18 +02:00
|
|
|
extern void static_nht_reset_start(struct prefix *nhp, afi_t afi, safi_t safi,
|
2019-07-16 14:27:31 +02:00
|
|
|
vrf_id_t nh_vrf_id);
|
|
|
|
|
|
|
|
/*
|
2025-01-27 17:57:54 +01:00
|
|
|
* For the given prefix, sp + ssrc_p, mark it as in a particular state
|
2019-07-16 14:27:31 +02:00
|
|
|
*/
|
2025-01-27 17:57:54 +01:00
|
|
|
extern void static_nht_mark_state(const struct prefix *sp, const struct prefix *ssrc_p, safi_t safi,
|
|
|
|
vrf_id_t vrf_id, enum static_install_states state);
|
2020-08-10 09:00:09 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* For the given nexthop, returns the string
|
|
|
|
*/
|
|
|
|
extern void static_get_nh_str(struct static_nexthop *nh, char *nexthop,
|
|
|
|
size_t size);
|
2021-05-21 01:22:14 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2018-05-08 13:58:32 +02:00
|
|
|
#endif
|