-/* $OpenBSD: snmpe.c,v 1.80 2022/01/19 10:28:13 martijn Exp $ */
+/* $OpenBSD: snmpe.c,v 1.81 2022/01/19 10:36:35 martijn Exp $ */
/*
* Copyright (c) 2007, 2008, 2012 Reyk Floeter <reyk@openbsd.org>
snmpe_response(msg);
}
+void
+snmpe_send(struct snmp_message *msg, enum snmp_pdutype type, int32_t requestid,
+ int32_t error, uint32_t index, struct ber_element *varbindlist)
+{
+ msg->sm_request = requestid;
+ msg->sm_pdutype = type;
+ msg->sm_error = error;
+ msg->sm_errorindex = index;
+ msg->sm_varbindresp = varbindlist;
+
+ msg->sm_pdutype = SNMP_C_RESPONSE;
+ snmpe_response(msg);
+}
+
void
snmpe_response(struct snmp_message *msg)
{
-/* $OpenBSD: snmpe.h,v 1.1 2022/01/19 10:22:48 martijn Exp $ */
+/* $OpenBSD: snmpe.h,v 1.2 2022/01/19 10:36:35 martijn Exp $ */
/*
* Copyright (c) 2021 Martijn van Duren <martijn@openbsd.org>
struct snmp_message;
+void snmpe_send(struct snmp_message *, enum snmp_pdutype, int32_t,
+ int32_t, uint32_t, struct ber_element *);
const char *snmpe_pdutype2string(enum snmp_pdutype);
void snmp_msgfree(struct snmp_message *);