summaryrefslogtreecommitdiff
path: root/usr.sbin/snmpd/ber.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2008-01-03 14:44:09 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2008-01-03 14:44:09 +0000
commit47a48c6860d137865b7a32d44e5d3a6a1b01d6da (patch)
treeb2426adb6668bc99f8044c10779d4ad80c4a4aa5 /usr.sbin/snmpd/ber.c
parente6d686487fa845a5b90234d0e49fe0da5e1c53d3 (diff)
scalars have an index of 0 in the returned oid (like sysDescr.0).
Diffstat (limited to 'usr.sbin/snmpd/ber.c')
-rw-r--r--usr.sbin/snmpd/ber.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/usr.sbin/snmpd/ber.c b/usr.sbin/snmpd/ber.c
index ddc24f1f361..53a172aa83a 100644
--- a/usr.sbin/snmpd/ber.c
+++ b/usr.sbin/snmpd/ber.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ber.c,v 1.4 2007/12/07 10:08:40 reyk Exp $ */
+/* $OpenBSD: ber.c,v 1.5 2008/01/03 14:44:08 reyk Exp $ */
/*
* Copyright (c) 2007 Reyk Floeter <reyk@vantronix.net>
@@ -425,6 +425,19 @@ ber_add_oid(struct ber_element *prev, struct ber_oid *o)
}
struct ber_element *
+ber_add_noid(struct ber_element *prev, struct ber_oid *o, int n)
+{
+ struct ber_oid no;
+
+ if (n > BER_MAX_OID_LEN)
+ return (NULL);
+ no.bo_n = n;
+ bcopy(&o->bo_id, &no.bo_id, sizeof(no.bo_id));
+
+ return (ber_add_oid(prev, &no));
+}
+
+struct ber_element *
ber_add_oidstring(struct ber_element *prev, const char *oidstr)
{
struct ber_oid o;