Commit e6dccb60 authored by Ad Schellevis's avatar Ad Schellevis

(filter) add prio, set-prio to new style FilterRule class as well (plugin...

(filter) add prio, set-prio to new style FilterRule class as well (plugin support + single parsing in 17.7)
parent 4f3239c7
...@@ -54,6 +54,8 @@ class FilterRule ...@@ -54,6 +54,8 @@ class FilterRule
'icmp6-type' => 'parsePlain,icmp6-type {,}', 'icmp6-type' => 'parsePlain,icmp6-type {,}',
'flags' => 'parsePlain, flags ', 'flags' => 'parsePlain, flags ',
'state' => 'parseState', 'state' => 'parseState',
'set-prio' => 'parsePlain, set prio ',
'prio' => 'parsePlain, prio ',
'allowopts' => 'parseBool,allow-opts', 'allowopts' => 'parseBool,allow-opts',
'label' => 'parsePlain,label ",",63' 'label' => 'parsePlain,label ",",63'
); );
...@@ -81,7 +83,7 @@ class FilterRule ...@@ -81,7 +83,7 @@ class FilterRule
if (!empty($maxsize) && strlen($value) > $maxsize) { if (!empty($maxsize) && strlen($value) > $maxsize) {
$value = substr($value, 0, $maxsize); $value = substr($value, 0, $maxsize);
} }
return $value == '' ? "" : $prefix . $value . $suffix . " "; return $value === '' ? "" : $prefix . $value . $suffix . " ";
} }
/** /**
...@@ -238,6 +240,11 @@ class FilterRule ...@@ -238,6 +240,11 @@ class FilterRule
if ($ipproto == 'inet6' && !empty($tmp['protocol']) && $tmp['protocol'] == "icmp") { if ($ipproto == 'inet6' && !empty($tmp['protocol']) && $tmp['protocol'] == "icmp") {
$tmp['protocol'] = 'ipv6-icmp'; $tmp['protocol'] = 'ipv6-icmp';
} }
// set prio
if (isset($tmp['set-prio']) && $tmp['set-prio'] !== ""
&& isset($tmp['set-prio-low']) && $tmp['set-prio-low'] !== "" ) {
$tmp['set-prio'] = "({$tmp['set-prio']}, {$tmp['set-prio-low']})" ;
}
$result[] = $tmp; $result[] = $tmp;
} }
} }
......
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