mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-17 10:04:41 +00:00
firewall: improve previous by reusing a class constant #6880
This commit is contained in:
parent
f8ff476cff
commit
f23f455bc4
@ -58,7 +58,7 @@ class DNatRule extends Rule
|
||||
'nat' => 'parseStaticText,nat ',
|
||||
'interface' => 'parseInterface',
|
||||
'ipprotocol' => 'parsePlain',
|
||||
'protocol' => 'parseReplaceSimple,tcp/udp:{tcp udp}|a/n:"a/n",proto ',
|
||||
'protocol' => self::PARSE_PROTO,
|
||||
'interface.from' => 'parseInterface, from (,:network)',
|
||||
'from' => 'parsePlainCurly,to ',
|
||||
'interface.to' => 'parseInterface, -> (,)',
|
||||
|
||||
@ -46,7 +46,7 @@ class FilterRule extends Rule
|
||||
'gateway' => 'parseRoute',
|
||||
'reply' => 'parsePlain',
|
||||
'ipprotocol' => 'parsePlain',
|
||||
'protocol' => 'parseReplaceSimple,tcp/udp:{tcp udp}|a/n:"a/n",proto ',
|
||||
'protocol' => self::PARSE_PROTO,
|
||||
'from' => 'parsePlainCurly,from ',
|
||||
'from_port' => 'parsePlainCurly, port ',
|
||||
'os' => 'parsePlain, os {","}',
|
||||
|
||||
@ -42,7 +42,7 @@ class ForwardRule extends Rule
|
||||
'log' => 'parseBool,log ',
|
||||
'interface' => 'parseInterface',
|
||||
'ipprotocol' => 'parsePlain',
|
||||
'protocol' => 'parseReplaceSimple,tcp/udp:{tcp udp}|a/n:"a/n",proto ',
|
||||
'protocol' => self::PARSE_PROTO,
|
||||
'from' => 'parsePlainCurly,from ',
|
||||
'from_port' => 'parsePlainCurly, port ',
|
||||
'to' => 'parsePlainCurly,to ',
|
||||
@ -59,7 +59,7 @@ class ForwardRule extends Rule
|
||||
'nat' => 'parseStaticText,nat ',
|
||||
'interface' => 'parseInterface',
|
||||
'ipprotocol' => 'parsePlain',
|
||||
'protocol' => 'parseReplaceSimple,tcp/udp:{tcp udp}|a/n:"a/n",proto ',
|
||||
'protocol' => self::PARSE_PROTO,
|
||||
'interface.from' => 'parseInterface, from (,:network)',
|
||||
'target.to' => 'parsePlainCurly,to ',
|
||||
'localport' => 'parsePlainCurly,port ',
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (C) 2017-2022 Deciso B.V.
|
||||
* Copyright (C) 2017-2023 Deciso B.V.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -38,6 +38,9 @@ abstract class Rule
|
||||
protected $interfaceMapping = array();
|
||||
protected $ruleDebugInfo = array();
|
||||
|
||||
/* ease the reuse of parsing for pf keywords by using class constants */
|
||||
const PARSE_PROTO = 'parseReplaceSimple,tcp/udp:{tcp udp}|a/n:"a/n",proto ';
|
||||
|
||||
/**
|
||||
* init Rule
|
||||
* @param array $interfaceMapping internal interface mapping
|
||||
|
||||
@ -40,7 +40,7 @@ class SNatRule extends Rule
|
||||
'log' => 'parseBool,log',
|
||||
'interface' => 'parseInterface',
|
||||
'ipprotocol' => 'parsePlain',
|
||||
'protocol' => 'parseReplaceSimple,tcp/udp:{tcp udp}|a/n:"a/n",proto ',
|
||||
'protocol' => self::PARSE_PROTO,
|
||||
'from' => 'parsePlain,from ',
|
||||
'sourceport' => 'parsePlain, port ',
|
||||
'to' => 'parsePlain,to ',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user