All pastes #432798 Raw Edit

Stuff

public text v1 · immutable
·published 2007-04-10 13:21 UTC
rendered paste body
Index: agent/mibgroup/ucd-snmp/pass.c
===================================================================
--- agent/mibgroup/ucd-snmp/pass.c      (revision 1002)
+++ agent/mibgroup/ucd-snmp/pass.c      (working copy)
@@ -375,6 +375,14 @@
                     long_ret = strtoul(buf2, NULL, 10);
                     vp->type = ASN_UNSIGNED;
                     return ((unsigned char *) &long_ret);
+                } else if (!strncasecmp(buf, "counter64", 9)) {
+                   unsigned long long val;
+                   val = strtoull(buf2, NULL, 10);
+                   (*(U64 *)buf2).low = (val >> 0) & 0xffffffffLL;
+                   (*(U64 *)buf2).high = (val >> 32) & 0xffffffffLL;
+                   *var_len = sizeof(U64);
+                   vp->type = ASN_COUNTER64;
+                   return ((unsigned char *) buf2);
                 } else if (!strncasecmp(buf, "counter", 7)) {
                     *var_len = sizeof(long_ret);
                     long_ret = strtoul(buf2, NULL, 10);