Table of Contents

Class: RuleBase daxfi/Rule.py

Class that define a firewall rule.

A firewall rule is described with a RuleData object, the action to be taken for this rule and an optional ruleNumber (only for certain actions).

Methods   
__cmp__
__getattr__
__init__
__nonzero__
__repr__
__str__
__xor__
_getRuleCommand
copy
getAction
getBareXML
getDirection
getFirewallName
getModifiedRuleData
getRuleCommand
getRuleData
getRuleNumber
getTarget
getXML
reset
setAction
setRuleData
setRuleNumber
  __cmp__ 
__cmp__ ( self,  other )

Compare two rules.

  __getattr__ 
__getattr__ ( self,  name )

Called when an attribute lookup has not found the attribute.

Exceptions   
AttributeError, name
  __init__ 
__init__ (
        self,
        rd=RuleData(),
        action='',
        ruleNumber=None,
        )

Create a new rule.

rd

The RuleData object which describes the rule.

action

The action to be taken for this rule.

ruleNumber

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.

  __xor__ 
__xor__ ( self,  other )

Merge two rules.

  _getRuleCommand 
_getRuleCommand ( self )

Return a string used to run the command for this rule.

By default, just return the list of attributes of the RuleData 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 for this rule.

Return the action, one of the values in xml_actions.

  getBareXML 
getBareXML ( self )

Return the bare XML representation of the rule, without the action and the rule number.

  getDirection 
getDirection ( self )

Return the direction for this rule.

  getFirewallName 
getFirewallName ( self )

Return the firewall name.

  getModifiedRuleData 
getModifiedRuleData ( self )

Get the RuleData object modified with the self.converter dictionary.

  getRuleCommand 
getRuleCommand ( self )

Return a string that is the command to run this rule.

  getRuleData 
getRuleData ( self )

Return a copy of the RuleData object.

  getRuleNumber 
getRuleNumber ( self )

Get the rule number.

  getTarget 
getTarget ( self )

Return the target for this rule.

  getXML 
getXML ( self )

Return a pretty XML string for this rule.

  reset 
reset ( self )

Reset this Rule object.

  setAction 
setAction ( self,  action )

Set the action to be taken for this rule.

  setRuleData 
setRuleData ( self,  rd )

Set the RuleData object.

  setRuleNumber 
setRuleNumber ( self,  ruleNumber )

Set the rule number.


Table of Contents

This document was automatically generated on Tue Dec 17 17:48:18 2002 by HappyDoc version r1_5