Table of Contents

Module: RuleBuilder daxfi/RuleBuilder.py

RuleBuilder class (daxfi package).

The RuleBuilder class, used to generate Rule objects.

Copyright 2001 Davide Alberani <alberanid@mail.com>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Imported modules   
from daxfi import DTD_NAME, DaxfiError, sl_print_warning, sl_print_error, xml_targets, xml_commands, xml_protocols, StringTypes, iplib
import re
import socket
import string
import types
from xml.dom import minidom
from xml.dom.NodeFilter import NodeFilter
from xml.dom.NodeIterator import NodeIterator
from xml.sax import SAXParseException
Functions   
_normalize_option_negation
_set_defaults
transf_ignore
transf_ip
transf_port
transf_proto
transf_raise_exception
transf_remove
transf_remove_section
transf_sort
transf_target
  _normalize_option_negation 
_normalize_option_negation ( o )

Check for a space after an exclamation mark.

  _set_defaults 
_set_defaults ( dom,  defaults )

Set given default values in a DOM.

  transf_ignore 
transf_ignore ( v )

Return nothing if the value is ignore.

Exceptions   
RemoveOptionError( 'remove this option' )
  transf_ip 
transf_ip ( v )

Manage IP address.

Return an ip in dotted notation with the right netmask.

  transf_port 
transf_port ( v )

Return the port number.

Given a port name, return the protocol number.

  transf_proto 
transf_proto ( v )

Return the protocol number.

Given a protocol name, return the protocol number.

  transf_raise_exception 
transf_raise_exception ( v )

Raise an exception because a rule with this option/extension cannot be built with the currently used firewall.

Exceptions   
CreateRulesError( 'Cannot insert a key in a rule for ' + 'this firewall' )
  transf_remove 
transf_remove ( v )

Simply remove an entry.

Exceptions   
RemoveOptionError( 'remove this option' )
  transf_remove_section 
transf_remove_section ( d )

Raise an exception that force the modify_option function to completely discard the current section.

Exceptions   
RemoveSectionError( 'cannot use this extension with this firewall' )
  transf_sort 
transf_sort ( v )

For options that need to be sorted.

Given a string with comma separated items, these items are sorted; if portions of he string are sparated by spaces, the order of these groups is preserved.

  transf_target 
transf_target ( v )

Modify the target name.

Classes   
CreateRulesError

Exception raised when a rule cannot be built for a given firewall.

RemoveOptionError

Exception raised when we have to remove an option.

RemoveSectionError

Exception raised when we have to remove a section in a rule.

RuleBuilderBase

Class used to build a set of Rule objects.

_NodeFilterByElementName

Filter for NodeIterator.


Table of Contents

This document was automatically generated on Sat Sep 1 13:50:21 2001 by HappyDoc version r1_5