mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 17:14:46 +00:00
openvpn export, move alias_expand() into single use-case, will be refactored later
This commit is contained in:
parent
a02ad4cb00
commit
14652b4fb1
@ -1049,20 +1049,6 @@ function is_alias($name)
|
||||
return array_key_exists($name, $aliastable);
|
||||
}
|
||||
|
||||
/* expand a host or network alias, if necessary */
|
||||
function alias_expand($name)
|
||||
{
|
||||
global $aliastable;
|
||||
|
||||
if (array_key_exists($name, $aliastable)) {
|
||||
return "\${$name}";
|
||||
} elseif (is_ipaddr($name) || is_subnet($name) || is_port($name) || is_portrange($name)) {
|
||||
return "{$name}";
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function subnet_size($subnet)
|
||||
{
|
||||
if (is_subnetv4($subnet)) {
|
||||
|
||||
@ -35,6 +35,22 @@ require_once("services.inc");
|
||||
require_once("filter.inc");
|
||||
require_once("interfaces.inc");
|
||||
|
||||
|
||||
/* expand a host or network alias, if necessary */
|
||||
function alias_expand($name)
|
||||
{
|
||||
global $aliastable;
|
||||
|
||||
if (array_key_exists($name, $aliastable)) {
|
||||
return "\${$name}";
|
||||
} elseif (is_ipaddr($name) || is_subnet($name) || is_port($name) || is_portrange($name)) {
|
||||
return "{$name}";
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function filter_generate_port(& $rule, $target = "source", $isnat = false) {
|
||||
$src = "";
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user