summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/ruleset.c
diff options
context:
space:
mode:
authorEric Faurot <eric@cvs.openbsd.org>2012-09-21 10:22:30 +0000
committerEric Faurot <eric@cvs.openbsd.org>2012-09-21 10:22:30 +0000
commitf4052dcf6a490e95d9ba80644c70f44b14b072c7 (patch)
tree91351e80b67b82acc71986cff09f3e65a0c367ca /usr.sbin/smtpd/ruleset.c
parent2e1d858eb52f280440e2f9a8249aece7ef578bf4 (diff)
Move ruleset_match() prototype to smtpd.h and make the envelope const.
Adapt a lot of functions in chain to use const args where required. ok gilles@
Diffstat (limited to 'usr.sbin/smtpd/ruleset.c')
-rw-r--r--usr.sbin/smtpd/ruleset.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/usr.sbin/smtpd/ruleset.c b/usr.sbin/smtpd/ruleset.c
index 051151a7bea..8bd96dc914f 100644
--- a/usr.sbin/smtpd/ruleset.c
+++ b/usr.sbin/smtpd/ruleset.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ruleset.c,v 1.22 2012/09/15 15:12:11 eric Exp $ */
+/* $OpenBSD: ruleset.c,v 1.23 2012/09/21 10:22:29 eric Exp $ */
/*
* Copyright (c) 2009 Gilles Chehade <gilles@openbsd.org>
@@ -33,22 +33,20 @@
#include "log.h"
-struct rule *ruleset_match(struct envelope *);
-
-static int ruleset_check_source(struct map *, struct sockaddr_storage *);
+static int ruleset_check_source(struct map *, const struct sockaddr_storage *);
static int ruleset_match_mask(struct sockaddr_storage *, struct netaddr *);
static int ruleset_inet4_match(struct sockaddr_in *, struct netaddr *);
static int ruleset_inet6_match(struct sockaddr_in6 *, struct netaddr *);
struct rule *
-ruleset_match(struct envelope *evp)
+ruleset_match(const struct envelope *evp)
{
struct rule *r;
struct map *map;
struct mapel *me;
- struct mailaddr *maddr = &evp->dest;
- struct sockaddr_storage *ss = &evp->ss;
+ const struct mailaddr *maddr = &evp->dest;
+ const struct sockaddr_storage *ss = &evp->ss;
if (evp->flags & DF_INTERNAL)
ss = NULL;
@@ -95,7 +93,7 @@ ruleset_match(struct envelope *evp)
}
static int
-ruleset_cmp_source(char *s1, char *s2)
+ruleset_cmp_source(const char *s1, const char *s2)
{
struct netaddr n1;
struct netaddr n2;
@@ -115,7 +113,7 @@ ruleset_cmp_source(char *s1, char *s2)
}
static int
-ruleset_check_source(struct map *map, struct sockaddr_storage *ss)
+ruleset_check_source(struct map *map, const struct sockaddr_storage *ss)
{
struct mapel *me;