From 657aafd3b1d1a4cc220fb338ff5430b573f9c1c5 Mon Sep 17 00:00:00 2001 From: Kristofer Hallin Date: Sun, 22 May 2022 21:09:03 +0200 Subject: [PATCH] Extended supported types with uint64. --- apps/snmp/snmp_lib.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/snmp/snmp_lib.c b/apps/snmp/snmp_lib.c index a9e7aac2..f13cf6de 100644 --- a/apps/snmp/snmp_lib.c +++ b/apps/snmp/snmp_lib.c @@ -100,6 +100,7 @@ static const map_str2int snmp_type_map[] = { {"int32", ASN_INTEGER}, {"string", ASN_OCTET_STR}, {"uint32", ASN_INTEGER}, + {"uint64", ASN_INTEGER}, // {"bool", ASN_BOOLEAN}, // {"empty", ASN_NULL}, // {"bits", ASN_BIT_STR}, @@ -239,6 +240,12 @@ type_yang2snmp(char *valstr, *snmplen = cvlen; break; } + case CGV_UINT64:{ + uint64_t i = cv_uint32_get(cv); + memcpy(*snmpval, &i, cvlen); + *snmplen = cvlen; + break; + } default: clicon_debug(1, "%s %s not supported", __FUNCTION__, cv_type2str(cvtype)); assert(0); // XXX