summaryrefslogtreecommitdiffstats
path: root/lib/vty.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2023-10-06 01:58:58 +0200
committerIgor Ryzhov <iryzhov@nfware.com>2024-01-11 14:06:53 +0100
commit76e4eb84dd815ddee7d7e46bb5a2635bfe2501f5 (patch)
treeea6bd2707b0146d203feabcf2c820a0756f1dbfd /lib/vty.c
parentlib: split nb_operation into two types (diff)
downloadfrr-76e4eb84dd815ddee7d7e46bb5a2635bfe2501f5.tar.xz
frr-76e4eb84dd815ddee7d7e46bb5a2635bfe2501f5.zip
mgmtd, lib: implement CREATE_EXCL operation
Currently, there's no difference between CREATE and MODIFY operations. To be compatible with NETCONF/RESTCONF, add new CREATE_EXCL operation that throws an error if the configuration data already exists. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'lib/vty.c')
-rw-r--r--lib/vty.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/vty.c b/lib/vty.c
index 546392ba7..69df0a024 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -4001,6 +4001,11 @@ int vty_mgmt_send_config_data(struct vty *vty, const char *xpath_base,
MGMTD__CFG_DATA_REQ_TYPE__DELETE_DATA;
break;
+ case NB_OP_CREATE_EXCL:
+ cfg_req[indx].req_type =
+ MGMTD__CFG_DATA_REQ_TYPE__CREATE_DATA;
+ break;
+
case NB_OP_CREATE:
case NB_OP_MODIFY:
case NB_OP_MOVE: