From e8048fa4347932a9da4f18db524045eec99555dd Mon Sep 17 00:00:00 2001 From: Jan-Olof Carlson Date: Tue, 20 Dec 2022 10:14:09 +0000 Subject: [PATCH] Conditional compilation to support report-all default retrieval --- apps/backend/backend_get.c | 9 ++++++++- lib/clixon/clixon_netconf_lib.h | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/backend/backend_get.c b/apps/backend/backend_get.c index 5b4e489f..4efbf7f3 100644 --- a/apps/backend/backend_get.c +++ b/apps/backend/backend_get.c @@ -815,8 +815,15 @@ get_common(clicon_handle h, cxobj *xfind; uint32_t offset = 0; uint32_t limit = 0; - withdefaults_type wdef = WITHDEFAULTS_EXPLICIT; + withdefaults_type wdef; char *wdefstr; + +#ifdef NETCONF_DEFAULT_RETRIEVAL_REPORT_ALL + /* Clixon 6.0 backward compatibly for NETCONF get/get-config behavior */ + wdef = WITHDEFAULTS_REPORT_ALL; +#else + wdef = WITHDEFAULTS_EXPLICIT; +#endif clicon_debug(1, "%s", __FUNCTION__); username = clicon_username_get(h); diff --git a/lib/clixon/clixon_netconf_lib.h b/lib/clixon/clixon_netconf_lib.h index 20c4e38a..f5d2fd32 100644 --- a/lib/clixon/clixon_netconf_lib.h +++ b/lib/clixon/clixon_netconf_lib.h @@ -133,9 +133,9 @@ typedef enum framing_type netconf_framing_type; * @see RFC 6243 */ enum withdefaults_type{ - WITHDEFAULTS_REPORT_ALL = 0, /* default */ + WITHDEFAULTS_REPORT_ALL = 0, /* default behavior: <= Clixon 6.0 */ WITHDEFAULTS_TRIM, - WITHDEFAULTS_EXPLICIT, + WITHDEFAULTS_EXPLICIT, /* default behavior: > Clixon 6.0 */ WITHDEFAULTS_REPORT_ALL_TAGGED }; typedef enum withdefaults_type withdefaults_type;