summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2016-11-25 09:21:22 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2016-11-25 09:21:22 +0000
commitf64820aa8450c6cc2c546493cbfef43c86fda048 (patch)
treeaca309f5aa30905aab8ed5b57db21158d6cc9357 /usr.sbin
parent3d8a7b987d5edbf9dcd5115c2f7dec7846b8a4a9 (diff)
assign an id to each rule in the ruleset, first step towards an MTA layer
and scheduler simplification ok eric@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/smtpd/parse.y5
-rw-r--r--usr.sbin/smtpd/smtpd.h3
2 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/parse.y b/usr.sbin/smtpd/parse.y
index 3a73371cf08..0bc65098a26 100644
--- a/usr.sbin/smtpd/parse.y
+++ b/usr.sbin/smtpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.190 2016/09/12 07:33:00 eric Exp $ */
+/* $OpenBSD: parse.y,v 1.191 2016/11/25 09:21:21 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -93,6 +93,7 @@ char *symget(const char *);
struct smtpd *conf = NULL;
static int errors = 0;
+static uint64_t ruleid = 0;
struct filter_conf *filter = NULL;
struct table *table = NULL;
@@ -1409,6 +1410,7 @@ accept_params : opt_accept accept_params
rule : ACCEPT {
rule = xcalloc(1, sizeof(*rule), "parse rule: ACCEPT");
+ rule->r_id = ++ruleid;
rule->r_action = A_NONE;
rule->r_decision = R_ACCEPT;
rule->r_desttype = DEST_DOM;
@@ -1441,6 +1443,7 @@ rule : ACCEPT {
}
| REJECT {
rule = xcalloc(1, sizeof(*rule), "parse rule: REJECT");
+ rule->r_id = ++ruleid;
rule->r_decision = R_REJECT;
rule->r_desttype = DEST_DOM;
} decision {
diff --git a/usr.sbin/smtpd/smtpd.h b/usr.sbin/smtpd/smtpd.h
index ed308198545..46819c5e9e6 100644
--- a/usr.sbin/smtpd/smtpd.h
+++ b/usr.sbin/smtpd/smtpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtpd.h,v 1.524 2016/11/17 17:34:55 eric Exp $ */
+/* $OpenBSD: smtpd.h,v 1.525 2016/11/25 09:21:21 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -376,6 +376,7 @@ enum decision {
};
struct rule {
+ uint64_t r_id;
TAILQ_ENTRY(rule) r_entry;
enum decision r_decision;
uint8_t r_nottag;