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
6e0b70a8
Commit
6e0b70a8
authored
Jul 23, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filter: bottom part of nat outbound logging; closes #916
parent
71f7d3c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
filter.inc
src/etc/inc/filter.inc
+8
-3
No files found.
src/etc/inc/filter.inc
View file @
6e0b70a8
...
@@ -1316,7 +1316,7 @@ function filter_nat_rules_outbound_automatic(&$FilterIflist, $src)
...
@@ -1316,7 +1316,7 @@ function filter_nat_rules_outbound_automatic(&$FilterIflist, $src)
}
}
/* Generate a 'nat on' or 'no nat on' rule for given interface */
/* Generate a 'nat on' or 'no nat on' rule for given interface */
function
filter_nat_rules_generate_if
(
&
$FilterIflist
,
$if
,
$src
=
"any"
,
$srcport
=
""
,
$dst
=
"any"
,
$dstport
=
""
,
$natip
=
""
,
$natport
=
""
,
$nonat
=
false
,
$staticnatport
=
false
,
$proto
=
""
,
$poolopts
=
""
)
function
filter_nat_rules_generate_if
(
&
$FilterIflist
,
$if
,
$src
=
"any"
,
$srcport
=
""
,
$dst
=
"any"
,
$dstport
=
""
,
$natip
=
""
,
$natport
=
""
,
$nonat
=
false
,
$staticnatport
=
false
,
$proto
=
""
,
$poolopts
=
""
,
$log
=
false
)
{
{
global
$config
;
global
$config
;
...
@@ -1338,6 +1338,10 @@ function filter_nat_rules_generate_if(&$FilterIflist, $if, $src = "any", $srcpor
...
@@ -1338,6 +1338,10 @@ function filter_nat_rules_generate_if(&$FilterIflist, $if, $src = "any", $srcpor
$tgt
=
"("
.
$FilterIflist
[
$if
][
'if'
]
.
")"
;
$tgt
=
"("
.
$FilterIflist
[
$if
][
'if'
]
.
")"
;
}
}
}
}
$logtag
=
''
;
if
(
$log
)
{
$logtag
=
'log'
;
}
/* Add the protocol, if defined */
/* Add the protocol, if defined */
if
(
!
empty
(
$proto
)
&&
$proto
!=
"any"
)
{
if
(
!
empty
(
$proto
)
&&
$proto
!=
"any"
)
{
if
(
$proto
==
"tcp/udp"
)
{
if
(
$proto
==
"tcp/udp"
)
{
...
@@ -1396,7 +1400,7 @@ function filter_nat_rules_generate_if(&$FilterIflist, $if, $src = "any", $srcpor
...
@@ -1396,7 +1400,7 @@ function filter_nat_rules_generate_if(&$FilterIflist, $if, $src = "any", $srcpor
$if_friendly
=
$FilterIflist
[
$if
][
'descr'
];
$if_friendly
=
$FilterIflist
[
$if
][
'descr'
];
/* Put all the pieces together */
/* Put all the pieces together */
if
(
$if_friendly
)
{
if
(
$if_friendly
)
{
$natrule
=
"
{
$nat
}
on
\$
{
$if_friendly
}
{
$protocol
}
from
{
$src
}
to
{
$dst
}
{
$target
}
{
$poolopts
}
{
$staticnatport_txt
}
\n
"
;
$natrule
=
"
{
$nat
}
{
$logtag
}
on
\$
{
$if_friendly
}
{
$protocol
}
from
{
$src
}
to
{
$dst
}
{
$target
}
{
$poolopts
}
{
$staticnatport_txt
}
\n
"
;
}
else
{
}
else
{
$natrule
.=
"# Could not convert
{
$if
}
to friendly name(alias)
\n
"
;
$natrule
.=
"# Could not convert
{
$if
}
to friendly name(alias)
\n
"
;
}
}
...
@@ -1611,7 +1615,8 @@ function filter_nat_rules_generate(&$FilterIflist)
...
@@ -1611,7 +1615,8 @@ function filter_nat_rules_generate(&$FilterIflist)
isset
(
$obent
[
'nonat'
]),
isset
(
$obent
[
'nonat'
]),
isset
(
$obent
[
'staticnatport'
]),
isset
(
$obent
[
'staticnatport'
]),
$obent
[
'protocol'
],
$obent
[
'protocol'
],
$poolopts
$poolopts
,
isset
(
$obent
[
'log'
])
);
);
}
}
}
}
...
...
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