Skip to content

Commit

Permalink
remove non-functional traffic shaper (dummynet) from legacy code
Browse files Browse the repository at this point in the history
related to recent kernel cleanup.

This will be replaced with more standard components (schedule 15.7)
  • Loading branch information
AdSchellevis committed Apr 27, 2015
1 parent 701d234 commit cd1c36f
Show file tree
Hide file tree
Showing 14 changed files with 168 additions and 1,950 deletions.
25 changes: 4 additions & 21 deletions src/etc/inc/filter.inc
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function filter_delete_states_for_down_gateways() {
function filter_configure_sync($delete_states_if_needed = true)
{
global $config, $g, $after_filter_configure_run, $FilterIflist;
global $time_based_rules, $filterdns, $aliases, $dummynet_name_list;
global $time_based_rules, $filterdns, $aliases;

/* Use filter lock to not allow concurrent filter reloads during this run. */
$filterlck = lock('filter', LOCK_EX);
Expand All @@ -186,8 +186,6 @@ function filter_configure_sync($delete_states_if_needed = true)
if(file_exists("/var/run/booting"))
echo ".";
update_filter_reload_status(gettext("Generating Limiter rules"));
$dummynet_rules = filter_generate_dummynet_rules();
$dummynet_name_list = get_unique_dnqueue_list();
update_filter_reload_status(gettext("Generating NAT rules"));
/* generate nat rules */
$natrules = filter_nat_rules_generate();
Expand Down Expand Up @@ -2229,7 +2227,7 @@ function filter_generate_address(& $rule, $target = "source", $isnat = false) {
function filter_generate_user_rule($rule)
{
global $config, $g, $FilterIflist, $GatewaysList;
global $layer7_rules_list, $dummynet_name_list;
global $layer7_rules_list;

/* don't include disabled rules */
if(isset($rule['disabled'])) {
Expand Down Expand Up @@ -2544,21 +2542,6 @@ function filter_generate_user_rule($rule)
$aline['queue'] .= ",".$rule['ackqueue'];
$aline['queue'] .= ") ";
}
if($rule['dnpipe'] <> "") {
if (!empty($dummynet_name_list[$rule['dnpipe']])) {
if($dummynet_name_list[$rule['dnpipe']][0] == "?") {
$aline['dnpipe'] = " dnqueue( ";
$aline['dnpipe'] .= substr($dummynet_name_list[$rule['dnpipe']],1);
if($rule['pdnpipe'] <> "")
$aline['dnpipe'] .= ",".substr($dummynet_name_list[$rule['pdnpipe']], 1);
} else {
$aline['dnpipe'] = " dnpipe ( " . $dummynet_name_list[$rule['dnpipe']];
if($rule['pdnpipe'] <> "")
$aline['dnpipe'] .= "," . $dummynet_name_list[$rule['pdnpipe']];
}
$aline['dnpipe'] .= ") ";
}
}

/* is a time based rule schedule attached? */
if(!empty($rule['sched']) && !empty($config['schedules'])) {
Expand Down Expand Up @@ -2588,15 +2571,15 @@ function filter_generate_user_rule($rule)
$aline['interface'] . $aline['ipprotocol'] . $aline['prot'] . $aline['src'] . $aline['os'] .
$negate_networks . $aline['icmp-type'] . $aline['icmp6-type'] . $aline['tag'] . $aline['tagged'] .
$aline['vlanprio'] . $aline['vlanprioset'] . $aline['dscp'] . $aline['allowopts'] . $aline['flags'] .
$aline['queue'] . $aline['dnpipe'] . $aline['schedlabel'] .
$aline['queue'] . $aline['schedlabel'] .
" label \"NEGATE_ROUTE: Negate policy routing for destination\"\n";

}
/* piece together the actual user rule */
$line .= $aline['type'] . $aline['direction'] . $aline['log'] . $aline['quick'] . $aline['interface'] .
$aline['reply'] . $aline['route'] . $aline['ipprotocol'] . $aline['prot'] . $aline['src'] . $aline['os'] . $aline['dst'] .
$aline['divert'] . $aline['icmp-type'] . $aline['icmp6-type'] . $aline['tag'] . $aline['tagged'] . $aline['dscp'] .
$aline['vlanprio'] . $aline['vlanprioset'] . $aline['allowopts'] . $aline['flags'] . $aline['queue'] . $aline['dnpipe'] . $aline['schedlabel'];
$aline['vlanprio'] . $aline['vlanprioset'] . $aline['allowopts'] . $aline['flags'] . $aline['queue'] . $aline['schedlabel'];

unset($aline);

Expand Down
6 changes: 0 additions & 6 deletions src/etc/inc/priv.defs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,6 @@ $priv_list['page-firewall-trafficshaper-queues']['descr'] = gettext("Allow acces
$priv_list['page-firewall-trafficshaper-queues']['match'] = array();
$priv_list['page-firewall-trafficshaper-queues']['match'][] = "firewall_shaper_queues.php*";

$priv_list['page-firewall-trafficshaper-limiter'] = array();
$priv_list['page-firewall-trafficshaper-limiter']['name'] = gettext("WebCfg - Firewall: Traffic Shaper: Limiter page");
$priv_list['page-firewall-trafficshaper-limiter']['descr'] = gettext("Allow access to the 'Firewall: Traffic Shaper: Limiter' page.");
$priv_list['page-firewall-trafficshaper-limiter']['match'] = array();
$priv_list['page-firewall-trafficshaper-limiter']['match'][] = "firewall_shaper_vinterface.php*";

$priv_list['page-firewall-trafficshaper-wizard'] = array();
$priv_list['page-firewall-trafficshaper-wizard']['name'] = gettext("WebCfg - Firewall: Traffic Shaper: Wizard page");
$priv_list['page-firewall-trafficshaper-wizard']['descr'] = gettext("Allow access to the 'Firewall: Traffic Shaper: Wizard' page.");
Expand Down
Loading

0 comments on commit cd1c36f

Please sign in to comment.