From: martijn Date: Mon, 6 Nov 2023 10:58:13 +0000 (+0000) Subject: Allow appl_internal_object's getnext to be called. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=5818b8e394409f5628f9ef8e7fd6c3cec49a3aec;p=openbsd Allow appl_internal_object's getnext to be called. OK tb@ --- diff --git a/usr.sbin/snmpd/application_internal.c b/usr.sbin/snmpd/application_internal.c index 00380091e59..8a0562c026e 100644 --- a/usr.sbin/snmpd/application_internal.c +++ b/usr.sbin/snmpd/application_internal.c @@ -1,4 +1,4 @@ -/* $OpenBSD: application_internal.c,v 1.4 2023/11/04 09:38:47 martijn Exp $ */ +/* $OpenBSD: application_internal.c,v 1.5 2023/11/06 10:58:13 martijn Exp $ */ /* * Copyright (c) 2023 Martijn van Duren @@ -311,7 +311,19 @@ appl_internal_getnext(struct appl_backend *backend, break; } /* non-scalar */ - fatalx("%s: not implemented", backend->ab_name); + if (ober_oid_cmp(&object->oid, &resp[i].av_oid) > 0) { + include = 1; + resp[i].av_oid = object->oid; + } + + resp[i].av_value = + object->getnext(include, &resp[i].av_oid); + if (resp[i].av_value == NULL || + resp[i].av_value->be_class != BER_CLASS_CONTEXT) + break; + /* endOfMibView */ + ober_free_elements(resp[i].av_value); + resp[i].av_value = NULL; } if (ober_oid_cmp(&resp[i].av_oid, &vb->av_oid_end) >= 0 || object == NULL) {