From 547aeee7e2ea193546d184d9b7d3426542b71a0f Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Fri, 7 Mar 2008 21:35:59 +0000 Subject: Update docs, and clarify usage of counter --- doc/REGEX-MIB.txt | 8 ++++++++ doc/bsnmp-regex.8 | 6 ++++-- module/bsnmp-regex.c | 3 ++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/doc/REGEX-MIB.txt b/doc/REGEX-MIB.txt index 3357f56..06cd2f0 100644 --- a/doc/REGEX-MIB.txt +++ b/doc/REGEX-MIB.txt @@ -105,4 +105,12 @@ regexString OBJECT-TYPE DESCRIPTION "String value of this regexEntry object." ::= { regexEntry 5 } +regexCounter OBJECT-TYPE + SYNTAX Counter64 + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Counter value for this regexEntry object." + ::= { regexEntry 6 } + END + diff --git a/doc/bsnmp-regex.8 b/doc/bsnmp-regex.8 index 0d2253e..ef44842 100644 --- a/doc/bsnmp-regex.8 +++ b/doc/bsnmp-regex.8 @@ -82,9 +82,11 @@ The description of the counter. .It Ar regex.regexEntry.regexLast.X How long ago the counter was last updated. .It Ar regex.regexEntry.regexInteger.X -The current counter value as a integer. +The current value or counter as a integer. .It Ar regex.regexEntry.regexString.X -The current counter value as a string. +The current value as a string. +.It Ar regex.regexEntry.regexCounter.X +The current counter value as a 64 bit integer. .El .Sh OPTIONS To activate the diff --git a/module/bsnmp-regex.c b/module/bsnmp-regex.c index 19febca..5a77d6e 100644 --- a/module/bsnmp-regex.c +++ b/module/bsnmp-regex.c @@ -1099,7 +1099,8 @@ op_regexentry (struct snmp_context *ctx, struct snmp_value *value, data->value_str : "", -1)); case LEAF_regexCounter: - value->v.counter64 = expired ? 0 : data->value_int; + value->v.counter64 = (expired && data->type != TYPE_COUNTER) ? + 0 : data->value_int; break; default: -- cgit v1.2.3