Fixed: [clixon_netconf does not respond to hello #136](https://github.com/clicon/clixon/issues/136)
* The error showed only when CLICON_MODULE_LIBRARY_RFC7895 was disabled.
This commit is contained in:
parent
1ef3c0db7a
commit
5b5dce7e39
5 changed files with 29 additions and 13 deletions
|
|
@ -1500,7 +1500,7 @@ netconf_content_int2str(netconf_content nr)
|
|||
*
|
||||
* RFC6022 YANG Module for NETCONF Monitoring
|
||||
* MUST advertise the capability URI "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"
|
||||
* RFC7895 Yang module library defines how to announce module features (not hell capabilities)
|
||||
* RFC7895 Yang module library defines how to announce module features (not hello capabilities)
|
||||
* RFC7950 YANG 1.1 says (5.6.4);
|
||||
* MUST announce the modules it implements by implementing the YANG module
|
||||
* "ietf-yang-library" (RFC7895) and listing all implemented modules in the
|
||||
|
|
@ -1535,16 +1535,18 @@ netconf_hello_server(clicon_handle h,
|
|||
char *encstr = NULL;
|
||||
|
||||
module_set_id = clicon_option_str(h, "CLICON_MODULE_SET_ID");
|
||||
if ((ietf_yang_library_revision = yang_modules_revision(h)) == NULL)
|
||||
goto done;
|
||||
|
||||
cprintf(cb, "<hello xmlns=\"%s\">", NETCONF_BASE_NAMESPACE);
|
||||
cprintf(cb, "<capabilities>");
|
||||
cprintf(cb, "<capability>urn:ietf:params:netconf:base:1.0</capability>");
|
||||
if (xml_chardata_encode(&encstr, "urn:ietf:params:netconf:capability:yang-library:1.0?revision=%s&module-set-id=%s",
|
||||
ietf_yang_library_revision,
|
||||
module_set_id) < 0)
|
||||
goto done;
|
||||
cprintf(cb, "<capability>%s</capability>", encstr);
|
||||
cprintf(cb, "<capability>urn:ietf:params:netconf:base:1.0</capability>");
|
||||
/* Check if RFC7895 loaded and revision found */
|
||||
if ((ietf_yang_library_revision = yang_modules_revision(h)) != NULL){
|
||||
if (xml_chardata_encode(&encstr, "urn:ietf:params:netconf:capability:yang-library:1.0?revision=%s&module-set-id=%s",
|
||||
ietf_yang_library_revision,
|
||||
module_set_id) < 0)
|
||||
goto done;
|
||||
cprintf(cb, "<capability>%s</capability>", encstr);
|
||||
}
|
||||
cprintf(cb, "<capability>urn:ietf:params:netconf:capability:candidate:1.0</capability>");
|
||||
cprintf(cb, "<capability>urn:ietf:params:netconf:capability:validate:1.1</capability>");
|
||||
cprintf(cb, "<capability>urn:ietf:params:netconf:capability:startup:1.0</capability>");
|
||||
|
|
|
|||
|
|
@ -1061,11 +1061,14 @@ clicon_rpc_debug(clicon_handle h,
|
|||
return retval;
|
||||
}
|
||||
|
||||
/*! Send a debug request to backend server
|
||||
/*! Send a hello request to the backend server
|
||||
* @param[in] h CLICON handle
|
||||
* @param[in] level Debug level
|
||||
* @retval 0 OK
|
||||
* @retval -1 Error and logged to syslog
|
||||
* @note this is internal netconf to backend, not northbound to user client
|
||||
* @note this deviates from RFC6241 slightly in that it waits for a reply, the RFC does not
|
||||
* stipulate that.
|
||||
*/
|
||||
int
|
||||
clicon_hello_req(clicon_handle h,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue