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
b6484af7
Commit
b6484af7
authored
Jan 10, 2016
by
Manuel Faux
Committed by
Franco Fichtner
Jan 10, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backend functions: worked in some CR recommendations
parent
3f04c0a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
22 deletions
+22
-22
legacy_bindings.inc
src/etc/inc/legacy_bindings.inc
+22
-0
util.inc
src/etc/inc/util.inc
+0
-22
No files found.
src/etc/inc/legacy_bindings.inc
View file @
b6484af7
...
...
@@ -138,3 +138,25 @@ function legacy_move_config_list_items($source, $id, $items) {
return
$new_config
;
}
}
/**
* Retrieve description text of firewall alias by specifying the alias name.
* @param string $name alias name to retrieve the description from
* @return description of alias, or null if no description was set or alias
* does not exist.
*/
function
get_alias_description
(
$name
)
{
global
$config
;
if
(
isset
(
$config
[
'aliases'
][
'alias'
]))
{
foreach
(
$config
[
'aliases'
][
'alias'
]
as
$alias
)
{
if
(
$alias
[
'name'
]
==
$name
)
{
return
(
isset
(
$alias
[
'descr'
]))
?
$alias
[
'descr'
]
:
""
;
}
}
}
return
null
;
}
src/etc/inc/util.inc
View file @
b6484af7
...
...
@@ -1004,28 +1004,6 @@ function alias_expand($name) {
}
}
/* get description of alias */
function
get_alias_description
(
$name
)
{
global
$config
;
if
(
is_alias
(
$name
))
{
if
(
isset
(
$config
[
'aliases'
][
'alias'
]))
{
foreach
(
$config
[
'aliases'
][
'alias'
]
as
$alias
)
{
if
(
$alias
[
'name'
]
==
$name
)
{
return
(
isset
(
$alias
[
'descr'
]))
?
$alias
[
'descr'
]
:
""
;
}
}
return
null
;
}
}
}
function
subnet_size
(
$subnet
)
{
if
(
is_subnetv4
(
$subnet
))
{
list
(
$ip
,
$bits
)
=
explode
(
"/"
,
$subnet
);
...
...
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