NETCONF hello error handling, changed YANG PATCH enabling, refactored static linking
NETCONF hello errors, such as wrong session-id, prefix, namespace terminates session * Instead of returning an rpc-error reply Changed YANG PATCH enabling: * Now: `./configure --enable-yang-patch` * Before: set YANG_PATCH constant in `include/clixon_custom.h` Refactored Makefile for static linking
This commit is contained in:
parent
8f55b8490d
commit
26d37352f4
14 changed files with 166 additions and 98 deletions
|
|
@ -421,11 +421,11 @@ main(int argc,
|
|||
if (yang_spec_parse_module(h, "ietf-restconf", NULL, yspec)< 0)
|
||||
goto done;
|
||||
|
||||
#ifdef YANG_PATCH
|
||||
#ifdef CLIXON_YANG_PATCH
|
||||
/* Load yang restconf patch module */
|
||||
if (yang_spec_parse_module(h, "ietf-yang-patch", NULL, yspec)< 0)
|
||||
goto done;
|
||||
#endif // YANG_PATCH
|
||||
#endif
|
||||
|
||||
/* Add netconf yang spec, used as internal protocol */
|
||||
if (netconf_module_load(h) < 0)
|
||||
|
|
|
|||
|
|
@ -1770,11 +1770,11 @@ restconf_clixon_init(clicon_handle h,
|
|||
if (yang_spec_parse_module(h, "ietf-restconf", NULL, yspec)< 0)
|
||||
goto done;
|
||||
|
||||
#ifdef YANG_PATCH
|
||||
#ifdef CLIXON_YANG_PATCH
|
||||
/* Load yang restconf patch module */
|
||||
if (yang_spec_parse_module(h, "ietf-yang-patch", NULL, yspec)< 0)
|
||||
goto done;
|
||||
#endif // YANG_PATCH
|
||||
#endif
|
||||
|
||||
/* Add netconf yang spec, used as internal protocol */
|
||||
if (netconf_module_load(h) < 0)
|
||||
|
|
|
|||
|
|
@ -677,7 +677,7 @@ api_data_patch(clicon_handle h,
|
|||
break;
|
||||
case YANG_PATCH_JSON: /* RFC 8072 patch */
|
||||
case YANG_PATCH_XML:
|
||||
#ifdef YANG_PATCH
|
||||
#ifdef CLIXON_YANG_PATCH
|
||||
ret = api_data_yang_patch(h, req, api_path0, pcvec, pi, qvec, data, pretty,
|
||||
media_in, media_out, ds);
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@
|
|||
#include "restconf_methods_post.h"
|
||||
#include "restconf_methods_patch.h"
|
||||
|
||||
#ifdef YANG_PATCH
|
||||
#ifdef CLIXON_YANG_PATCH
|
||||
|
||||
enum yang_patch_op{
|
||||
YANG_PATCH_OP_CREATE,
|
||||
|
|
@ -124,7 +124,7 @@ yang_patch_xml2json_modified_cbuf(cxobj *x_simple_patch)
|
|||
// Insert a '[' after the first '{' to get the JSON to match what api_data_post/write() expect
|
||||
json_simple_patch_tmp = cbuf_get(cb);
|
||||
len = strlen(json_simple_patch_tmp);
|
||||
for (int l = 0; l < strlen(len); l++) {
|
||||
for (int l = 0; l < len; l++) {
|
||||
char c = json_simple_patch_tmp[l];
|
||||
if (c == '{') {
|
||||
brace_count++;
|
||||
|
|
@ -848,7 +848,7 @@ api_data_yang_patch(clicon_handle h,
|
|||
return retval;
|
||||
}
|
||||
|
||||
#else // YANG_PATCH
|
||||
#else // CLIXON_YANG_PATCH
|
||||
|
||||
int
|
||||
api_data_yang_patch(clicon_handle h,
|
||||
|
|
@ -866,4 +866,4 @@ api_data_yang_patch(clicon_handle h,
|
|||
clicon_err(OE_RESTCONF, 0, "Not implemented");
|
||||
return -1;
|
||||
}
|
||||
#endif // YANG_PATCH
|
||||
#endif // CLIXON_YANG_PATCH
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue