diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2002-11-27 16:06:21 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2002-11-27 16:06:21 +0000 |
commit | 1a66adc864150e820ab5cc020e6f77477326076d (patch) | |
tree | 772e473f57829ed38f78cf9caf69bb0ff918e845 | |
parent | dd3da782f39dfc96ef2362616b4fe47d873fcf8c (diff) |
next round in print fixes:
-only print priority if it is not equal to the default one
-space handling overhaul
-rw-r--r-- | sbin/pfctl/parse.y | 6 | ||||
-rw-r--r-- | sbin/pfctl/pfctl_altq.c | 20 |
2 files changed, 14 insertions, 12 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index c565d193623..1e82be489e0 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.220 2002/11/27 15:49:16 henning Exp $ */ +/* $OpenBSD: parse.y,v 1.221 2002/11/27 16:06:20 henning Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. @@ -2457,7 +2457,7 @@ expand_altq(struct pf_altq *a, struct node_if *interfaces, if (pf->opts & PF_OPT_VERBOSE) { print_altq(&pf->paltq->altq, 0); if (nqueues && nqueues->tail) { - printf(" queue { "); + printf("queue { "); LOOP_THROUGH(struct node_queue, queue, nqueues, printf("%s ", @@ -2547,7 +2547,7 @@ expand_queue(struct pf_altq *a, struct node_queue *nqueues, if (pf->opts & PF_OPT_VERBOSE) { print_altq(&pf->paltq->altq, 0); if (nqueues && nqueues->tail) { - printf(" { "); + printf("{ "); LOOP_THROUGH(struct node_queue, queue, nqueues, printf("%s ", queue->queue); diff --git a/sbin/pfctl/pfctl_altq.c b/sbin/pfctl/pfctl_altq.c index cb13bc17acc..a826c350a1c 100644 --- a/sbin/pfctl/pfctl_altq.c +++ b/sbin/pfctl/pfctl_altq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl_altq.c,v 1.10 2002/11/27 15:00:41 henning Exp $ */ +/* $OpenBSD: pfctl_altq.c,v 1.11 2002/11/27 16:06:20 henning Exp $ */ /* * Copyright (C) 2002 * Sony Computer Science Laboratories Inc. All rights reserved. @@ -142,16 +142,16 @@ print_altq(const struct pf_altq *a, unsigned level) return; } - printf("altq on %s scheduler", a->ifname); + printf("altq on %s scheduler ", a->ifname); switch(a->scheduler) { case ALTQT_CBQ: print_cbq_opts(a); if (!a->pq_u.cbq_opts.flags) - printf(" cbq"); + printf("cbq "); } - printf(" bandwidth %s tbrsize %u", rate2str((double)a->ifbandwidth), + printf("bandwidth %s tbrsize %u ", rate2str((double)a->ifbandwidth), a->tbrsize); } @@ -163,8 +163,10 @@ print_queue(const struct pf_altq *a, unsigned level) printf("queue "); for (i = 0; i < level; ++i) printf(" "); - printf("%s bandwidth %s priority %u", a->qname, - rate2str((double)a->bandwidth), a->priority); + printf("%s ", a->qname); + printf("bandwidth %s ", rate2str((double)a->bandwidth)); + if (a->priority != DEFAULT_PRIORITY) + printf("priority %u ", a->priority); switch (a->scheduler) { case ALTQT_CBQ: print_cbq_opts(a); @@ -440,7 +442,7 @@ print_cbq_opts(const struct pf_altq *a) */ if (opts->flags) { - printf(" cbq("); + printf("cbq("); if (opts->flags & CBQCLF_RED) printf(" red"); if (opts->flags & CBQCLF_ECN) @@ -461,7 +463,7 @@ print_cbq_opts(const struct pf_altq *a) printf(" root"); if (opts->flags & CBQCLF_DEFCLASS) printf(" default"); - printf(" )"); + printf(" ) "); } } @@ -535,7 +537,7 @@ pfctl_print_altq_node(const struct pf_altq_node *node, unsigned level) print_altq(&node->altq, level); if (node->children != NULL) { - printf(" {"); + printf("{"); for (child = node->children; child != NULL; child = child->next) { printf("%s", child->altq.qname); |