summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2003-04-13 20:41:38 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2003-04-13 20:41:38 +0000
commit46ca03fbffe853e27c0ca76c880a93d2928bb374 (patch)
treec197dc85c8ef5f55bf0d10e0e8f63db534b183ed /sbin
parent8eb1dafdd0f9eec7c42d6f64c12136246e1c035c (diff)
new struct node_hfsc_opts for, surprise, hfsc options. needed because they
contain bandwidth specifications and we need to carry the unprocessed bw specs around for quite some time until we can break them down to absolute values.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/pfctl/parse.y5
-rw-r--r--sbin/pfctl/pfctl_parser.h28
2 files changed, 24 insertions, 9 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index bbb00c1992e..9619257e19d 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.359 2003/04/13 20:16:06 henning Exp $ */
+/* $OpenBSD: parse.y,v 1.360 2003/04/13 20:41:37 henning Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -982,7 +982,8 @@ scheduler : CBQ {
}
| HFSC {
$$.qtype = ALTQT_HFSC;
- $$.data.hfsc_opts.flags = 0;
+ bzero(&$$.data.hfsc_opts,
+ sizeof(struct node_hfsc_opts));
}
| HFSC '(' hfscflags_list ')' {
$$.qtype = ALTQT_HFSC;
diff --git a/sbin/pfctl/pfctl_parser.h b/sbin/pfctl/pfctl_parser.h
index 495e5f01d84..7af5b2c7862 100644
--- a/sbin/pfctl/pfctl_parser.h
+++ b/sbin/pfctl/pfctl_parser.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_parser.h,v 1.55 2003/04/13 20:16:06 henning Exp $ */
+/* $OpenBSD: pfctl_parser.h,v 1.56 2003/04/13 20:41:37 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -93,20 +93,34 @@ struct node_host {
struct node_host *tail;
};
+struct node_queue_bw {
+ u_int32_t bw_absolute;
+ u_int16_t bw_percent;
+};
+
+struct node_hfsc_sc {
+ struct node_queue_bw m1; /* slope of 1st segment; bps */
+ u_int d; /* x-projection of m1; msec */
+ struct node_queue_bw m2; /* slope of 2nd segment; bps */
+ u_int8_t used;
+};
+
+struct node_hfsc_opts {
+ struct node_hfsc_sc realtime;
+ struct node_hfsc_sc linkshare;
+ struct node_hfsc_sc upperlimit;
+ int flags;
+};
+
struct node_queue_opt {
int qtype;
union {
struct cbq_opts cbq_opts;
struct priq_opts priq_opts;
- struct hfsc_opts hfsc_opts;
+ struct node_hfsc_opts hfsc_opts;
} data;
};
-struct node_queue_bw {
- u_int32_t bw_absolute;
- u_int16_t bw_percent;
-};
-
int pfctl_add_rule(struct pfctl *, struct pf_rule *);
int pfctl_add_altq(struct pfctl *, struct pf_altq *);
int pfctl_add_pool(struct pfctl *, struct pf_pool *, sa_family_t);