summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2003-03-08 14:26:32 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2003-03-08 14:26:32 +0000
commit36d27ae8300381fb26a2b6231119c5906281edd6 (patch)
tree5b185aa610d237c437d9c0eae78dc19499d89956 /sbin
parent0f997dce619f709eefec266ef64ca149344f4e67 (diff)
inlcude queue interals in -gsr and -gsq output; will make debugging easier.
ok cedric@ pb@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/pfctl/pfctl.c10
-rw-r--r--sbin/pfctl/pfctl_qstats.c19
2 files changed, 18 insertions, 11 deletions
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index e716ba0cb73..39a87241b8e 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl.c,v 1.157 2003/03/07 12:55:37 henning Exp $ */
+/* $OpenBSD: pfctl.c,v 1.158 2003/03/08 14:26:31 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -498,6 +498,9 @@ pfctl_print_rule_counters(struct pf_rule *rule, int opts)
printf("%u ", rule->skip[i].nr);
}
printf("]\n");
+
+ printf("[ Queue: qname=%s qid=%d pqname=%s pqid=%d ]\n",
+ rule->qname, rule->qid, rule->pqname, rule->pqid);
}
if (opts & PF_OPT_VERBOSE)
printf("[ Evaluations: %-8llu Packets: %-8llu "
@@ -1503,8 +1506,7 @@ main(int argc, char *argv[])
pfctl_show_nat(dev, opts);
break;
case 'q':
- pfctl_show_altq(dev, opts & PF_OPT_VERBOSE,
- opts & PF_OPT_VERBOSE2);
+ pfctl_show_altq(dev, opts, opts & PF_OPT_VERBOSE2);
break;
case 's':
pfctl_show_states(dev, 0, opts);
@@ -1521,7 +1523,7 @@ main(int argc, char *argv[])
case 'a':
pfctl_show_rules(dev, opts, 0);
pfctl_show_nat(dev, opts);
- pfctl_show_altq(dev, opts & PF_OPT_VERBOSE, 0);
+ pfctl_show_altq(dev, opts, 0);
pfctl_show_states(dev, 0, opts);
pfctl_show_status(dev);
pfctl_show_rules(dev, opts, 1);
diff --git a/sbin/pfctl/pfctl_qstats.c b/sbin/pfctl/pfctl_qstats.c
index 9051f42ba20..64278d65edb 100644
--- a/sbin/pfctl/pfctl_qstats.c
+++ b/sbin/pfctl/pfctl_qstats.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_qstats.c,v 1.13 2003/03/02 23:37:24 henning Exp $ */
+/* $OpenBSD: pfctl_qstats.c,v 1.14 2003/03/08 14:26:31 henning Exp $ */
/*
* Copyright (c) 2003 Henning Brauer
@@ -51,6 +51,7 @@
#include <altq/altq_hfsc.h>
#include "pfctl.h"
+#include "pfctl_parser.h"
union class_stats {
class_stats_t cbq_stats;
@@ -91,7 +92,7 @@ double calc_rate(u_int64_t, u_int64_t, double);
double calc_pps(u_int64_t, u_int64_t, double);
int
-pfctl_show_altq(int dev, int verbose, int verbose2)
+pfctl_show_altq(int dev, int opts, int verbose2)
{
struct pf_altq_node *root = NULL, *node;
@@ -99,7 +100,7 @@ pfctl_show_altq(int dev, int verbose, int verbose2)
return (-1);
for (node = root; node != NULL; node = node->next)
- pfctl_print_altq_node(dev, node, 0, verbose);
+ pfctl_print_altq_node(dev, node, 0, opts);
while (verbose2) {
printf("\n");
@@ -107,7 +108,7 @@ pfctl_show_altq(int dev, int verbose, int verbose2)
if (pfctl_update_qstats(dev, &root))
return (-1);
for (node = root; node != NULL; node = node->next)
- pfctl_print_altq_node(dev, node, 0, verbose);
+ pfctl_print_altq_node(dev, node, 0, opts);
}
pfctl_free_altq_node(root);
return (0);
@@ -221,7 +222,7 @@ pfctl_find_altq_node(struct pf_altq_node *root, const char *qname,
void
pfctl_print_altq_node(int dev, const struct pf_altq_node *node, unsigned level,
- int verbose)
+ int opts)
{
const struct pf_altq_node *child;
@@ -242,12 +243,16 @@ pfctl_print_altq_node(int dev, const struct pf_altq_node *node, unsigned level,
}
printf("\n");
- if (verbose)
+ if (opts & PF_OPT_VERBOSE)
pfctl_print_altq_nodestat(dev, node);
+ if (opts & PF_OPT_DEBUG)
+ printf("[ qid=%d ifname=%s ifbandwidth=%s ]\n", node->altq.qid,
+ node->altq.ifname, rate2str(node->altq.ifbandwidth));
+
for (child = node->children; child != NULL;
child = child->next)
- pfctl_print_altq_node(dev, child, level+1, verbose);
+ pfctl_print_altq_node(dev, child, level+1, opts);
}
void