From 6fe41087da1cadcd9214ab956b71f6bf0c307061 Mon Sep 17 00:00:00 2001 From: Gilles Chehade Date: Sun, 18 Aug 2019 16:52:03 +0000 Subject: version field was reserved but not discussed, this is done now ok millert@ martijn@ --- usr.sbin/smtpd/lka_filter.c | 10 +++++----- usr.sbin/smtpd/lka_report.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/usr.sbin/smtpd/lka_filter.c b/usr.sbin/smtpd/lka_filter.c index ebb4be56730..9e55bffe1d1 100644 --- a/usr.sbin/smtpd/lka_filter.c +++ b/usr.sbin/smtpd/lka_filter.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lka_filter.c,v 1.40 2019/08/11 17:35:27 gilles Exp $ */ +/* $OpenBSD: lka_filter.c,v 1.41 2019/08/18 16:52:02 gilles Exp $ */ /* * Copyright (c) 2018 Gilles Chehade @@ -35,7 +35,7 @@ #include "smtpd.h" #include "log.h" -#define PROTOCOL_VERSION 0 +#define PROTOCOL_VERSION "0.1" struct filter; struct filter_session; @@ -740,13 +740,13 @@ filter_protocol_query(struct filter *filter, uint64_t token, uint64_t reqid, con fs = tree_xget(&sessions, reqid); if (strcmp(phase, "connect") == 0) n = io_printf(lka_proc_get_io(filter->proc), - "filter|%d|%lld.%06ld|smtp-in|%s|%016"PRIx64"|%016"PRIx64"|%s|%s\n", + "filter|%s|%lld.%06ld|smtp-in|%s|%016"PRIx64"|%016"PRIx64"|%s|%s\n", PROTOCOL_VERSION, tv.tv_sec, tv.tv_usec, phase, reqid, token, fs->rdns, param); else n = io_printf(lka_proc_get_io(filter->proc), - "filter|%d|%lld.%06ld|smtp-in|%s|%016"PRIx64"|%016"PRIx64"|%s\n", + "filter|%s|%lld.%06ld|smtp-in|%s|%016"PRIx64"|%016"PRIx64"|%s\n", PROTOCOL_VERSION, tv.tv_sec, tv.tv_usec, phase, reqid, token, param); @@ -763,7 +763,7 @@ filter_data_query(struct filter *filter, uint64_t token, uint64_t reqid, const c gettimeofday(&tv, NULL); n = io_printf(lka_proc_get_io(filter->proc), - "filter|%d|%lld.%06ld|smtp-in|data-line|" + "filter|%s|%lld.%06ld|smtp-in|data-line|" "%016"PRIx64"|%016"PRIx64"|%s\n", PROTOCOL_VERSION, tv.tv_sec, tv.tv_usec, diff --git a/usr.sbin/smtpd/lka_report.c b/usr.sbin/smtpd/lka_report.c index 3f37b437e4f..5813c281df9 100644 --- a/usr.sbin/smtpd/lka_report.c +++ b/usr.sbin/smtpd/lka_report.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lka_report.c,v 1.23 2019/08/11 17:35:27 gilles Exp $ */ +/* $OpenBSD: lka_report.c,v 1.24 2019/08/18 16:52:02 gilles Exp $ */ /* * Copyright (c) 2018 Gilles Chehade @@ -35,7 +35,7 @@ #include "smtpd.h" #include "log.h" -#define PROTOCOL_VERSION 0 +#define PROTOCOL_VERSION "0.1" struct reporter_proc { TAILQ_ENTRY(reporter_proc) entries; @@ -156,7 +156,7 @@ report_smtp_broadcast(uint64_t reqid, const char *direction, struct timeval *tv, continue; va_start(ap, format); - if (io_printf(lka_proc_get_io(rp->name), "report|%d|%lld.%06ld|%s|%s|", + if (io_printf(lka_proc_get_io(rp->name), "report|%s|%lld.%06ld|%s|%s|", PROTOCOL_VERSION, tv->tv_sec, tv->tv_usec, direction, event) == -1 || io_vprintf(lka_proc_get_io(rp->name), format, ap) == -1) fatalx("failed to write to processor"); -- cgit v1.2.3