Commit 212f51a6 authored by Ad Schellevis's avatar Ad Schellevis

filter, framework. add "gateway" implementation. disable the...

filter, framework. add "gateway" implementation. disable the setGateways/setGatewayGroups for now, used as placeholder.
parent 1417414b
......@@ -377,6 +377,8 @@ function filter_configure_sync($verbose = false)
// initialize fw plugin object
$fw = new \OPNsense\Firewall\Plugin();
$fw->setInterfaceMapping(legacy_config_get_interfaces(array("enable" => true)));
//$fw->setGateways(return_gateways_array());
//$fw->setGatewayGroups(return_gateway_groups_array());
filter_core_bootstrap($fw);
plugins_firewall($fw);
......
......@@ -46,6 +46,7 @@ class FilterRule
'log' => 'parseBool,log',
'quick' => 'parseBool,quick',
'interface' => 'parseInterface',
'gateway' => 'parseRoute',
'ipprotocol' => 'parsePlain',
'protocol' => 'parseReplaceSimple,tcp/udp:{tcp udp},proto ',
'from' => 'parsePlain,from {,}',
......@@ -147,6 +148,20 @@ class FilterRule
}
}
/**
* parse gateway (route-to)
* @param string $value field value
* @return string
*/
private function parseRoute($value)
{
if (!empty($this->gatewayMapping[$value]['logic'])) {
return " " . $this->gatewayMapping[$value]['logic'] . " ";
} else {
return "";
}
}
/**
* parse boolean, return text from $valueTrue / $valueFalse
* @param string $value field value
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment