Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
awall
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
7
Issues
7
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
awall
Commits
b82c8837
Commit
b82c8837
authored
Jan 08, 2017
by
Kaarle Ritvanen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Filter.extraoptfrags: reorder function
parent
1db4c27f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
31 deletions
+28
-31
awall/modules/filter.lua
awall/modules/filter.lua
+28
-31
No files found.
awall/modules/filter.lua
View file @
b82c8837
...
...
@@ -349,47 +349,44 @@ end
function
Filter
:
extraoptfrags
()
local
limit
=
self
:
limit
()
if
limit
then
if
self
.
action
~=
'accept'
then
self
:
error
(
'Cannot specify limit for '
..
self
.
action
..
' filter'
)
end
if
not
limit
then
return
Filter
.
super
(
self
):
extraoptfrags
()
end
local
limitchain
=
self
:
uniqueid
(
'limit'
)
local
limitlog
=
self
[
limit
].
log
local
limitobj
=
self
:
create
(
FilterLimit
,
self
[
limit
],
'limit'
)
if
self
.
action
~=
'accept'
then
self
:
error
(
'Cannot specify limit for '
..
self
.
action
..
' filter'
)
end
local
ofs
=
{}
local
logch
,
limitofs
local
accept
=
self
:
position
()
==
'append'
local
limitchain
=
self
:
uniqueid
(
'limit'
)
local
limitlog
=
self
[
limit
].
log
local
limitobj
=
self
:
create
(
FilterLimit
,
self
[
limit
],
'limit'
)
local
uofs
,
sofs
=
limitobj
:
recentofrags
(
limitchain
)
local
ofs
=
{}
local
logch
,
limitofs
local
accept
=
self
:
position
()
==
'append'
if
uofs
then
ofs
,
logch
=
self
:
logchain
(
limitlog
,
'drop'
,
'DROP'
)
local
uofs
,
sofs
=
limitobj
:
recentofrags
(
limitchain
)
limitofs
=
combinations
(
uofs
,
{{
target
=
logch
}})
if
accept
and
self
.
log
then
extend
(
limitofs
,
self
.
log
:
optfrags
())
end
extend
(
limitofs
,
combinations
(
sofs
,
{{
target
=
accept
and
'ACCEPT'
or
nil
}})
)
if
uofs
then
ofs
,
logch
=
self
:
logchain
(
limitlog
,
'drop'
,
'DROP'
)
else
if
accept
then
ofs
,
logch
=
self
:
logchain
(
self
.
log
,
'accept'
,
'ACCEPT'
)
else
logch
=
'RETURN'
end
limitofs
=
combinations
(
uofs
,
{{
target
=
logch
}})
if
accept
and
self
.
log
then
extend
(
limitofs
,
self
.
log
:
optfrags
())
end
extend
(
limitofs
,
combinations
(
sofs
,
{{
target
=
accept
and
'ACCEPT'
or
nil
}})
)
limitofs
=
combinations
(
limitobj
:
limitofrags
(
limitchain
),
{{
target
=
logch
}}
)
if
limitlog
then
extend
(
limitofs
,
limitlog
:
optfrags
())
end
table.insert
(
limitofs
,
{
target
=
'DROP'
})
end
else
if
accept
then
ofs
,
logch
=
self
:
logchain
(
self
.
log
,
'accept'
,
'ACCEPT'
)
else
logch
=
'RETURN'
end
extend
(
ofs
,
combinations
({{
chain
=
limitchain
}},
limitofs
))
return
ofs
limitofs
=
combinations
(
limitobj
:
limitofrags
(
limitchain
),
{{
target
=
logch
}}
)
if
limitlog
then
extend
(
limitofs
,
limitlog
:
optfrags
())
end
table.insert
(
limitofs
,
{
target
=
'DROP'
})
end
return
Filter
.
super
(
self
):
extraoptfrags
()
extend
(
ofs
,
combinations
({{
chain
=
limitchain
}},
limitofs
))
return
ofs
end
...
...
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