#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.
*/
/* Invalid op? */
goto done;
- ret = netlink_mpls_multipath_ctx(cmd, ctx);
+ ret = netlink_mpls_multipath(cmd, ctx);
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;