diff options
Diffstat (limited to 'usr.sbin/smtpd/lka.c')
-rw-r--r-- | usr.sbin/smtpd/lka.c | 115 |
1 files changed, 105 insertions, 10 deletions
diff --git a/usr.sbin/smtpd/lka.c b/usr.sbin/smtpd/lka.c index 6d6124884a7..be9182b635f 100644 --- a/usr.sbin/smtpd/lka.c +++ b/usr.sbin/smtpd/lka.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lka.c,v 1.214 2018/11/08 13:21:00 gilles Exp $ */ +/* $OpenBSD: lka.c,v 1.215 2018/11/30 15:33:40 gilles Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -419,7 +419,7 @@ lka_imsg(struct mproc *p, struct imsg *imsg) m_get_sockaddr(&m, (struct sockaddr *)&ss_dest); m_end(&m); - lka_report_smtp_link_connect(tm, reqid, rdns, &ss_src, &ss_dest); + lka_report_smtp_link_connect("smtp-in", tm, reqid, rdns, &ss_src, &ss_dest); return; case IMSG_SMTP_REPORT_LINK_DISCONNECT: @@ -428,7 +428,7 @@ lka_imsg(struct mproc *p, struct imsg *imsg) m_get_id(&m, &reqid); m_end(&m); - lka_report_smtp_link_disconnect(tm, reqid); + lka_report_smtp_link_disconnect("smtp-in", tm, reqid); return; case IMSG_SMTP_REPORT_LINK_TLS: @@ -438,7 +438,7 @@ lka_imsg(struct mproc *p, struct imsg *imsg) m_get_string(&m, &ciphers); m_end(&m); - lka_report_smtp_link_tls(tm, reqid, ciphers); + lka_report_smtp_link_tls("smtp-in", tm, reqid, ciphers); return; case IMSG_SMTP_REPORT_TX_BEGIN: @@ -448,7 +448,7 @@ lka_imsg(struct mproc *p, struct imsg *imsg) m_get_u32(&m, &msgid); m_end(&m); - lka_report_smtp_tx_begin(tm, reqid, msgid); + lka_report_smtp_tx_begin("smtp-in", tm, reqid, msgid); return; case IMSG_SMTP_REPORT_TX_ENVELOPE: @@ -459,7 +459,7 @@ lka_imsg(struct mproc *p, struct imsg *imsg) m_get_id(&m, &evpid); m_end(&m); - lka_report_smtp_tx_envelope(tm, reqid, msgid, evpid); + lka_report_smtp_tx_envelope("smtp-in", tm, reqid, msgid, evpid); return; case IMSG_SMTP_REPORT_TX_COMMIT: @@ -470,16 +470,17 @@ lka_imsg(struct mproc *p, struct imsg *imsg) m_get_size(&m, &msgsz); m_end(&m); - lka_report_smtp_tx_commit(tm, reqid, msgid, msgsz); + lka_report_smtp_tx_commit("smtp-in", tm, reqid, msgid, msgsz); return; case IMSG_SMTP_REPORT_TX_ROLLBACK: m_msg(&m, imsg); m_get_time(&m, &tm); m_get_id(&m, &reqid); + m_get_u32(&m, &msgid); m_end(&m); - lka_report_smtp_tx_rollback(tm, reqid); + lka_report_smtp_tx_rollback("smtp-in", tm, reqid, msgid); return; case IMSG_SMTP_REPORT_PROTOCOL_CLIENT: @@ -489,7 +490,7 @@ lka_imsg(struct mproc *p, struct imsg *imsg) m_get_string(&m, &command); m_end(&m); - lka_report_smtp_protocol_client(tm, reqid, command); + lka_report_smtp_protocol_client("smtp-in", tm, reqid, command); return; case IMSG_SMTP_REPORT_PROTOCOL_SERVER: @@ -499,9 +500,103 @@ lka_imsg(struct mproc *p, struct imsg *imsg) m_get_string(&m, &response); m_end(&m); - lka_report_smtp_protocol_server(tm, reqid, response); + lka_report_smtp_protocol_server("smtp-in", tm, reqid, response); + return; + + case IMSG_MTA_REPORT_LINK_CONNECT: + m_msg(&m, imsg); + m_get_time(&m, &tm); + m_get_id(&m, &reqid); + m_get_string(&m, &rdns); + m_get_sockaddr(&m, (struct sockaddr *)&ss_src); + m_get_sockaddr(&m, (struct sockaddr *)&ss_dest); + m_end(&m); + + lka_report_smtp_link_connect("smtp-out", tm, reqid, rdns, &ss_src, &ss_dest); + return; + + case IMSG_MTA_REPORT_LINK_DISCONNECT: + m_msg(&m, imsg); + m_get_time(&m, &tm); + m_get_id(&m, &reqid); + m_end(&m); + + lka_report_smtp_link_disconnect("smtp-out", tm, reqid); return; + case IMSG_MTA_REPORT_LINK_TLS: + m_msg(&m, imsg); + m_get_time(&m, &tm); + m_get_id(&m, &reqid); + m_get_string(&m, &ciphers); + m_end(&m); + + lka_report_smtp_link_tls("smtp-out", tm, reqid, ciphers); + return; + + case IMSG_MTA_REPORT_TX_BEGIN: + m_msg(&m, imsg); + m_get_time(&m, &tm); + m_get_id(&m, &reqid); + m_get_u32(&m, &msgid); + m_end(&m); + + lka_report_smtp_tx_begin("smtp-out", tm, reqid, msgid); + return; + + case IMSG_MTA_REPORT_TX_ENVELOPE: + m_msg(&m, imsg); + m_get_time(&m, &tm); + m_get_id(&m, &reqid); + m_get_u32(&m, &msgid); + m_get_id(&m, &evpid); + m_end(&m); + + lka_report_smtp_tx_envelope("smtp-out", tm, reqid, msgid, evpid); + return; + + case IMSG_MTA_REPORT_TX_COMMIT: + m_msg(&m, imsg); + m_get_time(&m, &tm); + m_get_id(&m, &reqid); + m_get_u32(&m, &msgid); + m_get_size(&m, &msgsz); + m_end(&m); + + lka_report_smtp_tx_commit("smtp-out", tm, reqid, msgid, msgsz); + return; + + case IMSG_MTA_REPORT_TX_ROLLBACK: + m_msg(&m, imsg); + m_get_time(&m, &tm); + m_get_id(&m, &reqid); + m_get_u32(&m, &msgid); + m_end(&m); + + lka_report_smtp_tx_rollback("smtp-out", tm, reqid, msgid); + return; + + case IMSG_MTA_REPORT_PROTOCOL_CLIENT: + m_msg(&m, imsg); + m_get_time(&m, &tm); + m_get_id(&m, &reqid); + m_get_string(&m, &command); + m_end(&m); + + lka_report_smtp_protocol_client("smtp-out", tm, reqid, command); + return; + + case IMSG_MTA_REPORT_PROTOCOL_SERVER: + m_msg(&m, imsg); + m_get_time(&m, &tm); + m_get_id(&m, &reqid); + m_get_string(&m, &response); + m_end(&m); + + lka_report_smtp_protocol_server("smtp-out", tm, reqid, response); + return; + + case IMSG_SMTP_FILTER: m_msg(&m, imsg); m_get_id(&m, &reqid); |