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
0142ae76
Commit
0142ae76
authored
Sep 21, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall: merge aliases from master
parent
023e2d64
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
946 additions
and
1285 deletions
+946
-1285
legacy_bindings.inc
src/etc/inc/legacy_bindings.inc
+9
-7
util.inc
src/etc/inc/util.inc
+0
-8
firewall_aliases.php
src/www/firewall_aliases.php
+249
-238
firewall_aliases_edit.php
src/www/firewall_aliases_edit.php
+471
-771
firewall_aliases_import.php
src/www/firewall_aliases_import.php
+204
-212
guiconfig.inc
src/www/guiconfig.inc
+13
-49
No files found.
src/etc/inc/legacy_bindings.inc
View file @
0142ae76
...
...
@@ -92,13 +92,15 @@ function legacy_list_aliasses($type) {
$result
=
array
();
if
(
isset
(
$config
[
'aliases'
][
'alias'
]))
{
foreach
(
$config
[
'aliases'
][
'alias'
]
as
$alias
)
{
if
(
$type
==
"port"
)
{
if
(
preg_match
(
"/port/i"
,
$alias
[
'type'
]))
{
$result
[]
=
$alias
;
}
}
else
{
if
(
!
preg_match
(
"/port/i"
,
$alias
[
'type'
])){
$result
[]
=
$alias
;
if
(
!
empty
(
$alias
[
'address'
]))
{
if
(
$type
==
"port"
)
{
if
(
preg_match
(
"/port/i"
,
$alias
[
'type'
]))
{
$result
[]
=
$alias
;
}
}
else
{
if
(
!
preg_match
(
"/port/i"
,
$alias
[
'type'
])){
$result
[]
=
$alias
;
}
}
}
}
...
...
src/etc/inc/util.inc
View file @
0142ae76
...
...
@@ -306,14 +306,6 @@ function ip_range_to_subnet_array($startip, $endip) {
return
$rangesubnets
;
}
function
is_iprange
(
$range
)
{
if
(
substr_count
(
$range
,
'-'
)
!=
1
)
{
return
false
;
}
list
(
$ip1
,
$ip2
)
=
explode
(
'-'
,
$range
);
return
(
is_ipaddr
(
$ip1
)
&&
is_ipaddr
(
$ip2
));
}
/* returns true if $ipaddr is a valid dotted IPv4 address or a IPv6 */
function
is_ipaddr
(
$ipaddr
)
{
if
(
is_ipaddrv4
(
$ipaddr
))
{
...
...
src/www/firewall_aliases.php
View file @
0142ae76
This diff is collapsed.
Click to expand it.
src/www/firewall_aliases_edit.php
View file @
0142ae76
This diff is collapsed.
Click to expand it.
src/www/firewall_aliases_import.php
View file @
0142ae76
This diff is collapsed.
Click to expand it.
src/www/guiconfig.inc
View file @
0142ae76
...
...
@@ -330,48 +330,6 @@ function pprint_port($port) {
return
$pport
;
}
function
firewall_check_for_advanced_options
(
&
$item
)
{
$item_set
=
""
;
if
(
$item
[
'os'
])
$item_set
.=
"os
{
$item
[
'os'
]
}
"
;
if
(
$item
[
'dscp'
])
$item_set
.=
"dscp
{
$item
[
'dscp'
]
}
"
;
if
(
$item
[
'max'
])
$item_set
.=
"max
{
$item
[
'max'
]
}
"
;
if
(
$item
[
'max-src-nodes'
])
$item_set
.=
"max-src-nodes
{
$item
[
'max-src-nodes'
]
}
"
;
if
(
$item
[
'max-src-conn'
])
$item_set
.=
"max-src-conn
{
$item
[
'max-src-conn'
]
}
"
;
if
(
$item
[
'max-src-states'
])
$item_set
.=
"max-src-states
{
$item
[
'max-src-states'
]
}
"
;
if
(
isset
(
$item
[
'nopfsync'
]))
$item_set
.=
"nopfsync "
;
if
(
$item
[
'statetype'
]
!=
"keep state"
&&
$item
[
'statetype'
]
!=
""
)
$item_set
.=
"statetype
{
$item
[
'statetype'
]
}
"
;
if
(
$item
[
'statetimeout'
])
$item_set
.=
"statetimeout
{
$item
[
'statetimeout'
]
}
"
;
if
(
isset
(
$item
[
'nosync'
]))
$item_set
.=
"no XMLRPC Sync "
;
if
(
$item
[
'max-src-conn-rate'
])
$item_set
.=
"max-src-conn-rate
{
$item
[
'max-src-conn-rate'
]
}
"
;
if
(
$item
[
'max-src-conn-rates'
])
$item_set
.=
"max-src-conn-rates
{
$item
[
'max-src-conn-rates'
]
}
"
;
if
(
$item
[
'gateway'
])
$item_set
.=
"gateway
{
$item
[
'gateway'
]
}
"
;
if
(
$item
[
'tag'
])
$item_set
.=
"tag
{
$item
[
'tag'
]
}
"
;
if
(
$item
[
'tagged'
])
$item_set
.=
"tagged
{
$item
[
'tagged'
]
}
"
;
if
(
isset
(
$item
[
'allowopts'
]))
$item_set
.=
"allowopts "
;
if
(
isset
(
$item
[
'disablereplyto'
]))
$item_set
.=
"disable reply-to "
;
if
(
$item
[
'tcpflags_any'
]
||
$item
[
'tcpflags1'
]
||
$item
[
'tcpflags2'
])
$item_set
.=
"tcpflags set"
;
return
$item_set
;
}
function
gentitle
(
$title
)
{
$navlevelsep
=
": "
;
/* navigation level separator string */
if
(
!
is_array
(
$title
))
...
...
@@ -475,16 +433,19 @@ function update_if_changed($varname, & $orig, $new) {
function
address_to_pconfig
(
$adr
,
&
$padr
,
&
$pmask
,
&
$pnot
,
&
$pbeginport
,
&
$pendport
)
{
if
(
isset
(
$adr
[
'any'
]))
$padr
=
"any"
;
else
if
(
$adr
[
'network'
]
)
else
if
(
isset
(
$adr
[
'network'
])
)
$padr
=
$adr
[
'network'
];
else
if
(
$adr
[
'address'
])
{
list
(
$padr
,
$pmask
)
=
explode
(
"/"
,
$adr
[
'address'
]);
if
(
!
$pmask
)
{
else
if
(
isset
(
$adr
[
'address'
]))
{
if
(
strpos
(
$adr
[
'address'
],
'/'
)
!==
false
)
{
list
(
$padr
,
$pmask
)
=
explode
(
"/"
,
$adr
[
'address'
]);
}
else
{
$padr
=
$adr
[
'address'
];
if
(
is_ipaddrv6
(
$padr
))
$pmask
=
128
;
else
$pmask
=
32
;
}
}
if
(
isset
(
$adr
[
'not'
]))
...
...
@@ -492,10 +453,13 @@ function address_to_pconfig($adr, &$padr, &$pmask, &$pnot, &$pbeginport, &$pendp
else
$pnot
=
0
;
if
(
$adr
[
'port'
])
{
list
(
$pbeginport
,
$pendport
)
=
explode
(
"-"
,
$adr
[
'port'
]);
if
(
!
$pendport
)
if
(
isset
(
$adr
[
'port'
]))
{
if
(
strpos
(
$adr
[
'port'
],
'-'
)
!==
false
)
{
list
(
$pbeginport
,
$pendport
)
=
explode
(
"-"
,
$adr
[
'port'
]);
}
else
{
$pbeginport
=
$adr
[
'port'
];
$pendport
=
$pbeginport
;
}
}
else
if
(
!
is_alias
(
$pbeginport
)
&&
!
is_alias
(
$pendport
))
{
$pbeginport
=
"any"
;
$pendport
=
"any"
;
...
...
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