summaryrefslogtreecommitdiff
path: root/lib/northbound_sysrepo.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2023-10-06 00:13:16 +0300
committerIgor Ryzhov <iryzhov@nfware.com>2024-01-11 15:06:50 +0200
commit5d1a31403832a069d1b655bc3410fcd770ad8313 (patch)
tree733aa85a7c347533acd0ca952fa235a72ed486e8 /lib/northbound_sysrepo.c
parent67e8ef293f03b2dfd52981c7d82fbc98716fa1e5 (diff)
lib: split nb_operation into two types
Currently, nb_operation enum means two different things - edit operation type (frontend part), and callback type (backend part). These types overlap, but they are not identical. We need to add more operation types to support NETCONF/RESTCONF integration, so it's better to have separate enums to identify different entities. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'lib/northbound_sysrepo.c')
-rw-r--r--lib/northbound_sysrepo.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/northbound_sysrepo.c b/lib/northbound_sysrepo.c
index 535c8b637e..1a194935ac 100644
--- a/lib/northbound_sysrepo.c
+++ b/lib/northbound_sysrepo.c
@@ -186,12 +186,12 @@ static int frr_sr_process_change(struct nb_config *candidate,
/* Map operation values. */
switch (sr_op) {
case SR_OP_CREATED:
+ nb_op = NB_OP_CREATE;
+ break;
case SR_OP_MODIFIED:
- if (nb_operation_is_valid(NB_OP_CREATE, nb_node->snode))
- nb_op = NB_OP_CREATE;
- else if (nb_operation_is_valid(NB_OP_MODIFY, nb_node->snode)) {
+ if (nb_is_operation_allowed(nb_node, NB_OP_MODIFY))
nb_op = NB_OP_MODIFY;
- } else
+ else
/* Ignore list keys modifications. */
return NB_OK;
break;
@@ -201,7 +201,7 @@ 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_DESTROY, nb_node->snode))
+ if (!nb_is_operation_allowed(nb_node, NB_OP_DESTROY))
return NB_OK;
nb_op = NB_OP_DESTROY;