mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 09:04:39 +00:00
(filter) extend new style FilterRule, adds icmptype, tag, tagged
This commit is contained in:
parent
fc6ad65277
commit
51d2acf44e
@ -51,11 +51,14 @@ class FilterRule
|
||||
'from_port' => 'parsePlain, port {,}',
|
||||
'to' => 'parsePlain,to {,}',
|
||||
'to_port' => 'parsePlain, port {,}',
|
||||
'icmp-type' => 'parsePlain,icmp-type {,}',
|
||||
'icmp6-type' => 'parsePlain,icmp6-type {,}',
|
||||
'flags' => 'parsePlain, flags ',
|
||||
'state' => 'parseState',
|
||||
'set-prio' => 'parsePlain, set prio ',
|
||||
'prio' => 'parsePlain, prio ',
|
||||
'tag' => 'parsePlain, tag ',
|
||||
'tagged' => 'parsePlain, tagged ',
|
||||
'allowopts' => 'parseBool,allow-opts',
|
||||
'label' => 'parsePlain,label ",",63'
|
||||
);
|
||||
@ -236,6 +239,14 @@ class FilterRule
|
||||
"/" . $tmp['max-src-conn-rates'] . ", overload <virusprot> flush global ";
|
||||
}
|
||||
}
|
||||
// icmp-type switch (ipv4/ipv6)
|
||||
if ($tmp['protocol'] == "icmp" && !empty($tmp['icmptype'])) {
|
||||
if ($ipproto == 'inet') {
|
||||
$tmp['icmp-type'] = $tmp['icmptype'];
|
||||
} elseif ($ipproto == 'inet6') {
|
||||
$tmp['icmp6-type'] = $tmp['icmptype'];
|
||||
}
|
||||
}
|
||||
// icmpv6
|
||||
if ($ipproto == 'inet6' && !empty($tmp['protocol']) && $tmp['protocol'] == "icmp") {
|
||||
$tmp['protocol'] = 'ipv6-icmp';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user