Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
e5845b22
Commit
e5845b22
authored
Aug 19, 2015
by
Ad Schellevis
Committed by
Franco Fichtner
Sep 14, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(legacy) refactor pconfig_to_address in guiconfig.inc, handle aliasses inline (like networks)
parent
5ea86dbe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
28 deletions
+29
-28
guiconfig.inc
src/www/guiconfig.inc
+29
-28
No files found.
src/www/guiconfig.inc
View file @
e5845b22
...
...
@@ -490,38 +490,39 @@ function address_to_pconfig($adr, &$padr, &$pmask, &$pnot, &$pbeginport, &$pendp
}
function
pconfig_to_address
(
&
$adr
,
$padr
,
$pmask
,
$pnot
=
false
,
$pbeginport
=
0
,
$pendport
=
0
)
{
$adr
=
array
();
if
(
$padr
==
"any"
)
$adr
[
'any'
]
=
true
;
else
if
(
is_specialnet
(
$padr
))
$adr
[
'network'
]
=
$padr
;
else
{
$adr
[
'address'
]
=
$padr
;
if
(
is_ipaddrv6
(
$padr
))
{
if
(
$pmask
!=
128
)
$adr
[
'address'
]
.=
"/"
.
$pmask
;
$adr
=
array
();
if
(
$padr
==
"any"
)
{
$adr
[
'any'
]
=
true
;
}
elseif
(
is_specialnet
(
$padr
))
{
$adr
[
'network'
]
=
$padr
;
}
elseif
(
is_alias
(
$padr
))
{
$adr
[
'address'
]
=
$padr
;
}
else
{
if
(
$pmask
!=
32
)
$adr
[
'address'
]
.=
"/"
.
$pmask
;
$adr
[
'address'
]
=
$padr
;
if
(
is_ipaddrv6
(
$padr
))
{
if
(
$pmask
!=
128
)
$adr
[
'address'
]
.=
"/"
.
$pmask
;
}
else
{
if
(
$pmask
!=
32
)
$adr
[
'address'
]
.=
"/"
.
$pmask
;
}
}
}
if
(
$pnot
)
$adr
[
'not'
]
=
true
;
else
unset
(
$adr
[
'not'
]);
if
((
$pbeginport
!=
0
)
&&
(
$pbeginport
!=
"any"
))
{
if
(
$pbeginport
!=
$pendport
)
$adr
[
'port'
]
=
$pbeginport
.
"-"
.
$pendport
;
else
$adr
[
'port'
]
=
$pbeginport
;
}
if
(
$pnot
)
{
$adr
[
'not'
]
=
true
;
}
elseif
(
isset
(
$adr
[
'not'
]))
{
unset
(
$adr
[
'not'
]);
}
if
(
is_alias
(
$pbeginport
))
{
$adr
[
'port'
]
=
$pbeginport
;
}
if
(
is_alias
(
$pbeginport
))
{
$adr
[
'port'
]
=
$pbeginport
;
}
elseif
((
$pbeginport
!=
0
)
&&
(
$pbeginport
!=
"any"
))
{
if
(
$pbeginport
!=
$pendport
)
{
$adr
[
'port'
]
=
$pbeginport
.
"-"
.
$pendport
;
}
else
{
$adr
[
'port'
]
=
$pbeginport
;
}
}
}
function
is_specialnet
(
$net
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment