A firewall rule is described with a DOM object.
Methods
|
|
|
|
__cmp__
|
__cmp__ ( self, other )
Compare two rules.
|
|
__init__
|
__init__ (
self,
dom=None,
rn='-1',
)
Create a new rule.
- dom
The DOM that describes the rule.
- rn
The optional rule number (useful for 'insert'-like rules).
|
|
__nonzero__
|
__nonzero__ ( self )
The rule is true , if it generates a command.
|
|
__repr__
|
__repr__ ( self )
The representation string for Rule objects.
|
|
__str__
|
__str__ ( self )
Print this rule.
|
|
_getRuleCommand
|
_getRuleCommand ( self )
Return a string used to run the command for this rule.
By default, just return the list of attributes of the
DOM object.
This method must be override in the Rule class that
inherits from this class.
|
|
copy
|
copy ( self )
Return a copy of itself.
|
|
getAction
|
getAction ( self )
Get the action name.
Return the action name, one of the values in xml_commands.
|
|
getDom
|
getDom ( self )
Get the DOM.
|
|
getFirewallName
|
getFirewallName ( self )
Return the firewall name.
|
|
getModifiedDom
|
getModifiedDom ( self )
Get the DOM as modified with the self.converter dictionary.
|
|
getRuleCommand
|
getRuleCommand ( self )
Return a string that is the command to run this rule.
|
|
getRuleNumber
|
getRuleNumber ( self )
Get the rule number.
|
|
getXML
|
getXML ( self )
Return a pretty XML string for this rule.
|
|
setDom
|
setDom ( self, o )
Set the DOM.
|
|
setRuleNumber
|
setRuleNumber ( self, rn )
Set the rule number.
|