]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: add apis to add and delete NHLFEs
authorMark Stapp <mjs@voltanet.io>
Wed, 17 Oct 2018 19:54:53 +0000 (15:54 -0400)
committerMark Stapp <mjs@voltanet.io>
Tue, 22 Jan 2019 17:02:20 +0000 (12:02 -0500)
Add public versions of zebra apis that add NHLFEs to an LSP,
and that free NHLFEs. The dataplane code needs to capture/copy
NHLFEs in order to do async LSP programming.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
zebra/zebra_mpls.c
zebra/zebra_mpls.h

index c0764cd4b8c6090226be791dac19a3d0af8ff7dc..db2fcae5b75dc4c932e27c6752d247529c2f5876 100644 (file)
@@ -1807,6 +1807,29 @@ int zebra_mpls_lsp_uninstall(struct zebra_vrf *zvrf, struct route_node *rn,
        return lsp_uninstall(zvrf, fec->label);
 }
 
+/*
+ * Add an NHLFE to an LSP, return the newly-added object
+ */
+zebra_nhlfe_t *zebra_mpls_lsp_add_nhlfe(zebra_lsp_t *lsp,
+                                       enum lsp_types_t lsp_type,
+                                       enum nexthop_types_t gtype,
+                                       union g_addr *gate,
+                                       ifindex_t ifindex,
+                                       mpls_label_t out_label)
+{
+       /* Just a public pass-through to the internal implementation */
+       return nhlfe_add(lsp, lsp_type, gtype, gate, ifindex, out_label);
+}
+
+/*
+ * Free an allocated NHLFE
+ */
+void zebra_mpls_nhlfe_del(zebra_nhlfe_t *nhlfe)
+{
+       /* Just a pass-through to the internal implementation */
+       nhlfe_del(nhlfe);
+}
+
 /*
  * Registration from a client for the label binding for a FEC. If a binding
  * already exists, it is informed to the client.
index c250fc4058cc80b7e15db132e71a2648e0a76447..2c95d22c4eb759ed8d5e81dc1ba4bd8ea858756c 100644 (file)
@@ -191,6 +191,17 @@ int zebra_mpls_lsp_install(struct zebra_vrf *zvrf, struct route_node *rn,
 int zebra_mpls_lsp_uninstall(struct zebra_vrf *zvrf, struct route_node *rn,
                             struct route_entry *re);
 
+/* Add an NHLFE to an LSP, return the newly-added object */
+zebra_nhlfe_t *zebra_mpls_lsp_add_nhlfe(zebra_lsp_t *lsp,
+                                       enum lsp_types_t lsp_type,
+                                       enum nexthop_types_t gtype,
+                                       union g_addr *gate,
+                                       ifindex_t ifindex,
+                                       mpls_label_t out_label);
+
+/* Free an allocated NHLFE */
+void zebra_mpls_nhlfe_del(zebra_nhlfe_t *nhlfe);
+
 int zebra_mpls_fec_register(struct zebra_vrf *zvrf, struct prefix *p,
                            uint32_t label, uint32_t label_index,
                            struct zserv *client);