summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sbin/pfctl/parse.y15
-rw-r--r--sbin/pfctl/pfctl.86
-rw-r--r--sbin/pfctl/pfctl.c6
-rw-r--r--sbin/pfctl/pfctl_parser.h5
4 files changed, 19 insertions, 13 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index 55a52e68c08..26e286161b8 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.232 2002/12/02 22:45:37 henning Exp $ */
+/* $OpenBSD: parse.y,v 1.233 2002/12/04 08:07:27 deraadt Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -3350,7 +3350,7 @@ top:
}
int
-parse_rules(FILE *input, struct pfctl *xpf)
+parse_rules(FILE *input, struct pfctl *xpf, int opts)
{
struct sym *sym;
@@ -3362,11 +3362,12 @@ parse_rules(FILE *input, struct pfctl *xpf)
yyparse();
/* Check which macros have not been used. */
- for (sym = symhead; sym; sym = sym->next)
- if (!sym->used)
- fprintf(stderr, "warning: macro '%s' not used\n",
- sym->nam);
-
+ if (opts & PF_OPT_VERBOSE2) {
+ for (sym = symhead; sym; sym = sym->next)
+ if (!sym->used)
+ fprintf(stderr, "warning: macro '%s' not used\n",
+ sym->nam);
+ }
return (errors ? -1 : 0);
}
diff --git a/sbin/pfctl/pfctl.8 b/sbin/pfctl/pfctl.8
index 1457bbfac7a..059366dea2e 100644
--- a/sbin/pfctl/pfctl.8
+++ b/sbin/pfctl/pfctl.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: pfctl.8,v 1.56 2002/11/24 18:02:06 pb Exp $
+.\" $OpenBSD: pfctl.8,v 1.57 2002/12/04 08:07:28 deraadt Exp $
.\"
.\" Copyright (c) 2001 Kjell Wooding. All rights reserved.
.\"
@@ -174,7 +174,9 @@ Show the current pool memory hard limits.
Show all of the above.
.El
.It Fl v
-Produce more verbose output.
+Produce more verbose output. A second use of
+.Fl v
+will produce an additional level of more verbose output.
.It Fl x Ar level
Set the debug level to one of the following.
Level names may be abbreviated:
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index 32a2e3294aa..0b3002a24e9 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl.c,v 1.95 2002/12/01 22:10:40 henning Exp $ */
+/* $OpenBSD: pfctl.c,v 1.96 2002/12/04 08:07:28 deraadt Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -818,7 +818,7 @@ pfctl_rules(int dev, char *filename, int opts)
pf.paltq = &pa;
pf.prule = &pl;
pf.rule_nr = 0;
- if (parse_rules(fin, &pf) < 0)
+ if (parse_rules(fin, &pf, opts) < 0)
errx(1, "Syntax error in file: pf rules not loaded");
if ((altqsupport && loadopt & (PFCTL_FLAG_ALTQ | PFCTL_FLAG_ALL)) != 0)
if (check_commit_altq(dev, opts) != 0)
@@ -1078,6 +1078,8 @@ main(int argc, char *argv[])
showopt = optarg;
break;
case 'v':
+ if (opts & PF_OPT_VERBOSE)
+ opts |= PF_OPT_VERBOSE2;
opts |= PF_OPT_VERBOSE;
break;
case 'x':
diff --git a/sbin/pfctl/pfctl_parser.h b/sbin/pfctl/pfctl_parser.h
index 1ccd6f477ab..b985600b027 100644
--- a/sbin/pfctl/pfctl_parser.h
+++ b/sbin/pfctl/pfctl_parser.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_parser.h,v 1.31 2002/11/30 13:53:15 mickey Exp $ */
+/* $OpenBSD: pfctl_parser.h,v 1.32 2002/12/04 08:07:28 deraadt Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -40,6 +40,7 @@
#define PF_OPT_QUIET 0x0010
#define PF_OPT_CLRRULECTRS 0x0020
#define PF_OPT_USEDNS 0x0040
+#define PF_OPT_VERBOSE2 0x0080
#define PF_TH_ALL 0xFF
@@ -77,7 +78,7 @@ int pfctl_set_optimization(struct pfctl *, const char *);
int pfctl_set_limit(struct pfctl *, const char *, unsigned int);
int pfctl_set_logif(struct pfctl *, char *);
-int parse_rules(FILE *, struct pfctl *);
+int parse_rules(FILE *, struct pfctl *, int);
int parse_flags(char *);
void print_rule(struct pf_rule *);