-/* $OpenBSD: application.c,v 1.34 2023/11/08 20:02:52 martijn Exp $ */
+/* $OpenBSD: application.c,v 1.35 2023/11/08 20:07:14 martijn Exp $ */
/*
* Copyright (c) 2021 Martijn van Duren <martijn@openbsd.org>
int appl_error_valid(enum appl_error, enum snmp_pdutype);
int appl_varbind_backend(struct appl_varbind_internal *);
void appl_varbind_error(struct appl_varbind_internal *, enum appl_error);
-void appl_report(struct snmp_message *, int32_t, struct ber_oid *);
void appl_pdu_log(struct appl_backend *, enum snmp_pdutype, int32_t, uint16_t,
uint16_t, struct appl_varbind *);
void ober_oid_nextsibling(struct ber_oid *);
-/* $OpenBSD: application.h,v 1.10 2023/11/08 19:46:28 martijn Exp $ */
+/* $OpenBSD: application.h,v 1.11 2023/11/08 20:07:14 martijn Exp $ */
/*
* Copyright (c) 2021 Martijn van Duren <martijn@openbsd.org>
enum snmp_version , struct ber_element *);
void appl_response(struct appl_backend *, int32_t, enum appl_error, int16_t,
struct appl_varbind *);
+void appl_report(struct snmp_message *, int32_t, struct ber_oid *);
struct ber_element *appl_exception(enum appl_exception);
/* application_legacy.c */
-/* $OpenBSD: snmpe.c,v 1.89 2023/11/08 19:50:24 martijn Exp $ */
+/* $OpenBSD: snmpe.c,v 1.90 2023/11/08 20:07:14 martijn Exp $ */
/*
* Copyright (c) 2007, 2008, 2012 Reyk Floeter <reyk@openbsd.org>
if (snmpe_parse(msg) == -1) {
if (msg->sm_usmerr && MSG_REPORT(msg)) {
usm_make_report(msg);
- snmpe_response(msg);
return;
} else
goto fail;
if (snmpe_parse(msg) == -1) {
if (msg->sm_usmerr != 0 && MSG_REPORT(msg)) {
usm_make_report(msg);
- snmpe_response(msg);
return;
} else {
snmp_msgfree(msg);
-/* $OpenBSD: usm.c,v 1.26 2023/05/08 12:25:23 gerhard Exp $ */
+/* $OpenBSD: usm.c,v 1.27 2023/11/08 20:07:14 martijn Exp $ */
/*
* Copyright (c) 2012 GeNUA mbH
#include <openssl/evp.h>
#include <openssl/hmac.h>
+#include "application.h"
#include "snmpd.h"
#include "mib.h"
void
usm_make_report(struct snmp_message *msg)
{
- struct ber_oid usmstat = OID(MIB_usmStats, 0, 0);
-
- msg->sm_pdutype = SNMP_C_REPORT;
- usmstat.bo_id[OIDIDX_usmStats] = msg->sm_usmerr;
- usmstat.bo_n = OIDIDX_usmStats + 2;
- if (msg->sm_varbindresp != NULL)
- ober_free_elements(msg->sm_varbindresp);
- msg->sm_varbindresp = ober_add_sequence(NULL);
- mps_getreq(NULL, msg->sm_varbindresp, &usmstat, msg->sm_version);
- return;
+ appl_report(msg, 0, &OID(MIB_usmStats, msg->sm_usmerr, 0));
}
int