]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/zebra_mpls_netlink.c
pim6d: Add [no] ipv6 pim bsm" command
[mirror_frr.git] / zebra / zebra_mpls_netlink.c
index a9233530dc9c16968bffa25f07f6fda3381d4cc4..ce7702b82313d8bd500fb7748371ff34e6963a16 100644 (file)
 #include "zebra/rt.h"
 #include "zebra/rt_netlink.h"
 #include "zebra/zebra_mpls.h"
+#include "zebra/kernel_netlink.h"
 
-/*
- * LSP forwarding update using dataplane context information.
- */
-enum zebra_dplane_result kernel_lsp_update(struct zebra_dplane_ctx *ctx)
+ssize_t netlink_lsp_msg_encoder(struct zebra_dplane_ctx *ctx, void *buf,
+                               size_t buflen)
 {
-       int cmd, ret = -1;
+       int cmd;
 
        /* Call to netlink layer based on type of update */
        if (dplane_ctx_get_op(ctx) == DPLANE_OP_LSP_DELETE) {
@@ -45,20 +44,21 @@ enum zebra_dplane_result kernel_lsp_update(struct zebra_dplane_ctx *ctx)
                        if (IS_ZEBRA_DEBUG_KERNEL || IS_ZEBRA_DEBUG_MPLS)
                                zlog_debug("LSP in-label %u: update fails, no best NHLFE",
                                           dplane_ctx_get_in_label(ctx));
-                       goto done;
+                       return -1;
                }
 
                cmd = RTM_NEWROUTE;
        } else
                /* Invalid op? */
-               goto done;
-
-       ret = netlink_mpls_multipath(cmd, ctx);
+               return -1;
 
-done:
+       return netlink_mpls_multipath_msg_encode(cmd, ctx, buf, buflen);
+}
 
-       return (ret == 0 ?
-               ZEBRA_DPLANE_REQUEST_SUCCESS : ZEBRA_DPLANE_REQUEST_FAILURE);
+enum netlink_msg_status netlink_put_lsp_update_msg(struct nl_batch *bth,
+                                                  struct zebra_dplane_ctx *ctx)
+{
+       return netlink_batch_add_msg(bth, ctx, netlink_lsp_msg_encoder, false);
 }
 
 /*
@@ -66,9 +66,10 @@ done:
  * 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)
+enum netlink_msg_status netlink_put_pw_update_msg(struct nl_batch *bth,
+                                                 struct zebra_dplane_ctx *ctx)
 {
-       return ZEBRA_DPLANE_REQUEST_SUCCESS;
+       return FRR_NETLINK_SUCCESS;
 }
 
 int mpls_kernel_init(void)