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
b4fb57b3
Commit
b4fb57b3
authored
Jul 20, 2012
by
Kaarle Ritvanen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dynamically discover classes in ConfigObject.create
parent
7481a54f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
awall/model.lua
awall/model.lua
+7
-0
awall/modules/filter.lua
awall/modules/filter.lua
+1
-3
No files found.
awall/model.lua
View file @
b4fb57b3
...
...
@@ -30,6 +30,13 @@ function ConfigObject:init(context, location)
end
function
ConfigObject
:
create
(
cls
,
params
)
if
type
(
cls
)
==
'string'
then
local
name
=
cls
cls
=
awall
.
classmap
[
cls
]
if
not
cls
then
self
:
error
(
'Support for '
..
name
..
' objects not installed'
)
end
end
return
cls
.
morph
(
params
,
self
.
context
,
self
.
location
)
end
...
...
awall/modules/filter.lua
View file @
b4fb57b3
...
...
@@ -69,9 +69,7 @@ function Filter:trules()
dnat
[
attr
]
=
self
[
attr
]
end
if
not
awall
.
classmap
.
dnat
then
self
:
error
(
'NAT module not installed'
)
end
awall
.
util
.
extend
(
res
,
self
:
create
(
awall
.
classmap
.
dnat
,
dnat
):
trules
())
awall
.
util
.
extend
(
res
,
self
:
create
(
'dnat'
,
dnat
):
trules
())
end
awall
.
util
.
extend
(
res
,
model
.
Rule
.
trules
(
self
))
...
...
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