mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-25 10:08:09 +00:00
isisd: Add nb command to unset an SRv6 locator
Add a northbound command to unset an SRv6 locator for a specific IS-IS area. This is a wrapper around `isis_srv6_locator_unset()`. Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
This commit is contained in:
parent
95096e9585
commit
31d76b1045
@ -871,6 +871,7 @@ const struct frr_yang_module_info frr_isisd_info = {
|
||||
.xpath = "/frr-isisd:isis/instance/segment-routing-srv6/locator",
|
||||
.cbs = {
|
||||
.modify = isis_instance_segment_routing_srv6_locator_modify,
|
||||
.destroy = isis_instance_segment_routing_srv6_locator_destroy,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -328,6 +328,8 @@ void cli_show_isis_srv6_enabled(struct vty *vty, const struct lyd_node *dnode,
|
||||
bool show_defaults);
|
||||
int isis_instance_segment_routing_srv6_locator_modify(
|
||||
struct nb_cb_modify_args *args);
|
||||
int isis_instance_segment_routing_srv6_locator_destroy(
|
||||
struct nb_cb_destroy_args *args);
|
||||
int isis_instance_mpls_ldp_sync_destroy(struct nb_cb_destroy_args *args);
|
||||
int isis_instance_mpls_ldp_sync_create(struct nb_cb_create_args *args);
|
||||
int isis_instance_mpls_ldp_sync_holddown_modify(struct nb_cb_modify_args *args);
|
||||
|
@ -3527,6 +3527,41 @@ int isis_instance_segment_routing_srv6_locator_modify(
|
||||
return NB_OK;
|
||||
}
|
||||
|
||||
int isis_instance_segment_routing_srv6_locator_destroy(
|
||||
struct nb_cb_destroy_args *args)
|
||||
{
|
||||
struct isis_area *area;
|
||||
const char *loc_name;
|
||||
|
||||
if (args->event != NB_EV_APPLY)
|
||||
return NB_OK;
|
||||
|
||||
area = nb_running_get_entry(lyd_parent(lyd_parent(args->dnode)), NULL,
|
||||
true);
|
||||
|
||||
loc_name = yang_dnode_get_string(args->dnode, NULL);
|
||||
|
||||
sr_debug("Trying to unset SRv6 locator %s", loc_name);
|
||||
|
||||
if (strncmp(loc_name, area->srv6db.config.srv6_locator_name,
|
||||
sizeof(area->srv6db.config.srv6_locator_name)) != 0) {
|
||||
sr_debug("SRv6 locator %s is not configured", loc_name);
|
||||
snprintf(args->errmsg, args->errmsg_len,
|
||||
"SRv6 locator %s is not configured", loc_name);
|
||||
return NB_ERR_NO_CHANGES;
|
||||
}
|
||||
|
||||
if (!isis_srv6_locator_unset(area)) {
|
||||
zlog_warn("Failed to unset SRv6 locator");
|
||||
return NB_ERR;
|
||||
}
|
||||
|
||||
sr_debug("Deleted SRv6 locator %s for IS-IS area %s", loc_name,
|
||||
area->area_tag);
|
||||
|
||||
return NB_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* XPath: /frr-isisd:isis/instance/mpls/ldp-sync
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user