description
"Preference value used for DF election.";
}
+ leaf bypass {
+ type boolean;
+ default "false";
+ description
+ "Bypass mode.";
+ }
}
container state {
config false;
zebra_evpn_es_br_port_dplane_update(es, __func__);
}
-static void zebra_evpn_es_bypass_cfg_update(struct zebra_if *zif, bool bypass)
+void zebra_evpn_es_bypass_cfg_update(struct zebra_if *zif, bool bypass)
{
bool old_bypass = !!(zif->es_info.flags & ZIF_CFG_ES_FLAG_BYPASS);
if (zif->flags & ZIF_FLAG_EVPN_MH_UPLINK)
vty_out(vty, " evpn mh uplink\n");
+ if (zif->es_info.flags & ZIF_CFG_ES_FLAG_BYPASS)
+ vty_out(vty, " evpn mh bypass\n");
+
return 0;
}
"[no] evpn mh bypass",
NO_STR "EVPN\n" EVPN_MH_VTY_STR "set bypass mode\n")
{
- VTY_DECLVAR_CONTEXT(interface, ifp);
- struct zebra_if *zif;
-
- zif = ifp->info;
-
- if (no) {
- zebra_evpn_es_bypass_cfg_update(zif, false);
- } else {
- if (!zebra_evpn_is_if_es_capable(zif)) {
- vty_out(vty,
- "%% DF bypass cannot be associated with this interface type\n");
- return CMD_WARNING;
- }
- zebra_evpn_es_bypass_cfg_update(zif, true);
- }
- return CMD_SUCCESS;
+ if (!no)
+ nb_cli_enqueue_change(vty, "./frr-zebra:zebra/evpn-mh/bypass",
+ NB_OP_MODIFY, "true");
+ else
+ nb_cli_enqueue_change(vty, "./frr-zebra:zebra/evpn-mh/bypass",
+ NB_OP_DESTROY, NULL);
+ return nb_cli_apply_changes(vty, NULL);
}
/* CLI for configuring DF preference part for an ES */
void zebra_evpn_es_type0_esi_update(struct zebra_if *zif, esi_t *esi);
void zebra_evpn_es_df_pref_update(struct zebra_if *zif, uint16_t df_pref);
+void zebra_evpn_es_bypass_cfg_update(struct zebra_if *zif, bool bypass);
void zebra_evpn_mh_if_init(struct zebra_if *zif);
.modify = lib_interface_zebra_evpn_mh_df_preference_modify,
}
},
+ {
+ .xpath = "/frr-interface:lib/interface/frr-zebra:zebra/evpn-mh/bypass",
+ .cbs = {
+ .modify = lib_interface_zebra_evpn_mh_bypass_modify,
+ }
+ },
{
.xpath = "/frr-interface:lib/interface/frr-zebra:zebra/state/up-count",
.cbs = {
struct nb_cb_destroy_args *args);
int lib_interface_zebra_evpn_mh_df_preference_modify(
struct nb_cb_modify_args *args);
+int lib_interface_zebra_evpn_mh_bypass_modify(struct nb_cb_modify_args *args);
struct yang_data *
lib_interface_zebra_state_up_count_get_elem(struct nb_cb_get_elem_args *args);
struct yang_data *
return NB_OK;
}
+/*
+ * XPath: /frr-interface:lib/interface/frr-zebra:zebra/evpn-mh/bypass
+ */
+int lib_interface_zebra_evpn_mh_bypass_modify(struct nb_cb_modify_args *args)
+{
+ struct interface *ifp;
+ bool bypass;
+
+ if (args->event != NB_EV_APPLY)
+ return NB_OK;
+
+ ifp = nb_running_get_entry(args->dnode, NULL, true);
+ bypass = yang_dnode_get_bool(args->dnode, NULL);
+ zebra_evpn_es_bypass_cfg_update(ifp->info, bypass);
+
+ return NB_OK;
+}
+
/*
* XPath: /frr-vrf:lib/vrf/frr-zebra:zebra/l3vni-id
*/