diff options
| author | Christian Hopps <chopps@labn.net> | 2024-09-16 21:34:10 -0400 |
|---|---|---|
| committer | Christian Hopps <chopps@labn.net> | 2024-09-17 22:27:36 -0400 |
| commit | c5df98aece868db29743b72e4a24112067944bd4 (patch) | |
| tree | 93d5d8df353a778755a0e7dac412812f030c5647 /lib/northbound_oper.c | |
| parent | da96ad08cd669c8abf856069df66c9d5ef0d1539 (diff) | |
mgmtd: add ietf-yang-library support
Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'lib/northbound_oper.c')
| -rw-r--r-- | lib/northbound_oper.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/northbound_oper.c b/lib/northbound_oper.c index e95f99a2bd..a3ff360780 100644 --- a/lib/northbound_oper.c +++ b/lib/northbound_oper.c @@ -1741,6 +1741,16 @@ static enum nb_error nb_op_walk_start(struct nb_op_yield_state *ys) return __walk(ys, false); } +bool nb_oper_is_yang_lib_query(const char *xpath) +{ + const char *libstr = "/ietf-yang-library:"; + const unsigned long liblen = strlen(libstr); + + if (strncmp(libstr, xpath, liblen)) + return false; + + return strlen(xpath) > liblen; +} void *nb_oper_walk(const char *xpath, struct yang_translator *translator, uint32_t flags, bool should_batch, nb_oper_data_cb cb, |
