-/* $OpenBSD: agentx.c,v 1.22 2022/12/27 17:10:05 jmc Exp $ */
+/* $OpenBSD: agentx.c,v 1.23 2023/10/24 08:54:52 martijn Exp $ */
/*
* Copyright (c) 2019 Martijn van Duren <martijn@openbsd.org>
*
free(logmsg);
if (ax_response(ax->ax_ax, axs->axs_id, axg->axg_transactionid,
- axg->axg_packetid, AGENTX_CONTEXT_CTX(axc), 0, error, index,
- vbl, nvarbind) == -1) {
+ axg->axg_packetid, 0, error, index, vbl, nvarbind) == -1) {
agentx_log_axg_warn(axg, "Couldn't parse request");
agentx_reset(ax);
} else
if (ax_response(ax->ax_ax, axs->axs_id,
pdu->ap_header.aph_transactionid,
pdu->ap_header.aph_packetid,
- axc == NULL ? NULL : AGENTX_CONTEXT_CTX(axc),
0, error, 1, NULL, 0) == -1)
agentx_log_axc_warn(axc,
"transaction: %u packetid: %u: failed to send "
-/* $OpenBSD: application_agentx.c,v 1.4 2022/09/01 14:34:17 martijn Exp $ */
+/* $OpenBSD: application_agentx.c,v 1.5 2023/10/24 08:54:52 martijn Exp $ */
/*
* Copyright (c) 2022 Martijn van Duren <martijn@openbsd.org>
*
pdu->ap_header.aph_sessionid);
ax_response(conn->conn_ax, pdu->ap_header.aph_sessionid,
pdu->ap_header.aph_transactionid,
- pdu->ap_header.aph_packetid,
- &(pdu->ap_context), smi_getticks(),
+ pdu->ap_header.aph_packetid, smi_getticks(),
APPL_ERROR_NOTOPEN, 0, NULL, 0);
appl_agentx_send(-1, EV_WRITE, conn);
goto fail;
case AX_PDU_TYPE_PING:
ax_response(conn->conn_ax, pdu->ap_header.aph_sessionid,
pdu->ap_header.aph_transactionid,
- pdu->ap_header.aph_packetid, &(pdu->ap_context),
- smi_getticks(), APPL_ERROR_NOERROR, 0, NULL, 0);
+ pdu->ap_header.aph_packetid, smi_getticks(),
+ APPL_ERROR_NOERROR, 0, NULL, 0);
appl_agentx_send(-1, EV_WRITE, conn);
break;
case AX_PDU_TYPE_INDEXALLOCATE:
ax_pdutype2string(pdu->ap_header.aph_type));
ax_response(conn->conn_ax, pdu->ap_header.aph_sessionid,
pdu->ap_header.aph_transactionid,
- pdu->ap_header.aph_packetid, &(pdu->ap_context),
- smi_getticks(), APPL_ERROR_PROCESSINGERROR, 1,
+ pdu->ap_header.aph_packetid, smi_getticks(),
+ APPL_ERROR_PROCESSINGERROR, 1,
pdu->ap_payload.ap_vbl.ap_varbind,
pdu->ap_payload.ap_vbl.ap_nvarbind);
appl_agentx_send(-1, EV_WRITE, conn);
ax_pdutype2string(pdu->ap_header.aph_type));
ax_response(conn->conn_ax, pdu->ap_header.aph_sessionid,
pdu->ap_header.aph_transactionid,
- pdu->ap_header.aph_packetid, &(pdu->ap_context),
- smi_getticks(), APPL_ERROR_PROCESSINGERROR, 1,
+ pdu->ap_header.aph_packetid, smi_getticks(),
+ APPL_ERROR_PROCESSINGERROR, 1,
NULL, 0);
appl_agentx_send(-1, EV_WRITE, conn);
break;
log_info("%s: %s %s: Open", session->sess_backend.ab_name, oidbuf,
session->sess_descr.aos_string);
- ax_response(conn->conn_ax, session->sess_id, pdu->ap_header.aph_transactionid,
- pdu->ap_header.aph_packetid, NULL, smi_getticks(), APPL_ERROR_NOERROR, 0,
- NULL, 0);
+ ax_response(conn->conn_ax, session->sess_id,
+ pdu->ap_header.aph_transactionid, pdu->ap_header.aph_packetid,
+ smi_getticks(), APPL_ERROR_NOERROR, 0, NULL, 0);
appl_agentx_send(-1, EV_WRITE, conn);
return;
fail:
ax_response(conn->conn_ax, 0, pdu->ap_header.aph_transactionid,
- pdu->ap_header.aph_packetid, NULL, 0, APPL_ERROR_OPENFAILED, 0,
- NULL, 0);
+ pdu->ap_header.aph_packetid, 0, APPL_ERROR_OPENFAILED, 0, NULL, 0);
appl_agentx_send(-1, EV_WRITE, conn);
if (session != NULL)
free(session->sess_descr.aos_string);
ax_response(conn->conn_ax, pdu->ap_header.aph_sessionid,
pdu->ap_header.aph_transactionid, pdu->ap_header.aph_packetid,
- &(pdu->ap_context), smi_getticks(), APPL_ERROR_NOERROR, 0, NULL, 0);
+ smi_getticks(), APPL_ERROR_NOERROR, 0, NULL, 0);
appl_agentx_send(-1, EV_WRITE, conn);
}
fail:
ax_response(session->sess_conn->conn_ax, session->sess_id,
pdu->ap_header.aph_transactionid, pdu->ap_header.aph_packetid,
- &(pdu->ap_context), smi_getticks(), error, 0, NULL, 0);
+ smi_getticks(), error, 0, NULL, 0);
appl_agentx_send(-1, EV_WRITE, session->sess_conn);
}
fail:
ax_response(session->sess_conn->conn_ax, session->sess_id,
pdu->ap_header.aph_transactionid, pdu->ap_header.aph_packetid,
- &(pdu->ap_context), smi_getticks(), error, 0, NULL, 0);
+ smi_getticks(), error, 0, NULL, 0);
appl_agentx_send(-1, EV_WRITE, session->sess_conn);
}