]> git.proxmox.com Git - mirror_frr.git/blobdiff - isisd/isis_lfa.h
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / isisd / isis_lfa.h
index f09fc663a45a4d2e34e684ab391ed79ff51843ae..0ba1c1cef5d5efdee86fc1ee8a4ec169be31eac1 100644 (file)
@@ -1,28 +1,20 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2020  NetDEF, Inc.
  *                     Renato Westphal
- *
- * 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 _FRR_ISIS_LFA_H
 #define _FRR_ISIS_LFA_H
 
 #include "lib/typesafe.h"
+#include "lib/zclient.h"
+#include "lib/memory.h"
 
-PREDECL_RBTREE_UNIQ(lfa_tiebreaker_tree)
+DECLARE_MTYPE(ISIS_NEXTHOP_LABELS);
+
+PREDECL_RBTREE_UNIQ(lfa_tiebreaker_tree);
+PREDECL_RBTREE_UNIQ(rlfa_tree);
 
 enum lfa_tiebreaker_type {
        LFA_TIEBREAKER_DOWNSTREAM = 0,
@@ -39,7 +31,16 @@ struct lfa_tiebreaker {
 int lfa_tiebreaker_cmp(const struct lfa_tiebreaker *a,
                       const struct lfa_tiebreaker *b);
 DECLARE_RBTREE_UNIQ(lfa_tiebreaker_tree, struct lfa_tiebreaker, entry,
-                   lfa_tiebreaker_cmp)
+                   lfa_tiebreaker_cmp);
+
+struct rlfa {
+       struct rlfa_tree_item entry;
+       struct prefix prefix;
+       struct isis_vertex *vertex;
+       struct in_addr pq_address;
+};
+int rlfa_cmp(const struct rlfa *a, const struct rlfa *b);
+DECLARE_RBTREE_UNIQ(rlfa_tree, struct rlfa, entry, rlfa_cmp);
 
 enum isis_tilfa_sid_type {
        TILFA_SID_PREFIX = 1,
@@ -145,6 +146,19 @@ bool isis_lfa_excise_node_check(const struct isis_spftree *spftree,
                                const uint8_t *id);
 struct isis_spftree *isis_spf_reverse_run(const struct isis_spftree *spftree);
 int isis_spf_run_neighbors(struct isis_spftree *spftree);
+int isis_rlfa_activate(struct isis_spftree *spftree, struct rlfa *rlfa,
+                      struct zapi_rlfa_response *response);
+void isis_rlfa_deactivate(struct isis_spftree *spftree, struct rlfa *rlfa);
+void isis_rlfa_list_init(struct isis_spftree *spftree);
+void isis_rlfa_list_clear(struct isis_spftree *spftree);
+void isis_rlfa_process_ldp_response(struct zapi_rlfa_response *response);
+void isis_ldp_rlfa_handle_client_close(struct zapi_client_close_info *info);
+void isis_rlfa_check(struct isis_spftree *spftree, struct isis_vertex *vertex);
+struct isis_spftree *isis_rlfa_compute(struct isis_area *area,
+                                      struct isis_spftree *spftree,
+                                      struct isis_spftree *spftree_reverse,
+                                      uint32_t max_metric,
+                                      struct lfa_protected_resource *resource);
 void isis_lfa_compute(struct isis_area *area, struct isis_circuit *circuit,
                      struct isis_spftree *spftree,
                      struct lfa_protected_resource *resource);