Class used to build a set of Rule objects.
The parseXMLString() method return a list of Rule objects
for the given XML string.
Methods
|
|
__init__
getRules
getRulesWithLog
getRulesWithoutLog
parseXMLString
reset
setFirewallName
setRuleClass
|
|
__init__
|
__init__ (
self,
ruleClass,
firewallName,
)
Initialize a RuleBuilder object.
- ruleClass
the class used to create Rule objects.
- firewallName
the name of the firewall.
|
|
getRules
|
getRules (
self,
rd,
action,
rn,
)
Return the rules for the given XML.
|
|
getRulesWithLog
|
getRulesWithLog (
self,
rd,
action,
rn,
)
Return the rules for this XML.
Elaborate the current XML and return a set of Rule object.
For firewalls that can log and set rules with a single command.
|
|
getRulesWithoutLog
|
getRulesWithoutLog (
self,
rd,
action,
rn,
)
Return the rules for firewalls without a log option
(they need a separated logging rule, like iptables).
|
|
parseXMLString
|
parseXMLString ( self, xmlString )
Parse a given XML string; return a list of Rule objects.
|
|
reset
|
reset ( self )
Reset the builder.
|
|
setFirewallName
|
setFirewallName ( self, firewallName )
Another hack.
|
|
setRuleClass
|
setRuleClass ( self, ruleClass )
An hack.
|
|