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).
|
|
__str__
|
__str__ ( self )
Print this rule.
|
|
copy
|
copy ( self )
Return a copy of itself.
|
|
createRuleCommand
|
createRuleCommand ( self )
Return a string that is the command to run 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.
|
|
geAction
|
geAction ( self )
Get the action name.
Return the action name, one of the values in xml_commands.
|
|
getDom
|
getDom ( self )
Get the DOM.
|
|
getRuleNumber
|
getRuleNumber ( self )
Get the rule number.
|
|
setDom
|
setDom ( self, o )
Set the DOM.
|
|
setRuleNumber
|
setRuleNumber ( self, rn )
Set the rule number.
|
|
toxml
|
toxml ( self )
Return a pretty XML string for this rule.
|