]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/zebra_mpls_netlink.c
Merge pull request #5789 from donaldsharp/bgp_ebgp_reason
[mirror_frr.git] / zebra / zebra_mpls_netlink.c
index 63f518ffc37bf5dbe9abf5678597512b95ff5984..a9233530dc9c16968bffa25f07f6fda3381d4cc4 100644 (file)
 #include "zebra/rt_netlink.h"
 #include "zebra/zebra_mpls.h"
 
-/*
- * Install Label Forwarding entry into the kernel.
- */
-enum zebra_dplane_result kernel_add_lsp(zebra_lsp_t *lsp)
-{
-       int ret;
-
-       if (!lsp || !lsp->best_nhlfe) { // unexpected
-               kernel_lsp_pass_fail(lsp, ZEBRA_DPLANE_INSTALL_FAILURE);
-               return ZEBRA_DPLANE_REQUEST_FAILURE;
-       }
-
-       ret = netlink_mpls_multipath(RTM_NEWROUTE, lsp);
-
-       kernel_lsp_pass_fail(lsp,
-                            (!ret) ? ZEBRA_DPLANE_INSTALL_SUCCESS
-                                   : ZEBRA_DPLANE_INSTALL_FAILURE);
-
-       return ZEBRA_DPLANE_REQUEST_SUCCESS;
-}
-
-/*
- * Update Label Forwarding entry in the kernel. This means that the Label
- * forwarding entry is already installed and needs an update - either a new
- * path is to be added, an installed path has changed (e.g., outgoing label)
- * or an installed path (but not all paths) has to be removed. This performs
- * a REPLACE operation, internally.
- */
-enum zebra_dplane_result kernel_upd_lsp(zebra_lsp_t *lsp)
-{
-       int ret;
-
-       if (!lsp || !lsp->best_nhlfe) { // unexpected
-               kernel_lsp_pass_fail(lsp, ZEBRA_DPLANE_INSTALL_FAILURE);
-               return ZEBRA_DPLANE_REQUEST_FAILURE;
-       }
-
-       ret = netlink_mpls_multipath(RTM_NEWROUTE, lsp);
-
-       kernel_lsp_pass_fail(lsp,
-                            (!ret) ? ZEBRA_DPLANE_INSTALL_SUCCESS
-                                   : ZEBRA_DPLANE_INSTALL_FAILURE);
-
-       return ZEBRA_DPLANE_REQUEST_SUCCESS;
-}
-
-/*
- * Delete Label Forwarding entry from the kernel.
- */
-enum zebra_dplane_result kernel_del_lsp(zebra_lsp_t *lsp)
-{
-       int ret;
-
-       if (!lsp) { // unexpected
-               kernel_lsp_pass_fail(lsp, ZEBRA_DPLANE_DELETE_FAILURE);
-               return ZEBRA_DPLANE_REQUEST_FAILURE;
-       }
-
-       if (!CHECK_FLAG(lsp->flags, LSP_FLAG_INSTALLED)) {
-               kernel_lsp_pass_fail(lsp, ZEBRA_DPLANE_DELETE_FAILURE);
-               return ZEBRA_DPLANE_REQUEST_FAILURE;
-       }
-
-       ret = netlink_mpls_multipath(RTM_DELROUTE, lsp);
-
-       kernel_lsp_pass_fail(lsp,
-                            (!ret) ? ZEBRA_DPLANE_DELETE_SUCCESS
-                                   : ZEBRA_DPLANE_DELETE_FAILURE);
-
-       return ZEBRA_DPLANE_REQUEST_SUCCESS;
-}
-
 /*
  * LSP forwarding update using dataplane context information.
  */
@@ -125,7 +53,7 @@ enum zebra_dplane_result kernel_lsp_update(struct zebra_dplane_ctx *ctx)
                /* Invalid op? */
                goto done;
 
-       ret = netlink_mpls_multipath_ctx(cmd, ctx);
+       ret = netlink_mpls_multipath(cmd, ctx);
 
 done:
 
@@ -133,6 +61,16 @@ done:
                ZEBRA_DPLANE_REQUEST_SUCCESS : ZEBRA_DPLANE_REQUEST_FAILURE);
 }
 
+/*
+ * Pseudowire update api - not supported by netlink as of 12/18,
+ * but note that the default has been to report 'success' for pw updates
+ * on unsupported platforms.
+ */
+enum zebra_dplane_result kernel_pw_update(struct zebra_dplane_ctx *ctx)
+{
+       return ZEBRA_DPLANE_REQUEST_SUCCESS;
+}
+
 int mpls_kernel_init(void)
 {
        struct stat st;