diff --git a/CHANGELOG.md b/CHANGELOG.md index edb1d0b0..e51347cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,12 +45,14 @@ Expected: July 2023 ### Minor features +* [Support yang type union with are same subtypes with SNMP](https://github.com/clicon/clixon/pull/427) * Removed obsolete compile options introduced in 6.1: * `NETCONF_DEFAULT_RETRIEVAL_REPORT_ALL` * `AUTOCLI_DEPRECATED_HIDE` ### Corrected Bugs +* Fixed: [if-feature always negative if imported from another module](https://github.com/clicon/clixon/issues/429) * Fixed autocli edit modes for schema mounts ## 6.2.0 diff --git a/apps/snmp/snmp_lib.c b/apps/snmp/snmp_lib.c index c95777fa..ec566607 100644 --- a/apps/snmp/snmp_lib.c +++ b/apps/snmp/snmp_lib.c @@ -162,18 +162,19 @@ static const map_str2str yang_snmp_types[] = { * @retval 1 - true(All subtypes are the same) * @retval 0 - false */ -int is_same_subtypes_union(yang_stmt *ytype, cbuf *cb) +int +is_same_subtypes_union(yang_stmt *ytype, + cbuf *cb) { int retval = 0; yang_stmt *y_sub_type = NULL; yang_stmt *y_resolved_type = NULL; /* resolved type */ char *resolved_type_str; /* resolved type */ char *type_str = NULL; - - int options = 0; - cvec *cvv = NULL; - cvec *patterns = NULL; - uint8_t fraction_digits = 0; + int options = 0; + cvec *cvv = NULL; + cvec *patterns = NULL; + uint8_t fraction_digits = 0; /* Loop over all sub-types in the resolved union type, note these are * not resolved types (unless they are built-in, but the resolve call is @@ -200,7 +201,10 @@ int is_same_subtypes_union(yang_stmt *ytype, cbuf *cb) } return retval; } -char* yang_type_to_snmp(yang_stmt *ytype, char* yang_type_str) + +char* +yang_type_to_snmp(yang_stmt *ytype, + char* yang_type_str) { char* type_str = yang_type_str; if (yang_type_str && strcmp(yang_type_str, "union") == 0){ diff --git a/lib/clixon/clixon_xml.h b/lib/clixon/clixon_xml.h index d9892600..311757dc 100644 --- a/lib/clixon/clixon_xml.h +++ b/lib/clixon/clixon_xml.h @@ -83,6 +83,7 @@ /* Name of xml top object created by xml parse functions * This is a "neutral" symbol without any meaning as opposed to the previous symbols ^ + * @see DATASTORE_TOP_SYMBOL which should be used for clixon top-level config trees */ #define XML_TOP_SYMBOL "top" diff --git a/test/test_snmp_union.sh b/test/test_snmp_union.sh old mode 100644 new mode 100755