summaryrefslogtreecommitdiff
path: root/zebra/zebra_nb_config.c
diff options
context:
space:
mode:
authorDmytro Shytyi <dmytro.shytyi@6wind.com>2022-12-05 16:58:53 +0100
committerDmytro Shytyi <dmytro.shytyi@6wind.com>2024-06-07 12:33:47 +0200
commitd875dc37ee03acc1fed4e750bbba8f6137e39fba (patch)
tree964fa48d4c4f59517dde125d3f04638dcbd0c96a /zebra/zebra_nb_config.c
parent0cbe6dfc0854e50883bad4069a988b0c31afb2d6 (diff)
zebra: add 'mpls fec nexthop-resolution' command to vtysh
Commands added: r3# configure r3(config)# mpls fec MPLS FEC table label Label configuration ldp Label Distribution Protocol lsp Establish label switched path r3(config)# mpls fec mpls fec nexthop-resolution Authorise nexthop resolution over all labeled routes. r3(config)# mpls fec mpls fec nexthop-resolution r3# configure r3(config)# vrf default r3(config-vrf)# mpls fec MPLS FEC table r3(config-vrf)# mpls fec mpls fec nexthop-resolution Authorise nexthop resolution over all labeled routes. r3(config-vrf)# mpls fec nexthop-resolution east-vm# show running-config Building configuration... ... ! mpls fec nexthop-resolution ! ... Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
Diffstat (limited to 'zebra/zebra_nb_config.c')
-rw-r--r--zebra/zebra_nb_config.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/zebra/zebra_nb_config.c b/zebra/zebra_nb_config.c
index ae6232a1bb..09c0091ec6 100644
--- a/zebra/zebra_nb_config.c
+++ b/zebra/zebra_nb_config.c
@@ -3781,6 +3781,59 @@ int lib_vrf_zebra_netns_table_range_end_modify(struct nb_cb_modify_args *args)
}
/*
+ * XPath: /frr-vrf:lib/vrf/frr-zebra:zebra/mpls/fec-nexthop-resolution
+ */
+int lib_vrf_zebra_mpls_fec_nexthop_resolution_modify(
+ struct nb_cb_modify_args *args)
+{
+ struct vrf *vrf;
+ struct zebra_vrf *zvrf;
+ bool fec_nexthop_resolution;
+
+ if (args->event != NB_EV_APPLY)
+ return NB_OK;
+
+ vrf = nb_running_get_entry(args->dnode, NULL, true);
+ zvrf = vrf->info;
+
+ fec_nexthop_resolution = yang_dnode_get_bool(args->dnode, NULL);
+
+ if (zvrf->zebra_mpls_fec_nexthop_resolution == fec_nexthop_resolution)
+ return NB_OK;
+
+ zvrf->zebra_mpls_fec_nexthop_resolution = fec_nexthop_resolution;
+
+ zebra_mpls_fec_nexthop_resolution_update(zvrf);
+
+ return NB_OK;
+}
+
+int lib_vrf_zebra_mpls_fec_nexthop_resolution_destroy(
+ struct nb_cb_destroy_args *args)
+{
+ struct vrf *vrf;
+ struct zebra_vrf *zvrf;
+ bool fec_nexthop_resolution;
+
+ if (args->event != NB_EV_APPLY)
+ return NB_OK;
+
+ vrf = nb_running_get_entry(args->dnode, NULL, true);
+ zvrf = vrf->info;
+
+ fec_nexthop_resolution = DFLT_ZEBRA_IP_NHT_RESOLVE_VIA_DEFAULT;
+
+ if (zvrf->zebra_mpls_fec_nexthop_resolution == fec_nexthop_resolution)
+ return NB_OK;
+
+ zvrf->zebra_mpls_fec_nexthop_resolution = fec_nexthop_resolution;
+
+ zebra_mpls_fec_nexthop_resolution_update(zvrf);
+
+ return NB_OK;
+}
+
+/*
* XPath: /frr-vrf:lib/vrf/frr-zebra:zebra/l3vni-id
*/
int lib_vrf_zebra_l3vni_id_modify(struct nb_cb_modify_args *args)