Fixed: [snmpwalk doesn't show properly SNMP boolean values which equal false](https://github.com/clicon/clixon/issues/400)
This commit is contained in:
parent
0324135043
commit
3428f4d5ff
4 changed files with 10 additions and 8 deletions
|
|
@ -89,6 +89,7 @@ Developers may need to change their code
|
|||
|
||||
### Corrected Bugs
|
||||
|
||||
* Fixed: [snmpwalk doesn't show properly SNMP boolean values which equal false](https://github.com/clicon/clixon/issues/400)
|
||||
* Fixed: yang-library: Remove revision if empty instead of sending empty revision
|
||||
* This was a change from RFC 7895 to RFC 8525
|
||||
* Fixed: [locally scoped YANG typedef in grouping does not work #394](https://github.com/clicon/clixon/issues/394)
|
||||
|
|
|
|||
|
|
@ -651,11 +651,11 @@ type_xml2snmp_pre(char *xmlstr0,
|
|||
/* special case for bool: although smidump translates TruthValue to boolean
|
||||
* and there is an ASN_BOOLEAN constant:
|
||||
* 1) there is no code for ASN_BOOLEAN and
|
||||
* 2) Truthvalue actually translates to enum true(1)/false(0)
|
||||
* 2) Truthvalue actually translates to enum true(1)/false(2)
|
||||
*/
|
||||
else if (strcmp(restype, "boolean") == 0){
|
||||
if (strcmp(xmlstr0, "false")==0)
|
||||
str = "0";
|
||||
str = "2";
|
||||
else
|
||||
str = "1";
|
||||
}
|
||||
|
|
@ -675,7 +675,7 @@ type_xml2snmp_pre(char *xmlstr0,
|
|||
goto done;
|
||||
}
|
||||
|
||||
/*! Given snmp string value (as translated frm XML) parse into snmp value
|
||||
/*! Given snmp string value (as translated from XML) parse into snmp value
|
||||
*
|
||||
* @param[in] snmpstr SNMP type string
|
||||
* @param[in,out] asn1type ASN.1 type id
|
||||
|
|
|
|||
|
|
@ -525,6 +525,7 @@ main(int argc,
|
|||
* used by the client, even though new TCP sessions are created for
|
||||
* each message sent to the backend.
|
||||
*/
|
||||
clicon_data_set(h, "session-transport", "cl:snmp");
|
||||
if (clicon_hello_req(h, "cl:snmp", NULL, &id) < 0)
|
||||
goto done;
|
||||
clicon_session_id_set(h, id);
|
||||
|
|
|
|||
|
|
@ -468,12 +468,12 @@ validate_oid $OID29 $OID29 "INTEGER" "1"
|
|||
validate_oid $NAME29 $NAME29 "INTEGER" "true(1)"
|
||||
|
||||
new "Get next fru, $OID29"
|
||||
validate_oid $OID29 $OID30 "INTEGER" "0"
|
||||
validate_oid $NAME29 $NAME30 "INTEGER" "0"
|
||||
validate_oid $OID29 $OID30 "INTEGER" "2"
|
||||
validate_oid $NAME29 $NAME30 "INTEGER" "false(2)"
|
||||
|
||||
new "Get fru 2, $OID30"
|
||||
validate_oid $OID30 $OID30 "INTEGER" "0"
|
||||
validate_oid $NAME30 $NAME30 "INTEGER" "0"
|
||||
validate_oid $OID30 $OID30 "INTEGER" "2"
|
||||
validate_oid $NAME30 $NAME30 "INTEGER" "false(2)"
|
||||
|
||||
new "Get next fru 2, $OID30"
|
||||
validate_oid $NAME30 $NAME31 "STRING" "12593-49-49,49:49:49.49"
|
||||
|
|
@ -519,7 +519,7 @@ expectpart "$($snmpwalk $ENTITY_OID)" 0 "SNMPv2-SMI::mib-2.47.1.1.1.1.1.1 = INTE
|
|||
"SNMPv2-SMI::mib-2.47.1.1.1.1.15.1 = STRING: \"Asset 123\"" \
|
||||
"SNMPv2-SMI::mib-2.47.1.1.1.1.15.2 = STRING: \"Asset 456\"" \
|
||||
"SNMPv2-SMI::mib-2.47.1.1.1.1.16.1 = INTEGER: 1" \
|
||||
"SNMPv2-SMI::mib-2.47.1.1.1.1.16.2 = INTEGER: 0" \
|
||||
"SNMPv2-SMI::mib-2.47.1.1.1.1.16.2 = INTEGER: 2" \
|
||||
|
||||
new "Cleaning up"
|
||||
testexit
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue