+// SPDX-License-Identifier: GPL-2.0-or-later
/*
* STATICd - static routes header
* Copyright (C) 2018 Cumulus Networks, Inc.
* Donald Sharp
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __STATIC_ROUTES_H__
#define __STATIC_ROUTES_H__
+#include "lib/bfd.h"
#include "lib/mpls.h"
#include "table.h"
#include "memory.h"
DECLARE_MGROUP(STATIC);
+#include "staticd/static_vrf.h"
+
/* Static route label information */
struct static_nh_label {
uint8_t num_labels;
* The order for below macros should be in sync with
* yang model typedef nexthop-type
*/
-typedef enum {
+enum static_nh_type {
STATIC_IFNAME = 1,
STATIC_IPV4_GATEWAY,
STATIC_IPV4_GATEWAY_IFNAME,
STATIC_IPV6_GATEWAY,
STATIC_IPV6_GATEWAY_IFNAME,
STATIC_BLACKHOLE,
-} static_types;
+};
/*
* Route Creation gives us:
enum static_install_states state;
/* Flag for this static route's type. */
- static_types type;
+ enum static_nh_type type;
/*
* Nexthop value.
/* SR-TE color */
uint32_t color;
+
+ /** BFD integration data. */
+ struct bfd_session_params *bsp;
+ /** Back pointer for route node. */
+ struct route_node *rn;
+ /** Path connection status. */
+ bool path_down;
};
DECLARE_DLIST(static_nexthop_list, struct static_nexthop, list);
}
extern bool mpls_enabled;
+extern uint32_t zebra_ecmp_count;
extern struct zebra_privs_t static_privs;
void static_fixup_vrf_ids(struct static_vrf *svrf);
extern struct static_nexthop *
-static_add_nexthop(struct static_path *pn, static_types type,
+static_add_nexthop(struct static_path *pn, enum static_nh_type type,
struct ipaddr *ipaddr, const char *ifname,
const char *nh_vrf, uint32_t color);
extern void static_install_nexthop(struct static_nexthop *nh);
uint32_t table_id, uint8_t distance);
extern void static_del_path(struct static_path *pn);
-extern void static_get_nh_type(static_types stype, char *type, size_t size);
+extern void static_get_nh_type(enum static_nh_type stype, char *type,
+ size_t size);
extern bool static_add_nexthop_validate(const char *nh_vrf_name,
- static_types type,
+ enum static_nh_type type,
struct ipaddr *ipaddr);
extern struct stable_info *static_get_stable_info(struct route_node *rn);
extern void static_get_nh_str(struct static_nexthop *nh, char *nexthop,
size_t size);
+/*
+ * BFD integration.
+ */
+extern void static_next_hop_bfd_source(struct static_nexthop *sn,
+ const struct ipaddr *source);
+extern void static_next_hop_bfd_auto_source(struct static_nexthop *sn);
+extern void static_next_hop_bfd_monitor_enable(struct static_nexthop *sn,
+ const struct lyd_node *dnode);
+extern void static_next_hop_bfd_monitor_disable(struct static_nexthop *sn);
+extern void static_next_hop_bfd_profile(struct static_nexthop *sn,
+ const char *name);
+extern void static_next_hop_bfd_multi_hop(struct static_nexthop *sn, bool mhop);
+
+/** Call this function after zebra client initialization. */
+extern void static_bfd_initialize(struct zclient *zc, struct thread_master *tm);
+
+extern void static_bfd_show(struct vty *vty, bool isjson);
+
#ifdef __cplusplus
}
#endif