summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2019-01-30 04:54:25 -0500
committerRenato Westphal <renato@opensourcerouting.org>2019-02-11 15:49:49 -0200
commit95ce849b58cb8706b32d6cfb957286c8007da37e (patch)
tree62b76d34d6fbdcd520ff02bd55d3a1b5f4decb98 /lib
parentd01b92fd7507d64bec89350daf725aa6fb9fdcf4 (diff)
libs, rip, isis: change northbound operation enum to DESTROY
Change the northbound lib operation from DELETE to DESTROY; make the required changes in the users of the northbound, in the cli, rip, ripng, and isis. Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'lib')
-rw-r--r--lib/if.c4
-rw-r--r--lib/northbound.c16
-rw-r--r--lib/northbound.h2
-rw-r--r--lib/northbound_confd.c2
-rw-r--r--lib/northbound_sysrepo.c4
5 files changed, 14 insertions, 14 deletions
diff --git a/lib/if.c b/lib/if.c
index 16b6512441..48841c7ee8 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -1160,7 +1160,7 @@ DEFPY (no_interface,
if (!vrfname)
vrfname = VRF_DEFAULT_NAME;
- nb_cli_enqueue_change(vty, ".", NB_OP_DELETE, NULL);
+ nb_cli_enqueue_change(vty, ".", NB_OP_DESTROY, NULL);
return nb_cli_apply_changes(
vty, "/frr-interface:lib/interface[name='%s'][vrf='%s']",
@@ -1207,7 +1207,7 @@ DEFPY (no_interface_desc,
NO_STR
"Interface specific description\n")
{
- nb_cli_enqueue_change(vty, "./description", NB_OP_DELETE, NULL);
+ nb_cli_enqueue_change(vty, "./description", NB_OP_DESTROY, NULL);
return nb_cli_apply_changes(vty, NULL);
}
diff --git a/lib/northbound.c b/lib/northbound.c
index 951c2d5cbc..15139aa8d0 100644
--- a/lib/northbound.c
+++ b/lib/northbound.c
@@ -184,7 +184,7 @@ static unsigned int nb_node_validate_cbs(const struct nb_node *nb_node)
!!nb_node->cbs.create, false);
error += nb_node_validate_cb(nb_node, NB_OP_MODIFY,
!!nb_node->cbs.modify, false);
- error += nb_node_validate_cb(nb_node, NB_OP_DELETE,
+ error += nb_node_validate_cb(nb_node, NB_OP_DESTROY,
!!nb_node->cbs.destroy, false);
error += nb_node_validate_cb(nb_node, NB_OP_MOVE, !!nb_node->cbs.move,
false);
@@ -417,7 +417,7 @@ static void nb_config_diff(const struct nb_config *config1,
break;
case LYD_DIFF_DELETED:
dnode = diff->first[i];
- operation = NB_OP_DELETE;
+ operation = NB_OP_DESTROY;
break;
case LYD_DIFF_CHANGED:
dnode = diff->second[i];
@@ -485,7 +485,7 @@ int nb_candidate_edit(struct nb_config *candidate,
lyd_validate(&dnode, LYD_OPT_CONFIG, ly_native_ctx);
}
break;
- case NB_OP_DELETE:
+ case NB_OP_DESTROY:
dnode = yang_dnode_get(candidate->dnode, xpath_edit);
if (!dnode)
/*
@@ -741,7 +741,7 @@ static int nb_configuration_callback(const enum nb_event event,
case NB_OP_MODIFY:
ret = (*nb_node->cbs.modify)(event, dnode, resource);
break;
- case NB_OP_DELETE:
+ case NB_OP_DESTROY:
ret = (*nb_node->cbs.destroy)(event, dnode);
break;
case NB_OP_MOVE:
@@ -912,7 +912,7 @@ static void nb_transaction_apply_finish(struct nb_transaction *transaction)
* (the 'apply_finish' callbacks from the node ancestors should
* be called though).
*/
- if (change->cb.operation == NB_OP_DELETE) {
+ if (change->cb.operation == NB_OP_DESTROY) {
char xpath[XPATH_MAXLEN];
dnode = dnode->parent;
@@ -1359,7 +1359,7 @@ bool nb_operation_is_valid(enum nb_operation operation,
return false;
}
return true;
- case NB_OP_DELETE:
+ case NB_OP_DESTROY:
if (!CHECK_FLAG(snode->flags, LYS_CONFIG_W))
return false;
@@ -1511,8 +1511,8 @@ const char *nb_operation_name(enum nb_operation operation)
return "create";
case NB_OP_MODIFY:
return "modify";
- case NB_OP_DELETE:
- return "delete";
+ case NB_OP_DESTROY:
+ return "destroy";
case NB_OP_MOVE:
return "move";
case NB_OP_APPLY_FINISH:
diff --git a/lib/northbound.h b/lib/northbound.h
index 557c4fb7ce..4d760e2d33 100644
--- a/lib/northbound.h
+++ b/lib/northbound.h
@@ -65,7 +65,7 @@ enum nb_event {
enum nb_operation {
NB_OP_CREATE,
NB_OP_MODIFY,
- NB_OP_DELETE,
+ NB_OP_DESTROY,
NB_OP_MOVE,
NB_OP_APPLY_FINISH,
NB_OP_GET_ELEM,
diff --git a/lib/northbound_confd.c b/lib/northbound_confd.c
index 53149d0fd2..a8e0017819 100644
--- a/lib/northbound_confd.c
+++ b/lib/northbound_confd.c
@@ -228,7 +228,7 @@ frr_confd_cdb_diff_iter(confd_hkeypath_t *kp, enum cdb_iter_op cdb_op,
nb_op = NB_OP_CREATE;
break;
case MOP_DELETED:
- nb_op = NB_OP_DELETE;
+ nb_op = NB_OP_DESTROY;
break;
case MOP_VALUE_SET:
if (nb_operation_is_valid(NB_OP_MODIFY, nb_node->snode))
diff --git a/lib/northbound_sysrepo.c b/lib/northbound_sysrepo.c
index 860c27edbd..f426f52bd9 100644
--- a/lib/northbound_sysrepo.c
+++ b/lib/northbound_sysrepo.c
@@ -202,10 +202,10 @@ static int frr_sr_process_change(struct nb_config *candidate,
* notified about the removal of all of its leafs, even the ones
* that are non-optional. We need to ignore these notifications.
*/
- if (!nb_operation_is_valid(NB_OP_DELETE, nb_node->snode))
+ if (!nb_operation_is_valid(NB_OP_DESTROY, nb_node->snode))
return NB_OK;
- nb_op = NB_OP_DELETE;
+ nb_op = NB_OP_DESTROY;
break;
case SR_OP_MOVED:
nb_op = NB_OP_MOVE;