summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2008-03-07 21:35:59 +0000
committerStef Walter <stef@memberwebs.com>2008-03-07 21:35:59 +0000
commit547aeee7e2ea193546d184d9b7d3426542b71a0f (patch)
tree7b14549828c418b34722aa7e0a28d63f72561c44
parentb33612c01ed05b9495e495d63c567da75f9a6d5a (diff)
Update docs, and clarify usage of counter
-rw-r--r--doc/REGEX-MIB.txt8
-rw-r--r--doc/bsnmp-regex.86
-rw-r--r--module/bsnmp-regex.c3
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: