summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2008-07-16 20:41:27 +0000
committerErmal Luçi <eri@pfsense.org>2008-07-16 20:41:27 +0000
commit64c7753b811ece45999370705ca87bbcf6128cb8 (patch)
treeef200f87e2853f18d537d55fa829ca6ebed5c275 /etc/inc
parenta5fd67e1b7317fae71d82aff20ee72cef5b4a710 (diff)
downloadpfsense-64c7753b811ece45999370705ca87bbcf6128cb8.zip
pfsense-64c7753b811ece45999370705ca87bbcf6128cb8.tar.gz
Create rules for dummynet propperly and add support on filter rule generation for differentiating between pipes and queues.
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/filter.inc21
-rw-r--r--etc/inc/shaper.inc4
2 files changed, 20 insertions, 5 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index f3b8317..843ddb6 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -1891,6 +1891,20 @@ function generate_user_filter_rule($rule)
$aline['queue'] .= ",".$rule['ackqueue'];
$aline['queue'] .= ") ";
}
+
+ if ($rule['dnpipe'] <> "") {
+ if ($rule['dnpipe'][0] == "?") {
+ $aline['dnpipe'] = " dnqueue( ";
+ $aline['dnpipe'] .= substr($rule['dnpipe'],1);
+ if ($rule['pdnpipe'] <> "")
+ $aline['dnpipe'] .= ",".substr($rule['pdnpipe'], 1);
+ } else {
+ $aline['dnpipe'] = " dnpipe ( " . $rule['dnpipe'];
+ if ($rule['pdnpipe'] <> "")
+ $aline['dnpipe'] .= ", " . $rule['pdnpipe'];
+ }
+ $aline['dnpipe'] .= ") ";
+ }
}
/* cache entries */
@@ -1922,13 +1936,14 @@ function generate_user_filter_rule($rule)
$line .= $aline['type'] . $aline['direction'] . $aline['log'] . $aline['quick'] . $aline['interface'] . $aline['prot'] .
$aline['src'] . $aline['srcport'] . $aline['os'] . $vpns . $aline['dstport'].
$aline['icmp-type'] . $aline['tag'] . $aline['tagged'] . $aline['dscp'] . $aline['flags'].
- $aline['queue'] . " label \"NEGATE_ROUTE: Negate policy route for local network(s)\"\n";
+ $aline['queue'] . $aline['dnpipe'] .
+ " label \"NEGATE_ROUTE: Negate policy route for local network(s)\"\n";
/* negate directly connected networks for load balancer/gateway rules */
$direct_networks = " to <direct_networks> ";
$line .= $aline['type'] . $aline['direction'] . $aline['log'] . $aline['quick'] . $aline['interface'] . $aline['prot'] .
$aline['src'] . $aline['srcport'] . $aline['os'] . $direct_networks . $aline['dstport'].
$aline['icmp-type'] . $aline['tag'] . $aline['tagged'] . $aline['dscp'] .
- $aline['flags'] . $aline['queue'] .
+ $aline['flags'] . $aline['queue'] . $aline['dnpipe'] .
" label \"NEGATE_ROUTE: Negate policy route for local network(s)\"\n";
}
@@ -1936,7 +1951,7 @@ function generate_user_filter_rule($rule)
$line .= $aline['type'] . $aline['direction'] . $aline['log'] . $aline['quick'] . $aline['interface'] . $aline['reply'] .
$aline['route'] . $aline['prot'] . $aline['src'] . $aline['srcport'] . $aline['os'] . $aline['dst'] .
$aline['dstport'] . $aline['icmp-type'] . $aline['tag'] . $aline['tagged'] . $aline['dscp'] .
- $aline['flags'] . $aline['queue'];
+ $aline['flags'] . $aline['queue'] . $aline['dnpipe'];
/* is a time based rule schedule attached? */
if($rule['sched']) {
diff --git a/etc/inc/shaper.inc b/etc/inc/shaper.inc
index c2eb093..e51c87c 100644
--- a/etc/inc/shaper.inc
+++ b/etc/inc/shaper.inc
@@ -2568,7 +2568,7 @@ class dnpipe_class extends dummynet_class {
function &get_queue_list($q = null) {
$qlist = array();
- $qlist[$this->GetQname()] = & $this;
+ $qlist[$this->GetQname()] = $this->GetNumber();
if (is_array($this->subqueues)) {
foreach ($this->subqueues as $queue)
$queue->get_queue_list(&$qlist);
@@ -2841,7 +2841,7 @@ class dnqueue_class extends dummynet_class {
}
function &get_queue_list(&$qlist) {
- $qlist[$this->GetQname()] = & $this;
+ $qlist[$this->GetQname()] = "?" .$this->GetNumber();
}
function ReadConfig(&$q) {
OpenPOWER on IntegriCloud