Skip to content

Commit

Permalink
netconf-monitoring UPDATE include submodules in schemas
Browse files Browse the repository at this point in the history
Fixes #1511
  • Loading branch information
michalvasko committed Dec 8, 2023
1 parent bf8c85a commit 0f8a719
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/netconf_monitoring.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,13 @@ np2srv_ncm_oper_cb(sr_session_ctx_t *session, uint32_t UNUSED(sub_id), const cha
{
struct lyd_node *root = NULL, *cont, *list;
const struct lys_module *mod;
const struct lysp_submodule *submod;
sr_conn_ctx_t *conn;
struct ly_ctx *ly_ctx;
char **cpblts;
char *time_str, buf[11];
uint32_t i;
LY_ARRAY_COUNT_TYPE u;
struct timespec ts;

/* context is locked while the callback is executed */
Expand Down Expand Up @@ -319,6 +321,18 @@ np2srv_ncm_oper_cb(sr_session_ctx_t *session, uint32_t UNUSED(sub_id), const cha
lyd_new_list(cont, NULL, "schema", 0, &list, mod->name, mod->revision ? mod->revision : "", "yin");
lyd_new_term(list, NULL, "namespace", mod->ns, 0, NULL);
lyd_new_term(list, NULL, "location", "NETCONF", 0, NULL);

LY_ARRAY_FOR(mod->parsed->includes, u) {
submod = mod->parsed->includes[u].submodule;

lyd_new_list(cont, NULL, "schema", 0, &list, submod->name, submod->revs ? submod->revs[0].date : "", "yang");
lyd_new_term(list, NULL, "namespace", mod->ns, 0, NULL);
lyd_new_term(list, NULL, "location", "NETCONF", 0, NULL);

lyd_new_list(cont, NULL, "schema", 0, &list, submod->name, submod->revs ? submod->revs[0].date : "", "yin");
lyd_new_term(list, NULL, "namespace", mod->ns, 0, NULL);
lyd_new_term(list, NULL, "location", "NETCONF", 0, NULL);
}
}

/* sessions */
Expand Down

0 comments on commit 0f8a719

Please sign in to comment.