]> git.proxmox.com Git - mirror_frr.git/blobdiff - staticd/static_routes.h
mgmtd: Enroll Staticd as a backend client for MGMTD
[mirror_frr.git] / staticd / static_routes.h
index eb7953db2cfb79dab27c097b0cc2b541a7eaa4f9..4fd7a1342ff8cdcc1f5a2ea630a31971271db7b9 100644 (file)
@@ -159,6 +159,31 @@ static_route_info_from_rnode(struct route_node *rn)
        return (struct static_route_info *)(rn->info);
 }
 
+static inline void static_get_nh_type(enum static_nh_type stype, char *type,
+                                     size_t size)
+{
+       switch (stype) {
+       case STATIC_IFNAME:
+               strlcpy(type, "ifindex", size);
+               break;
+       case STATIC_IPV4_GATEWAY:
+               strlcpy(type, "ip4", size);
+               break;
+       case STATIC_IPV4_GATEWAY_IFNAME:
+               strlcpy(type, "ip4-ifindex", size);
+               break;
+       case STATIC_BLACKHOLE:
+               strlcpy(type, "blackhole", size);
+               break;
+       case STATIC_IPV6_GATEWAY:
+               strlcpy(type, "ip6", size);
+               break;
+       case STATIC_IPV6_GATEWAY_IFNAME:
+               strlcpy(type, "ip6-ifindex", size);
+               break;
+       };
+}
+
 extern bool mpls_enabled;
 extern uint32_t zebra_ecmp_count;
 
@@ -192,8 +217,6 @@ extern struct static_path *static_add_path(struct route_node *rn,
                                           uint32_t table_id, uint8_t distance);
 extern void static_del_path(struct static_path *pn);
 
-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,
                                        enum static_nh_type type,
                                        struct ipaddr *ipaddr);