summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2002-11-22 12:24:31 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2002-11-22 12:24:31 +0000
commit9a12b627cf863d7d925d58058aabd727f6bce322 (patch)
tree3b72bb552c382620a0f6b311e3ffbd4ee7811ed4 /sbin
parentee28e4711f09b1e975cd2272bc494c2b1935601f (diff)
print altq and queue lines in the pfctl -v case including the child queue
assignment
Diffstat (limited to 'sbin')
-rw-r--r--sbin/pfctl/parse.y28
-rw-r--r--sbin/pfctl/pfctl.c6
2 files changed, 27 insertions, 7 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index d09907d69f6..fe3c2f40270 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.197 2002/11/19 18:51:09 henning Exp $ */
+/* $OpenBSD: parse.y,v 1.198 2002/11/22 12:24:30 henning Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -2295,6 +2295,18 @@ expand_altq(struct pf_altq *a, struct node_if *interfaces,
else {
eval_pfaltq(pf, &pa);
pfctl_add_altq(pf, &pa);
+ if (pf->opts & PF_OPT_VERBOSE) {
+ print_altq(&pf->paltq->altq, 0);
+ if (nqueues && nqueues->tail) {
+ printf(" queue { ");
+ LOOP_THROUGH(struct node_queue, queue,
+ nqueues,
+ printf("%s ", queue->queue);
+ );
+ printf("}");
+ }
+ printf("\n");
+ }
/* now create a root queue */
memset(&pb, 0, sizeof(struct pf_altq));
@@ -2356,14 +2368,26 @@ expand_queue(struct pf_altq *a, struct node_queue *nqueues,
queues->tail = n;
}
);
- FREE_LIST(struct node_queue, nqueues);
strlcpy(a->ifname, tqueue->ifname, IFNAMSIZ);
strlcpy(a->parent, tqueue->parent, PF_QNAME_SIZE);
eval_pfqueue(pf, a, bwspec.bw_absolute,
bwspec.bw_percent);
pfctl_add_altq(pf, a);
+ if (pf->opts & PF_OPT_VERBOSE) {
+ print_altq(&pf->paltq->altq, 0);
+ if (nqueues && nqueues->tail) {
+ printf(" { ");
+ LOOP_THROUGH(struct node_queue, queue,
+ nqueues,
+ printf("%s ", queue->queue);
+ );
+ printf("}");
+ }
+ printf("\n");
+ }
added++;
+ FREE_LIST(struct node_queue, nqueues);
}
);
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index 2d4f1826279..21274068121 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl.c,v 1.86 2002/11/18 22:49:15 henning Exp $ */
+/* $OpenBSD: pfctl.c,v 1.87 2002/11/22 12:24:30 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -656,10 +656,6 @@ pfctl_add_altq(struct pfctl *pf, struct pf_altq *a)
err(1, "DIOCADDALTQ");
}
pfaltq_store(&pf->paltq->altq);
- if (pf->opts & PF_OPT_VERBOSE) {
- print_altq(&pf->paltq->altq, 0);
- printf("\n");
- }
}
return (0);
}