summaryrefslogtreecommitdiff
path: root/usr.sbin/snmpd/smi.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2007-12-29 09:24:44 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2007-12-29 09:24:44 +0000
commit4d548bbc88c744342a51ae80498dfa9640546c2d (patch)
tree3c0f6be54aabb6a0c45fb71a1377b809c72a1304 /usr.sbin/snmpd/smi.c
parent497914f08894369ccc1d40e8aeeee5a07b05aa6e (diff)
add the IP-MIB ipAddrTable. it requires to encode the ipv4 addresses
in the OIDs as the table index. the next step is to simplify the common mib implementation regarding the special requirements of these strange snmp tables.
Diffstat (limited to 'usr.sbin/snmpd/smi.c')
-rw-r--r--usr.sbin/snmpd/smi.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/snmpd/smi.c b/usr.sbin/snmpd/smi.c
index 83f8414a46b..da20de7d414 100644
--- a/usr.sbin/snmpd/smi.c
+++ b/usr.sbin/snmpd/smi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smi.c,v 1.1 2007/12/28 16:59:31 reyk Exp $ */
+/* $OpenBSD: smi.c,v 1.2 2007/12/29 09:24:43 reyk Exp $ */
/*
* Copyright (c) 2007 Reyk Floeter <reyk@vantronix.net>
@@ -86,7 +86,7 @@ smi_oidstring(struct ber_oid *o, char *buf, size_t len)
bzero(buf, len);
bcopy(o, &key.o_id, sizeof(struct ber_oid));
- key.o_flags |= OID_TABLE; /* do not match wildcards */
+ key.o_flags |= OID_KEY; /* do not match wildcards */
if (env->sc_flags & SNMPD_F_NONAMES)
lookup = 0;
@@ -161,6 +161,7 @@ smi_mibtree(struct oid *oids)
decl->o_flags = oid->o_flags;
decl->o_get = oid->o_get;
decl->o_set = oid->o_set;
+ decl->o_table = oid->o_table;
decl->o_val = oid->o_val;
decl->o_data = oid->o_data;
}
@@ -225,7 +226,7 @@ smi_oid_cmp(struct oid *a, struct oid *b)
* (it will match any sub-elements)
*/
if ((b->o_flags & OID_TABLE) &&
- (a->o_flags & OID_TABLE) == 0)
+ (a->o_flags & OID_KEY) == 0)
return (0);
return (a->o_oidlen - b->o_oidlen);