summaryrefslogtreecommitdiff
path: root/sbin/pfctl
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2001-10-01 17:58:17 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2001-10-01 17:58:17 +0000
commitda5e7340c9b11fb3108b668aaa71f5cddd398c22 (patch)
treebdbbceb07f82bfa426e167be6042ba5c8dbc5778 /sbin/pfctl
parent698fd6da3e24caa7703b972ab4188af95154df49 (diff)
print variable asignments only if -v is given. ok dhartmei/deraadt
Diffstat (limited to 'sbin/pfctl')
-rw-r--r--sbin/pfctl/parse.y5
-rw-r--r--sbin/pfctl/pfctl.c8
-rw-r--r--sbin/pfctl/pfctl_parser.h8
3 files changed, 11 insertions, 10 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index 28b48afba6f..b9a3e449737 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.37 2001/09/28 14:12:15 dhartmei Exp $ */
+/* $OpenBSD: parse.y,v 1.38 2001/10/01 17:58:16 markus Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -183,7 +183,8 @@ ruleset : /* empty */
varset : STRING PORTUNARY STRING
{
- printf("%s = %s\n", $1, $3);
+ if (pf->opts & PF_OPT_VERBOSE)
+ printf("%s = %s\n", $1, $3);
if (symset($1, $3) == -1) {
yyerror("cannot store variable %s", $1);
YYERROR;
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index 7e31c88b19f..cb16efe7ae7 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl.c,v 1.42 2001/10/01 14:38:34 dhartmei Exp $ */
+/* $OpenBSD: pfctl.c,v 1.43 2001/10/01 17:58:16 markus Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -47,12 +47,6 @@
#include "pfctl_parser.h"
-#define PF_OPT_DISABLE 0x0001
-#define PF_OPT_ENABLE 0x0002
-#define PF_OPT_VERBOSE 0x0004
-#define PF_OPT_NOACTION 0x0008
-#define PF_OPT_QUIET 0x0010
-
void usage(void);
int pfctl_enable(int, int);
int pfctl_disable(int, int);
diff --git a/sbin/pfctl/pfctl_parser.h b/sbin/pfctl/pfctl_parser.h
index 67984ac96fc..4edc13476e5 100644
--- a/sbin/pfctl/pfctl_parser.h
+++ b/sbin/pfctl/pfctl_parser.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_parser.h,v 1.10 2001/09/15 03:54:40 frantzen Exp $ */
+/* $OpenBSD: pfctl_parser.h,v 1.11 2001/10/01 17:58:16 markus Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -33,6 +33,12 @@
#ifndef _PFCTL_PARSER_H_
#define _PFCTL_PARSER_H_
+#define PF_OPT_DISABLE 0x0001
+#define PF_OPT_ENABLE 0x0002
+#define PF_OPT_VERBOSE 0x0004
+#define PF_OPT_NOACTION 0x0008
+#define PF_OPT_QUIET 0x0010
+
struct pfctl {
int dev;
int opts;