session client CHANGE filtering server data for ietf-yang-library data
Reflect if the server implements :xpath capability. So far, the filter
was always set as XPath filter, but :xpath capability is optional, so we
must add subtree filter as backup (since it is, at least in our
implementation, less effective)
@@ -665,7 +665,11 @@ build_schema_info_yl(struct nc_session *session, struct schema_info **result)
int ret = EXIT_SUCCESS;
/* get yang-library data from the server */
+ if (nc_session_cpblt(session, "urn:ietf:params:netconf:capability:xpath:1.0")) {
rpc = nc_rpc_get("/ietf-yang-library:*", 0, NC_PARAMTYPE_CONST);
+ } else {
+ rpc = nc_rpc_get("<modules-state xmlns=\"urn:ietf:params:xml:ns:yang:ietf-yang-library\"/>", 0, NC_PARAMTYPE_CONST);
+ }
if (!rpc) {
goto cleanup;
}
