server session FEATURE function for server capabilities retrieval
diff --git a/src/session.c b/src/session.c
index b9a076a..92df1d2 100644
--- a/src/session.c
+++ b/src/session.c
@@ -457,8 +457,8 @@
++(*count);
}
-static const char **
-create_cpblts(struct ly_ctx *ctx)
+API const char **
+nc_server_get_cpblts(struct ly_ctx *ctx)
{
struct lyd_node *child, *child2, *yanglib;
struct lyd_node_leaf_list **features = NULL, *ns = NULL, *rev = NULL, *name = NULL;
@@ -467,8 +467,14 @@
int size = 10, count, feat_count = 0, i, str_len;
char str[512];
+ if (!ctx) {
+ ERRARG("ctx");
+ return NULL;
+ }
+
yanglib = ly_ctx_info(ctx);
if (!yanglib) {
+ ERR("Failed to get ietf-yang-library data from the context.");
return NULL;
}
@@ -713,7 +719,7 @@
int r, i;
const char **cpblts;
- cpblts = create_cpblts(session->ctx);
+ cpblts = nc_server_get_cpblts(session->ctx);
r = nc_write_msg(session, NC_MSG_HELLO, cpblts, &session->id);