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
044a5efc
Commit
044a5efc
authored
Jul 13, 2012
by
Kaarle Ritvanen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Config.input renamed to Config.objects
parent
da7f4cb2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
awall/init.lua
awall/init.lua
+6
-6
awall/model.lua
awall/model.lua
+1
-1
No files found.
awall/init.lua
View file @
044a5efc
...
...
@@ -61,11 +61,11 @@ Config = object.class(object.Object)
function
Config
:
init
(
policyconfig
)
self
.
input
=
policyconfig
:
expand
()
self
.
objects
=
policyconfig
:
expand
()
self
.
iptables
=
iptables
.
IPTables
.
new
()
local
function
morph
(
path
,
cls
)
local
objs
=
self
.
input
[
path
]
local
objs
=
self
.
objects
[
path
]
if
objs
then
for
k
,
v
in
pairs
(
objs
)
do
objs
[
k
]
=
cls
.
morph
(
v
,
...
...
@@ -89,7 +89,7 @@ function Config:init(policyconfig)
local
function
insertdefrules
(
phase
)
for
i
,
rulegroup
in
ipairs
(
defrules
[
phase
]
or
{})
do
if
type
(
rulegroup
)
==
'function'
then
insertrules
(
rulegroup
(
self
.
input
))
insertrules
(
rulegroup
(
self
.
objects
))
else
insertrules
(
rulegroup
)
end
end
end
...
...
@@ -99,8 +99,8 @@ function Config:init(policyconfig)
insertdefrules
(
'pre'
)
for
i
,
path
in
ipairs
(
procorder
)
do
if
self
.
input
[
path
]
then
for
i
,
rule
in
ipairs
(
self
.
input
[
path
])
do
if
self
.
objects
[
path
]
then
for
i
,
rule
in
ipairs
(
self
.
objects
[
path
])
do
insertrules
(
rule
:
trules
())
end
end
...
...
@@ -108,7 +108,7 @@ function Config:init(policyconfig)
end
morph
(
'ipset'
,
awall
.
model
.
ConfigObject
)
self
.
ipset
=
ipset
.
IPSet
.
new
(
self
.
input
.
ipset
)
self
.
ipset
=
ipset
.
IPSet
.
new
(
self
.
objects
.
ipset
)
end
function
Config
:
print
()
...
...
awall/model.lua
View file @
044a5efc
...
...
@@ -24,7 +24,7 @@ ConfigObject = class(awall.object.Object)
function
ConfigObject
:
init
(
context
,
location
)
if
context
then
self
.
context
=
context
self
.
root
=
context
.
input
self
.
root
=
context
.
objects
end
self
.
location
=
location
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