Fixed: [if-feature always negative if imported from another module](https://github.com/clicon/clixon/issues/429)

Apply styleguide to snmp patch
This commit is contained in:
Olof hagsand 2023-05-05 10:26:55 +02:00
parent fc967171f9
commit a0df12134a
4 changed files with 14 additions and 7 deletions

View file

@ -45,12 +45,14 @@ Expected: July 2023
### Minor features ### 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: * Removed obsolete compile options introduced in 6.1:
* `NETCONF_DEFAULT_RETRIEVAL_REPORT_ALL` * `NETCONF_DEFAULT_RETRIEVAL_REPORT_ALL`
* `AUTOCLI_DEPRECATED_HIDE` * `AUTOCLI_DEPRECATED_HIDE`
### Corrected Bugs ### 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 * Fixed autocli edit modes for schema mounts
## 6.2.0 ## 6.2.0

View file

@ -162,14 +162,15 @@ static const map_str2str yang_snmp_types[] = {
* @retval 1 - true(All subtypes are the same) * @retval 1 - true(All subtypes are the same)
* @retval 0 - false * @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; int retval = 0;
yang_stmt *y_sub_type = NULL; yang_stmt *y_sub_type = NULL;
yang_stmt *y_resolved_type = NULL; /* resolved type */ yang_stmt *y_resolved_type = NULL; /* resolved type */
char *resolved_type_str; /* resolved type */ char *resolved_type_str; /* resolved type */
char *type_str = NULL; char *type_str = NULL;
int options = 0; int options = 0;
cvec *cvv = NULL; cvec *cvv = NULL;
cvec *patterns = NULL; cvec *patterns = NULL;
@ -200,7 +201,10 @@ int is_same_subtypes_union(yang_stmt *ytype, cbuf *cb)
} }
return retval; 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; char* type_str = yang_type_str;
if (yang_type_str && strcmp(yang_type_str, "union") == 0){ if (yang_type_str && strcmp(yang_type_str, "union") == 0){

View file

@ -83,6 +83,7 @@
/* Name of xml top object created by xml parse functions /* Name of xml top object created by xml parse functions
* This is a "neutral" symbol without any meaning as opposed to the previous symbols ^ * 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" #define XML_TOP_SYMBOL "top"

0
test/test_snmp_union.sh Normal file → Executable file
View file