]> git.proxmox.com Git - mirror_frr.git/blobdiff - staticd/static_routes.h
isisd: fix recreating the LS TED after re-enabling MPLS TE
[mirror_frr.git] / staticd / static_routes.h
index f64a40329d466c8424fd0503a729e9976f49ca4d..71c3689be54ad3eb60e6d41b64a7350cda18721e 100644 (file)
 #include "table.h"
 #include "memory.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 DECLARE_MGROUP(STATIC);
 
 /* Static route label information */
@@ -43,14 +47,14 @@ enum static_blackhole_type {
  * 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:
@@ -77,12 +81,16 @@ PREDECL_DLIST(static_nexthop_list);
 
 /* Static route information */
 struct static_route_info {
+       struct static_vrf *svrf;
+       safi_t safi;
        /* path list */
        struct static_path_list_head path_list;
 };
 
 /* Static path information */
 struct static_path {
+       /* Route node back pointer. */
+       struct route_node *rn;
        /* Linkage for static path lists */
        struct static_path_list_item list;
        /* Administrative distance. */
@@ -99,6 +107,8 @@ DECLARE_DLIST(static_path_list, struct static_path, list);
 
 /* Static route information. */
 struct static_nexthop {
+       /* Path back pointer. */
+       struct static_path *pn;
        /* For linked list. */
        struct static_nexthop_list_item list;
 
@@ -113,7 +123,7 @@ struct static_nexthop {
        enum static_install_states state;
 
        /* Flag for this static route's type. */
-       static_types type;
+       enum static_nh_type type;
 
        /*
         * Nexthop value.
@@ -153,25 +163,19 @@ static_route_info_from_rnode(struct route_node *rn)
 }
 
 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 route_node *rn, struct static_path *pn, safi_t safi,
-                  struct static_vrf *svrf, 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 route_node *rn,
-                                  struct static_path *pn,
-                                  struct static_nexthop *nh, safi_t safi,
-                                  struct static_vrf *svrf, const char *ifname,
-                                  static_types type, const char *nh_vrf);
+extern void static_install_nexthop(struct static_nexthop *nh);
 
-extern int static_delete_nexthop(struct route_node *rn, struct static_path *pn,
-                                safi_t safi, struct static_vrf *svrf,
-                                struct static_nexthop *nh);
+extern void static_delete_nexthop(struct static_nexthop *nh);
 
 extern void static_cleanup_vrf_ids(struct static_vrf *disable_svrf);
 
@@ -179,27 +183,24 @@ extern void static_install_intf_nh(struct interface *ifp);
 
 extern void static_ifindex_update(struct interface *ifp, bool up);
 
-extern void static_install_path(struct route_node *rn, struct static_path *pn,
-                               safi_t safi, struct static_vrf *svrf);
+extern void static_install_path(struct static_path *pn);
 
 extern struct route_node *static_add_route(afi_t afi, safi_t safi,
                                           struct prefix *p,
                                           struct prefix_ipv6 *src_p,
                                           struct static_vrf *svrf);
-extern void static_del_route(struct route_node *rn, safi_t safi,
-                            struct static_vrf *svrf);
+extern void static_del_route(struct route_node *rn);
 
 extern struct static_path *static_add_path(struct route_node *rn,
                                           uint32_t table_id, uint8_t distance);
-extern void static_del_path(struct route_node *rn, struct static_path *pn,
-                           safi_t safi, struct static_vrf *svrf);
+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_route_info_init(struct static_route_info *si);
 
 extern void zebra_stable_node_cleanup(struct route_table *table,
                                      struct route_node *node);
@@ -216,4 +217,9 @@ extern void zebra_stable_node_cleanup(struct route_table *table,
  */
 extern void static_get_nh_str(struct static_nexthop *nh, char *nexthop,
                              size_t size);
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif