Created
July 13, 2015 14:35
-
-
Save FransUrbo/a2bfee606ffda0b7b81e to your computer and use it in GitHub Desktop.
net-snmp "integer64" + "unsigned64" pass_persist support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: net-snmp-5.7.3+dfsg/agent/mibgroup/ucd-snmp/pass_common.c | |
=================================================================== | |
--- net-snmp-5.7.3+dfsg.orig/agent/mibgroup/ucd-snmp/pass_common.c 2015-07-11 02:16:03.188013357 +0200 | |
+++ net-snmp-5.7.3+dfsg/agent/mibgroup/ucd-snmp/pass_common.c 2015-07-13 15:55:36.757053369 +0200 | |
@@ -135,7 +135,16 @@ | |
c64.high = (unsigned long)(v64 >> 32); | |
c64.low = (unsigned long)(v64 & 0xffffffff); | |
*var_len = sizeof(c64); | |
- vp->type = ASN_INTEGER64; | |
+ vp->type = ASN_OPAQUE_I64; | |
+ return ((signed char *) &c64); | |
+ } | |
+ else if (!strncasecmp(buf, "unsigned64", 9)) { | |
+ static struct counter64 c64; | |
+ uint64_t v64 = strtoull(buf2, NULL, 10); | |
+ c64.high = (unsigned long)(v64 >> 32); | |
+ c64.low = (unsigned long)(v64 & 0xffffffff); | |
+ *var_len = sizeof(c64); | |
+ vp->type = ASN_OPAQUE_U64; | |
return ((unsigned char *) &c64); | |
} | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment