diff --git a/CHANGELOG.md b/CHANGELOG.md index 11a7b845..3a3121df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,7 @@ ``` ### Minor changes +* Added synatctic check for yang status: current, deprectated or obsolete. * Added CLICON_NACM_MODE "internal-rpc" which is for RPC functionality only, ie no module or data-node read-write functionality. This is for backward compatibility with Clixon 3. (A reduced-functionality "internal") * Made Makefile concurrent so that it can be compiled with -jN * Added flags to example backend to control its behaviour: diff --git a/lib/src/clixon_yang.c b/lib/src/clixon_yang.c index 8c0f097d..f73f3ea3 100644 --- a/lib/src/clixon_yang.c +++ b/lib/src/clixon_yang.c @@ -3032,6 +3032,15 @@ ys_parse_sub(yang_stmt *ys, } cv_uint32_set(ys->ys_cv, date); break; + case Y_STATUS: /* RFC7950 7.21.2: "current", "deprecated", or "obsolete". */ + if (strcmp(ys->ys_argument, "current") && + strcmp(ys->ys_argument, "deprecated") && + strcmp(ys->ys_argument, "obsolete")){ + clicon_err(OE_YANG, errno, "Invalid status: \"%s\", expected current, deprecated, or obsolete", ys->ys_argument); + goto done; + + } + break; case Y_UNKNOWN: /* XXX This code assumes ymod already loaded but it may not be */ if (extra == NULL)